fix: prevent duplicate agent event emission

This commit is contained in:
Peter Steinberger
2026-01-20 09:24:07 +00:00
parent 9dbc1435a6
commit 94af5a72fc
7 changed files with 182 additions and 30 deletions

View File

@@ -434,6 +434,7 @@ export async function agentCommand(
streamParams: opts.streamParams,
agentDir,
onAgentEvent: (evt) => {
// Track lifecycle end for fallback emission below.
if (
evt.stream === "lifecycle" &&
typeof evt.data?.phase === "string" &&
@@ -441,11 +442,6 @@ export async function agentCommand(
) {
lifecycleEnded = true;
}
emitAgentEvent({
runId,
stream: evt.stream,
data: evt.data,
});
},
});
},