mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:41:23 +00:00
feat(gateway): stream thinking events and decouple tool events from verbose level (#10568)
This commit is contained in:
@@ -84,7 +84,7 @@ describe("agent event handler", () => {
|
||||
resetAgentRunContextForTest();
|
||||
});
|
||||
|
||||
it("suppresses tool events when verbose is off", () => {
|
||||
it("broadcasts tool events to WS recipients even when verbose is off, but skips node send", () => {
|
||||
const broadcast = vi.fn();
|
||||
const broadcastToConnIds = vi.fn();
|
||||
const nodeSendToSession = vi.fn();
|
||||
@@ -114,7 +114,11 @@ describe("agent event handler", () => {
|
||||
data: { phase: "start", name: "read", toolCallId: "t2" },
|
||||
});
|
||||
|
||||
expect(broadcastToConnIds).not.toHaveBeenCalled();
|
||||
// Tool events always broadcast to registered WS recipients
|
||||
expect(broadcastToConnIds).toHaveBeenCalledTimes(1);
|
||||
// But node/channel subscribers should NOT receive when verbose is off
|
||||
const nodeToolCalls = nodeSendToSession.mock.calls.filter(([, event]) => event === "agent");
|
||||
expect(nodeToolCalls).toHaveLength(0);
|
||||
resetAgentRunContextForTest();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user