fix: add agent context to ws logs

This commit is contained in:
Peter Steinberger
2026-01-17 20:12:38 +00:00
parent f5d5ef6857
commit d9c29f5ce5
5 changed files with 33 additions and 1 deletions

View File

@@ -29,12 +29,15 @@ describe("gateway ws log helpers", () => {
test("summarizeAgentEventForWsLog extracts useful fields", () => {
const summary = summarizeAgentEventForWsLog({
runId: "12345678-1234-1234-1234-123456789abc",
sessionKey: "agent:main:main",
stream: "assistant",
seq: 2,
data: { text: "hello world", mediaUrls: ["a", "b"] },
});
expect(summary).toMatchObject({
agent: "main",
run: "12345678…9abc",
session: "main",
stream: "assistant",
aseq: 2,
text: "hello world",