feat(gateway): enrich agent WS logs

This commit is contained in:
Peter Steinberger
2025-12-20 14:54:38 +00:00
parent f508fd3fa2
commit d95c09d94a
2 changed files with 86 additions and 11 deletions

View File

@@ -1738,11 +1738,16 @@ describe("web auto-reply", () => {
const resolver = vi
.fn()
.mockImplementation(async (_ctx, opts?: { onToolResult?: Function }) => {
await opts?.onToolResult?.({ text: "[🛠️ tool1]" });
await opts?.onToolResult?.({ text: "[🛠️ tool2]" });
return { text: "final" };
});
.mockImplementation(
async (
_ctx,
opts?: { onToolResult?: (r: { text: string }) => Promise<void> },
) => {
await opts?.onToolResult?.({ text: "[🛠️ tool1]" });
await opts?.onToolResult?.({ text: "[🛠️ tool2]" });
return { text: "final" };
},
);
await monitorWebProvider(false, listenerFactory, false, resolver);
expect(capturedOnMessage).toBeDefined();