mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 06:30:23 +00:00
feat(gateway): stream thinking events and decouple tool events from verbose level (#10568)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user