feat(gateway): stream thinking events and decouple tool events from verbose level (#10568)

This commit is contained in:
Nate
2026-02-10 19:17:21 -06:00
committed by GitHub
parent d2c2f4185b
commit 2b02e8a7a8
5 changed files with 48 additions and 7 deletions

View File

@@ -304,6 +304,14 @@ export const agentHandlers: GatewayRequestHandlers = {
);
if (connId && wantsToolEvents) {
context.registerToolEventRecipient(runId, connId);
// Register for any other active runs *in the same session* so
// late-joining clients (e.g. page refresh mid-response) receive
// in-progress tool events without leaking cross-session data.
for (const [activeRunId, active] of context.chatAbortControllers) {
if (activeRunId !== runId && active.sessionKey === requestedSessionKey) {
context.registerToolEventRecipient(activeRunId, connId);
}
}
}
const wantsDelivery = request.deliver === true;

View File

@@ -535,6 +535,14 @@ export const chatHandlers: GatewayRequestHandlers = {
);
if (connId && wantsToolEvents) {
context.registerToolEventRecipient(runId, connId);
// Register for any other active runs *in the same session* so
// late-joining clients (e.g. page refresh mid-response) receive
// in-progress tool events without leaking cross-session data.
for (const [activeRunId, active] of context.chatAbortControllers) {
if (activeRunId !== runId && active.sessionKey === p.sessionKey) {
context.registerToolEventRecipient(activeRunId, connId);
}
}
}
},
onModelSelected,