You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI and MCP each reimplement the tracked-run lifecycle; one RunLifecycle, second Ctrl-C still finalizes #1663
Tracked cloud runs (register, running, terminal) are driven by apps/cli/src/lib/run-tracker.ts (createRunFinalizer, ~690) for the CLI and again by mcp/billed-audit.ts:109-170 (RunLifecycle, closeRun, lifecycles map, shuttingDown) for MCP. Both reimplement at-most-once terminal. The SIGINT handler is process.once, so a second Ctrl-C skips finalize, and the run waits for the server-side reaper.
Approach: one RunLifecycle (register, markRunning, close(terminal)) with at-most-once close and bounded retries, used by both. Handle SIGINT so a second signal still sends the terminal status before exit (with a short cap).
Acceptance Criteria
CLI audit and the MCP server use the same lifecycle module
Test: close() called twice sends one terminal update
Test: a second SIGINT during finalize still sends the terminal status (or exits after a documented cap)
Activity
refactor(cli): one RunLifecycle for the audit and the MCP server; a s…