Repository navigation
test(orchestration): pin the Run-required contract for unbound direct mail - #19684
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe end-to-end test verifies that direct mail from a sender in no Run is rejected. It checks for a Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change updates E2E coverage so unbound direct mail is rejected without creating mailbox state or changing pane input. The expected failure behavior and side-effect boundaries are covered, with no current merge-readiness risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Rewrites the unbound-mail E2E spec to pin the Run-required refusal — the test now asserts that
orchestration.sendto a bare handle from a sender in no Run rejects withcode: 'runtime_error', aRun is requiredmessage, anddataof exactly{ orchestrationRequestId }, and that the mailbox stays empty through a busy→idle edge with no pointer or synthesized Enter reaching the agent.
I traced the full contract and it holds: insertMessage throws a plain Error('Run is required'), mapRuntimeError flattens it to runtime_error with no recovery data, and the client's durable-mutation recovery stamps only orchestrationRequestId (no originalCommand, since orchestration.send is not a worker command). The toEqual on data is deliberately tight — it would catch a future regression where the server starts attaching recovery data or the client starts populating originalCommand — and the inline comment documents exactly why runtime_error rather than run_required, so it is pinning behavior, not theatre.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…dow for unbound mail

ELI5
One E2E test still expected the pre-#19542 world where mail to a bare terminal handle from a sender in no Run was quietly filed under the legacy Run. #19542 made that a hard refusal, so the test now pins the refusal instead.
What Changed
tests/e2e/orchestration-idle-mail-delivery.spec.ts: the testkeeps unbound direct mail durable without pointing to an unsafe checkis rewritten asrefuses unbound direct mail from a sender in no Run instead of pushing it, keeping its position and the spec's structure. It now asserts, in order:orchestration.sendfrom the non-Run test client to the pane's bare handle rejects with aRuntimeRpcFailureErrorwhosecodeisruntime_errorand whosemessagecontainsRun is required.datacarries the client's own durable-mutation stamp (orchestrationRequestId, fromsrc/cli/runtime/client-error-recovery.ts) and has none of the server-sideorchestrationSkillRecoveryData()keys (effectsApplied,guide,nextCommandArgs,nextSteps) — pinning that the server attached no recovery data, without freezing the client stamp's exact shape (an exacttoEqualwould go red with no product change iforchestration-recovery-command.tsever mappedorchestration.sendto anoriginalCommand).readMailbox(userDataDir, pane.handle)is[]immediately after the rejection.NO_DELIVERY_SETTLE_MSelapse so the push window (microtask + 500 ms Enter delay) is fully covered, the mailbox is still[]and the fake agent's stdin ledger is byte-identical to its pre-send snapshot — no pointer, no synthesized Enter.Why
#19542 (
98fdbc4ade, "file federated worker mail under the coordinator Run") deleted every?? LEGACY_RUN_IDwrite fallback; its body states the intended contract directly:On the send path,
recipient-routing.tsresolves a bare handle with a live pane but no Run/Dispatch torunId: params.senderRunId; the E2E client is in no Run, soinsertMessagethrowsRun is required(src/main/runtime/orchestration/db/messages/message-insert.ts). The old test asserted the pre-#19542 outcome (row stored withread: 0, delivered_at: null), so it fails with that error atsendMail. #19542 touched no E2E file ande2e.ymlonly runs on schedule/dispatch, which is how it slipped past PR CI.It is the only remaining red spec on main's scheduled E2E and on the 1.4.199 release branch: runs 34284171625 and 34298315442.
The new test keeps the title's original intent — unbound direct mail must never be pushed into an idle pane — and states the mechanism that now guarantees it: nothing is stored, so the idle scan has nothing to point at.
Linked Issue
N/A — follow-up to #19542; no separate issue filed.
Visual Proof
N/A — test-only change to an E2E spec; no UI or interaction change.
Testing
All run locally on macOS (darwin arm64) in a fresh worktree (origin/main
210ac1f77c+ these commits),pnpm installfrom scratch.Second commit
238d2d797a(review tightenings: absence checks on the recovery keys, settle window before the ledger read):SKIP_BUILD=1 ORCA_BACKGROUND_LAUNCH=1 npx playwright test tests/e2e/orchestration-idle-mail-delivery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 -g "unbound direct mail"pnpm run check:code-quality:changedtypecheck:e2eFirst commit
b09788541a:SKIP_BUILD=1 ORCA_BACKGROUND_LAUNCH=1 npx playwright test tests/e2e/orchestration-idle-mail-delivery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1(whole file)-g "unbound direct mail"(the rewritten test alone; first run includedpnpm run ensure:electron-runtime+ the globalSetup build)message: 'Run is required'exact,data: undefined)Orchestration mutation request ID: <uuid>.anddata: { orchestrationRequestId }from the client's durable-mutation recovery; assertion corrected to that observed shape (this is what the committed test pins)pnpm run check:code-quality:changedpnpm run typecheck:e2econfig/tsconfig.e2e.jsondocuments this project as not yet enforced (~198 known errors)git diff --checkpnpm tc(node/cli/web)src/change, so nothing for those projects to see; the E2E-specific project above covers the changed filee2e.ymlruns on schedule/dispatch — the next scheduled main run and a re-run on the 1.4.199 release branch are the real gateFollow-up (not done here, product code deliberately untouched)
Error('Run is required')frominsertMessage, whichmapRuntimeError(src/main/runtime/rpc/errors.ts) flattens to wire coderuntime_errorwith no recovery data. The sibling no-recipient path a few lines earlier insend-methods.tsthrowsOrchestrationError('run_required', ..., orchestrationSkillRecoveryData())(effectsApplied,guide,nextSteps). If the unbound-handle refusal should be equally actionable for agents (run_required+ recovery data), that is a product change; this test'scode/dataassertions are the ones to update with it. Same applies to the other three writers fix(orchestration): file federated worker mail under the coordinator Run #19542 hardened (task-store.ts,decision-gate-store.ts,check-worker.ts).Review
Agent skill upstream boundary
N/A