fix(gateway): stream chat events for agent runs

This commit is contained in:
Peter Steinberger
2026-01-02 01:04:59 +01:00
parent 7f3113b8d4
commit c0976ec099
8 changed files with 578 additions and 86 deletions

View File

@@ -37,6 +37,7 @@ import {
saveSessionStore,
} from "../config/sessions.js";
import { logVerbose } from "../globals.js";
import { registerAgentRunContext } from "../infra/agent-events.js";
import { buildProviderSummary } from "../infra/provider-summary.js";
import { triggerClawdisRestart } from "../infra/restart.js";
import {
@@ -1196,6 +1197,9 @@ export async function getReplyFromConfig(
await startTypingLoop();
}
const runId = crypto.randomUUID();
if (sessionKey) {
registerAgentRunContext(runId, { sessionKey });
}
let runResult: Awaited<ReturnType<typeof runEmbeddedPiAgent>>;
try {
runResult = await runEmbeddedPiAgent({