Repository navigation
test(remote-runtime): pin the 12 hand-kept error-code lists to their callers' policy - #30246
Conversation
…callers' policy Each list that decides delivered / undelivered / recoverable / definitive by code now has a test naming its codes, the message fragments it relies on, and nearby codes it must not treat the same. Includes the #30146 shape: a client-minted runtime_manually_disconnected keeps a user's close for replay. Tests only; no production change.
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/cli/handlers/jira-write.test.ts: 1
44-44: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the Jira uncertainty warning.
This assertion checks
jira_write_unverifiedbut not its message. If the warning disappears while the code remains, the test still passes. Assert the fragment “The Jira change may have been applied” so the test covers the message fallback named in the PR objective.Proposed test change
- ).resolves.toMatchObject({ code: 'jira_write_unverified' }) + ).resolves.toMatchObject({ + code: 'jira_write_unverified', + message: expect.stringContaining('The Jira change may have been applied') + })
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1b423917-1d57-4db8-a1c7-b4aab6c16376
📒 Files selected for processing: 12
src/cli/handlers/jira-write.test.tssrc/cli/orchestration-mutation-recovery.test.tssrc/renderer/src/components/automations/automation-host-cache-error.test.tssrc/renderer/src/lib/launch-structured-agent-session.test.tssrc/renderer/src/runtime/web-runtime-browser-creation-failure.test.tssrc/renderer/src/runtime/web-runtime-session-tab-close-undelivered-codes.test.tssrc/renderer/src/runtime/web-session-terminal-orphan-recovery-adoption.test.tssrc/renderer/src/startup/startup-web-host-unreachable.test.tssrc/renderer/src/store/slices/worktrees/teardown/host-worktree-removal-state.test.tssrc/shared/agent-session-definitive-refusal.test.tssrc/shared/remote-runtime-client-error-classification.test.tssrc/shared/structured-agent-session-send-evidence.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
ELI5
Orca has about a dozen small lists of error codes. Each one answers a question like "did my close reach the server?" or "is it safe to retry?". Nothing stopped someone from quietly removing a code from one of these lists, or from adding a new code that one of them silently mishandles. That is how #30146 happened: a tab you closed while a server was disconnected came back. This PR adds tests that pin each list, so any change to one becomes a visible, reviewed test change.
What Changed
Tests only. Production code is unchanged. For each of the 12 lists, a test names:
web-runtime-session-tab-lifecycle.ts)web-runtime-session-tab-close-undelivered-codes.test.ts, including the #30146 shape: a client-mintedruntime_manually_disconnected, as an envelope and as a bareError, keeps the close for replayremote-runtime-client-error-classification.ts)startup-web-host-unreachable.ts)host-worktree-removal-state.ts)automation-host-cache-error.ts)orchestration-mutation-recovery.ts)jira-write.ts)runtime_errorweb-runtime-browser-creation-failure.ts)Why
The round-2 plan was to fold these lists into one classifier. A design review showed that can't be done without changing behaviour: the lists encode per-caller rules, and nothing on main reliably records whether a request reached the host. The fold is deferred to a separate "dispatch evidence" project. Pinning the lists now gives that project a behavioural baseline and stops silent drift in the meantime.
Linked Issue
N/A (round-2 SSH hardening, S5 follow-up; regression guard for #30146).
Visual Proof
N/A: tests only.
Testing
src/cli/handlers,src/renderer/src/startup,components/automations,store/slices/worktrees/teardown: 160 files, 1493 tests).runtime_manually_disconnectedin the close list makes the new close test fail.