Skip to content

FIX-2242: the closure walk waits for FIX-2269's continued call - #4193

Merged
jhoffner merged 4 commits into
mainfrom
claude/project-thread-n6abql
Oct 29, 2026
Merged

jhoffner merged 4 commits into
mainfrom
claude/project-thread-n6abql

Conversation

@jhoffner

Copy link
Copy Markdown
Collaborator

Follow-up to #4129 (merged), the FIX-2070 closure walk.

The problem

With FIX-2269 (#4078) merged, a call that dies after its row is written but before it parks is continued by the durability sweep, about one stale threshold later. Scene ac's a:answer-in-request stopped following the request as soon as it read interrupted, so it failed on main even though the host goes on to continue and complete the request.

The change

follow takes the set of statuses that end it. For a:answer-in-request that set leaves out interrupted: the scene keeps polling, up to the same 360 s, until the request completes or fails. A request that stays interrupted still times out and fails, so a never-continued call is still a finding.

Verification

On df924362e (main with FIX-2269), GOAL_SCENES=ac, real models:

  • Before: a:answer-in-request FAIL, with the request read as in_progress > interrupted.
  • After: all four assertions PASS: c:lands-once, a:answer-in-request, a:one-place and a:no-relay. The request went in_progress > interrupted > in_progress > completed, and its call answered answered with the codename.

FIX-2279 is still open, so the passing verdict row for the whole walk will come once it lands. No changeset is needed, since this only touches a goal.


Generated by Claude Code

FIX-2269's durability sweep continues an interrupted call a stale threshold
later, so a:answer-in-request now follows the request until it completes or
times out instead of stopping at interrupted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiDWiB5JZRCvyAFUpe9
@jhoffner jhoffner self-assigned this Oct 29, 2026
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Oct 29, 2026 9:42pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 29, 2026 9:42pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 29, 2026 9:42pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

FIX-2242

FIX-2269

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T21:44:18.026949Z e5106ac New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jhoffner

Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown
Collaborator Author

Second look / architecture pass (one file, +7/−4, goals/shift-manager/workers-talk-together/scenes.mts)

Verdict: the approach is right; no better shape. Giving follow the set of statuses that end it, rather than a "keep polling through interrupted" flag or a retry wrapper, is the smallest change that matches what the host now does. A never-continued call still times out and fails, so the finding stays reachable. I see no refactor opportunity this PR should take on.

Optional notes for the implementer. None blocks merge.

  1. Leg e has the same exposure, unaddressed (scenes.mts:256). follow(alice, helperA.flowKind, requestId, PARKED_CALL_MS + 240_000) still defaults to ENDED, which includes interrupted. If Helper A's request is interrupted in that leg, it would be read as an end instead of being waited out, which is the same failure this PR fixes in scene ac. The PR body only verified GOAL_SCENES=ac. If leg e never sees a crash or restart, leave it. If it can, pass OWED_ENDS there too. Either way, say which in the PR.
  2. Default makes the exception easy to miss. ends = ENDED means every caller silently counts interrupted as an end, and only one opts out. Fine at two call sites. If a third appears, consider making the set a required argument so each call site states its choice. Not worth doing now.
  3. OWED_ENDS is derived by filtering ENDED (line 60). This is good, since a new terminal status added to ENDED flows through. The name says what it is used for rather than what it contains. Something like ENDED_BUT_INTERRUPTED would be more literal, but this is taste and I'd leave it.
  4. Failure message. The a:answer-in-request text says the request "never completed after the restart". It now also covers a request that stayed interrupted for the whole 360 s. The it read … suffix already shows the status trail, so this is accurate enough as is.
  5. Verification gap (already acknowledged in the PR). The passing verdict row waits on FIX-2279. Please keep that link visible until then, so this isn't read as closing the whole walk.

Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify review (FIX-2242)

Verdict: approve. This is a small, well-scoped harness fix: scene ac was stopping its poll on interrupted before FIX-2269's durability sweep could re-drive the request to completion. The diff does not widen scope or add layers elsewhere.

Approach

Parameterizing follow() with an optional ends set (default unchanged ENDED) is the right level of abstraction for this repo's goal scripts. Alternatives considered:

Alternative Tradeoff
stopOnInterrupted?: boolean on follow() Smaller API for today's single caller, but another special case if a second status gets the same treatment.
Inline new Set([...ENDED].filter(...)) at the call site Drops OWED_ENDS but repeats the rule and reads worse.
Special-case interrupted inside follow() behind a scene flag Couples the helper to FIX-2242/2269 semantics; worse than passing ends.
Duplicate poll loop only in sceneAC More duplication than this change.

Deriving OWED_ENDS from ENDED keeps one source of truth for terminal statuses — good DRY for a file that already maintains ENDED / TERMINAL.

Parallel review notes

  • Performance: No concerns. One module-level set; poll loop unchanged.
  • Reuse: legs-calls.mts defines a separate ENDED (without interrupted) for talkThrough. Unifying across goals would be a broader cleanup, not required here; localized change is fine.
  • sceneED (line 256) still uses default ENDED. That path expects park → resume → completion, not crash-before-park; I would not change it on this PR, but if FIX-2269 recovery ever applies there too, the same OWED_ENDS knob is available.

Optional nits (non-blocking)

See inline. None block merge.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a63f8cf542

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Snob — already tight on a63f8cf. No POC.

Read goals/shift-manager/workers-talk-together/scenes.mts (ENDED, OWED_ENDS, follow, the scene ac call, the scene ed call) and until in goals/shift-manager/workers-message-each-other/legs.mts.

A rewrite would not shrink this contract:

  • Scene ac keeps polling through interrupted and still records seen. The other follow still stops on interrupted. That is one optional end-set and one derived set.
  • A throughInterrupted flag is the same size, with a narrower knob.
  • Calling follow again after it returns interrupted stops on the same status.
  • until drops the status trail the assertion prints.
  • Inlining the filter, or a helper for one subtraction, is not shorter.

The two-line comment is why interrupted is left out. Cutting it does not change the wait.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

…ab inventory

The lab's README inventory went stale on main with FIX-2288 (#4183), which
reds Test (3/3); this is the same --write output any fix would carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiDWiB5JZRCvyAFUpe9

Copy link
Copy Markdown
Collaborator Author

Test (3/3) failed in @flow-state-dev/claude-code-style's inventory.test.ts. The cause is not this PR: the lab README's inventory table went stale on main with #4183 (FIX-2288), and the check fails on df924362e too. b08ccec regenerates the table with node scripts/inventory.mjs --write, which only changes the two counts. That push also carries Cursor's wording nit on the wait comment.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Test (2/3) fails in @flow-state-dev/workforce test/worker-calls.test.ts: both "a call whose process dies before it parks" tests hit Hook timed out in 10000ms at the afterEach dispose. This PR doesn't cause it. It reproduces 3 times out of 3 on df924362e (main) with this PR's goal-only diff, and the test came in with #4078. No fix exists yet, and the thread that owns FIX-2269 has been asked for one. I'll port it here when it lands.


Generated by Claude Code

…sh tests (FIX-2269)

Since per-worker token usage, a worker's request owes a request-end hook
from its start. The dead host's frozen request never pays it, and the
debt is kept per process, which both test hosts share, so the next
host's dispose waited out its 10 s drain and the afterEach hook timed
out. Dispose its router with a short drain first, as the orchestration
crash test does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEuGX4bfXGJoNxGQ6f

Copy link
Copy Markdown
Collaborator Author

I ported #4204's test fix by cherry-picking its one commit that touches worker-calls.test.ts. It bounds the next host's shutdown drain, which had been waiting on a request-end hook that #4013 left owed. Locally worker-calls.test.ts now passes 11 of 11. Once #4204 merges, this change is already on main and will have no effect here.


Generated by Claude Code

@jhoffner
jhoffner merged commit 747a434 into main Oct 29, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-n6abql branch October 29, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants