Skip to content

Commit 9d4cd0a

Browse files
committed
test(webapp): temporary CI diagnostics for empty session-agent .out
Logs the agent run rejection and, in EA1, dumps the collected .out parts plus a direct out/records readback, to localize whether the agent's writes reach S2 in CI or the read path returns empty. To be reverted.
1 parent 71166f5 commit 9d4cd0a

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

apps/webapp/test/helpers/agentHarness.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ export function runRealChatAgent(opts: RunRealChatAgentOptions): RunningAgent {
112112
) as Promise<void>
113113
).finally(restore);
114114

115+
done.catch((e) => {
116+
const err = e instanceof Error ? e : new Error(String(e));
117+
console.error(
118+
"[AGENT-DIAG] run rejected",
119+
opts.agentId,
120+
runId,
121+
`${err.name}: ${err.message}`,
122+
(err.stack ?? "").split("\n").slice(1, 6).join(" || ")
123+
);
124+
});
125+
115126
return {
116127
done,
117128
close: async () => {

apps/webapp/test/session-agent.e2e.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,20 @@ describe("session agent e2e (real chat.agent loop)", () => {
317317
maxMs: 30_000,
318318
});
319319

320+
const dbg = await fetch(
321+
`${baseUrl}/realtime/v1/sessions/${encodeURIComponent(addressingKey)}/out/records`,
322+
{ headers: { Authorization: `Bearer ${token}` } }
323+
);
324+
console.error(
325+
"[EA1-DIAG] collected parts:",
326+
parts.length,
327+
JSON.stringify(parts.map((p) => ({ id: p.id, chunk: p.chunk, headers: p.headers }))).slice(
328+
0,
329+
600
330+
)
331+
);
332+
console.error("[EA1-DIAG] out/records readback:", dbg.status, (await dbg.text()).slice(0, 900));
333+
320334
const text = parts
321335
.filter((p) => p.chunk != null)
322336
.map((p) => JSON.stringify(p.chunk))

0 commit comments

Comments
 (0)