Repository navigation
spec(FIX-2269): a wait killed before it parks still answers - #4058
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiEuGX4bfXGJoNxGQ6f
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture pass (direction check, not a build plan)Verdict: D1 holds. Fixing this in the engine is better than a Workforce-side recovery path, and the dispatcher gap in F1 · The "careless caller" debt is mostly the existing durable-action contract (reframe, shrinks the debt)The spec says a caller that owes a park "says its request is safe to replay up to the park", and calls that new debt. But
F2 · Where the replay starts is wider than the caller can vouch forRelated, and the real residual risk. The wait caller only knows its own send's F3 · E4's retry bound adds state; check whether an existing bound already covers itE4 adds a "continued three times" counter on top of the obligation (E5's new field or row). That is a second new persisted field. Before adding it, look at whether the existing orphan/retention age-out of F4 · Make "owe" and "clear" one idempotent pair, not two call sitesToday three places touch the obligation: the verb (owe), the park (clear, E2), and a no-park return (clear, E2). That is easy to leak: a call that throws between owe and either exit leaves the obligation set on a request that then dies elsewhere (a later, unrelated crash gets replayed). Prefer a shape where the caller cannot forget the clear, e.g. the verb takes the work as a callback ( F5 · Ordering across the two crash windowsThere are two windows, and the spec only draws one:
F6 · Scope in the engine testThe control ("a request that owes nothing is not continued") is good. Add the third control the issue implies: a request that owed, parked, and then died after resume is not continued by this branch (E2 says the park clears it). Without it, a mistake in E2 would silently turn every post-wait crash into an auto-replay. Architecture notes (opportunity only where this PR is already there)
DocsThe spec lists the durability page. Also update Not blocking merge on any of these. F1/F2 are wording fixes to the spec; F3/F4 are worth a decision note before build. Generated by Claude Code |
There was a problem hiding this comment.
/simplify review (spec-only PR)
Verdict: The chosen direction — engine RequestWaits “owe a park”, callers opt in before send/dispatch, step 2b continues interrupted + owes + no gate via existing continueRequest — is the right-sized fix. Rejected shapes (session wake, engine reading Workforce rows, gate-before-bind-target, continue-all-interrupted) would either duplicate recovery or guess replay safety. This is not an over-engineered architecture; it is a small obligation + one sweep branch on machinery you already have (FIX-811, FIX-1816/2b, FIX-2166, runOnce).
Where complexity shows up: mostly documentation surface, not the design. SPEC and DECISIONS repeat the same rejects, bring-forward timing, obligation lifecycle, and D1 in Sign off. Trimming ~30% by enforcing “SPEC = personas + goal + what changes + verify; DECISIONS = D1 table + considered/dropped” would make the spec easier to gate without changing direction.
Implementation PR (when this lands): keep the diff small with these reuse/simplify hooks (not blockers for this spec):
- One core helper for “owe →
runOncesend →waitOnRequest” sodispatcher.sendAndWaitand Workforcecall.tscannot drift on the owe call site. - Clear obligation in the engine on successful
parkOnWait(and on request end per E2); callers should not each clear. - FIX-2166-style bring-forward on durability, not only stale interrupt: today wake bring-forward is wired through
noteWakeOwed/ sweeperarm(); owed-park needs the same durability tick hook or recovery tail becomes stale threshold plus sweep interval. - Retention /
parkedInterruptedIds:interrupted+ owes park should behave like “will run again” (same family as parked-for-redrive), or history/retention may treat a recoverable turn as dead — worth one line in SPEC “What changes” or debt table. - E4 (max 3 continues): either add a verify bullet/control or soften to “bounded cap (implementer, logged)” like E5 storage — right now verification only pins owe vs not-owe.
- E2 “answers without parking clears”: the subtlest invariant; one explicit lifecycle sentence in SPEC would reduce mis-implementation.
Performance (operational, not a reason to reject): every blocking call/dispatch pays one durable owe write; mass crash can fan out many async continueRequest replays in one 2b tick (E4 caps per request, not cluster-wide). Acceptable trade for closing FIX-2070 leg c / FIX-2242; optional implementer note on concurrency limits if fleet-restart SLOs matter.
Skipped (would need owner call): whether host/DevTool row stays a first-class persona in the table; whether Sign off “If wrong: Workforce-only” is required by your spec template.
Approving direction for merge; inline notes are doc tightening and implementer guardrails.
Sent by Cursor Automation: Review For Best Approach
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiEuGX4bfXGJoNxGQ6f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiEuGX4bfXGJoNxGQ6f
|
Second-look pass folded in eb30af3:
The scan-placement and docs notes are recorded for the implementer. Generated by Claude Code |


Requested by Jake · project thread
interrupted. The reply is lostansweredwith the same call iddispatcher({ wait: true }), and the server dies between the dispatch and the parkinterruptedinterruptedGoal: a request that starts work it will wait on, and dies before it parks, is continued by the engine and gets the answer once.
How we'll know: an engine test (
dispatcher({ wait: true }), fault after the dispatch) and a Workforce test (a call withexit-after-row) each restart on the same store and sweep, and the request completes with the answer, sent once. Control: remove the "owe a park" call, and both requests stayinterrupted. A request that owes nothing is not continued.How: a new
RequestWaitsverb. A wait calls it before it starts its work. The durability sweep (step 2b) continues aninterruptedrequest that owes a park and has no gate, with the same continuation as the continue route.Sign off
D1 · The fix is in the engine: it offers "owe a park", and the wait callers use it
This decision came down to one row: it also closes the same gap in core's
dispatcher({ wait: true }), and it keeps Workforce concepts out of Layer 1. If wrong: the fix moves into Workforce, and the dispatcher gap stays open. See DECISIONS.md.The debt: one verb, one obligation per request, one sweep branch. Nothing is removed. A caller that owes a park says its request can be replayed safely up to the park. If wrong: a careless new caller replays effects that are not under
runOnce. The verb's doc tells callers this.Reviewers · look here: D1's layer split. Also E2: a call that answers without parking clears the obligation.
Spec · Decisions · FIX-2269 · epic FIX-2070 · blocks FIX-2242. Merging is the approval.
How to review this
This is a direction set, not an implementation and not a build plan. Is this the right approach? In scope: the goal, the approach, the numbered decision, the debt. Out of scope (the implementer owns it): the build plan, names, file paths, edge cases that don't change the approach, docs wording. Feedback below the line is recorded in
DECISIONS.md → Notes from reviewfor the implementer.Generated by Claude Code