Skip to content

POC: one wait-for-abort helper in the stop-hook tests - #2542

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
poc/FIX-1690-stop-one-wait
Closed

cursor[bot] wants to merge 2 commits into
mainfrom
poc/FIX-1690-stop-one-wait

Conversation

@cursor

@cursor cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This PR does not merge

Draft POC off the head of #2538. Fold the subtraction into that PR, then close this unmerged.

What I subtracted

makeStoppableFlow copied makeBlockingFlow's wait-for-abort promise: check an already-aborted signal, then race a timer against abort. That body now lives once, as completedNaturallyUnlessAborted, and both factories call it. Also dropped the banner comment that restated the describe, and the Awaited<ReturnType<SessionScopeHandle["stopRequest"]>> alias in favor of StopRequestOutcome.

Production code is untouched. recordRequestStop, requestInSessionScope, and ctx.session.stopRequest stay as they are.

Calling defineFlow twice and reusing actions.run registers the kind twice, so that lost. A stop: true flag on makeBlockingFlow is a one-caller option.

What still passes

packages/engine/test/abort.test.ts:

  • ctx.session.stopRequest — 6/6
  • runAction — cross-process abort delivery (the suite that uses makeBlockingFlow) — passed in the same run (19 passed, 85 skipped on the combined filter)

Net on abort.test.ts: 28 insertions, 54 deletions.

Open in Web View Automation 

claude and others added 2 commits October 1, 2026 00:47
…n (FIX-1690)

ctx.session.stopRequest(id) records the abort route's own fenced write
(recordRequestStop, now shared by both callers) on a request the session's
own reads would show, and answers stopped / already-finished /
not-in-this-session. Requests and sessions only: no Workforce word.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cnm5DbhFmkarpesBpPQ9Dq
makeStoppableFlow copied makeBlockingFlow's signal wait. One helper
covers both, and the six stopRequest cases are unchanged.

Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
@vercel

vercel Bot commented Oct 1, 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 1, 2026 12:56am UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 1, 2026 12:56am UTC
flow-state-dev-ui Ignored Ignored Oct 1, 2026 12:56am UTC

Request Review

@linear-code

linear-code Bot commented Oct 1, 2026

Copy link
Copy Markdown

FIX-1690

jhoffner commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

The test-helper subtraction was folded into #2538, which has merged, so I'm closing this POC without merging it.


Generated by Claude Code

@jhoffner jhoffner closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants