Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions assistant/src/runtime/run-orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class RunOrchestrator {
// Hook into session to intercept confirmation_request events.
// When the prompter sends a confirmation_request, we record it in the
// run store so the web UI can poll and submit a decision.
// Pass hasNoClient=true so interactive-only prompts (e.g. host
// attachment reads) fail fast instead of waiting for a timeout.
// Do NOT set hasNoClient — run sessions have a client (the HTTP caller)
// and confirmations are handled via the /runs/:id/decision endpoint.
let lastError: string | null = null;
session.updateClient((msg: ServerMessage) => {
if (msg.type === 'confirmation_request') {
Expand All @@ -106,13 +106,15 @@ export class RunOrchestrator {
session,
});
}
}, true);
});

// Fire-and-forget the agent loop
const cleanup = () => {
this.pending.delete(run.id);
// Reset the session's client callback to a no-op so the stale
// closure doesn't intercept events from future runs on the same session.
// Set hasNoClient=true here since the run is done and no HTTP caller
// is actively listening — truly no client at this point.
session.updateClient(() => {}, true);
};

Expand Down
Loading