fix(cli): report interrupted runs in deploy status and telemetry - #425
Conversation
- Emit an interrupted report when status reads are aborted - Preserve the last completed poll in interrupted wait reports - Add coverage and document the interrupted status state
- Keep context after aborted normal flushes - Coordinate flushes to emit at most one event - Add coverage for interrupted telemetry runs
- Wrap context resolution in interrupt handling - Test interrupted agent-mode status reporting
- Allow shutdown telemetry flushes to proceed independently - Add coverage for slow normal flushes that ignore interrupts
🦋 Changeset detectedLatest commit: 4048636 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Stack: wyattjoh/interrupt-report-gaps Part of a stacked-prs chain. Do not merge manually. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 9 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthrough
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to This change improves interrupted deploy status reporting and telemetry without any supplied merge-blocking risk; it is merge-ready after normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
…sing on main Main's #425 added the interrupted deploy-status report and a Ctrl-C mid-wait test before this branch's proxyUrl field existed; give the interrupted report a null proxyUrl and expect the proxy component in the merged test.
Summary
Two reporting gaps left open by #420, both on the Ctrl-C path.
clerk deploy statusprints nothing at all when an interrupt lands before its wait loop starts. Only the wait was covered by the interrupt catch that #420 added, so an interrupt during application resolution, the preflight DNS check, or the state read escaped uncovered, andrunProgramreturns early without rendering anything. The catch now spans the whole command and emits whatever has been established: a full report once the live state resolves, and astate: "interrupted"report before that. The latter asserts nothing about the deploy, so agent-mode stdout stays parseable without claiming there is no production instance — the question an interrupted run never got to answer.An interrupted run also sent no telemetry event at all.
finalizeAndSendTelemetrycleared the module context at entry, so a Ctrl-C mid-POST left the shutdown flush with nothing to report and theoutcome: "abort"event was never sent. The context is now held until a send actually lands, which is enough on its own to keep a run to one event: a normal flush still running when the shutdown flush starts can no longer land, because its POST is composed with the interrupt signal that has already been aborted, and one that landed before the interrupt has already recorded itself. The shutdown flush therefore never waits on the normal one, whose remaining config and Git reads observe no signal and could otherwise burn its entire 250ms budget.One case is left alone deliberately: a Ctrl-C in the bookkeeping tail after the POST has landed still records the success. That event cannot be retracted, and sending a second would double-count the run.
Test plan
bun run format:checkbun run lintbun run typecheckbun run test— 2650 pass, 0 fail