Skip to content

refactor: simplify turn preemption by waiting on backend completion - #34

Merged
william0wang merged 2 commits into
mainfrom
fix/cancel-subscribe-bug
Jul 30, 2026
Merged

refactor: simplify turn preemption by waiting on backend completion#34
william0wang merged 2 commits into
mainfrom
fix/cancel-subscribe-bug

Conversation

@william0wang

Copy link
Copy Markdown
Owner
  • Remove waitForTurnIdle probing (session/goal) from prompt and
    preempt paths
  • Turn loop now sends stop once, then polls until backend emits
    turn.completed/turn.failed
  • pendingTurns cleanup becomes the reliable "backend done" signal for
    preempt wait
  • Reduce subscribe retry attempts (3→2), backoff (1s/2s→0.5s/1s),
    timeout (10s→5s)
  • Add stopSent flag to PendingTurn to prevent duplicate stop calls

events

- Remove `waitForTurnIdle` probing (session/goal) from prompt and
  preempt paths
- Turn loop now sends stop once, then polls until backend emits
  turn.completed/turn.failed
- `pendingTurns` cleanup becomes the reliable "backend done" signal for
  preempt wait
- Reduce subscribe retry attempts (3→2), backoff (1s/2s→0.5s/1s),
  timeout (10s→5s)
- Add `stopSent` flag to `PendingTurn` to prevent duplicate stop calls
@william0wang
william0wang merged commit 3ab3589 into main Jul 30, 2026
1 check passed
@william0wang
william0wang deleted the fix/cancel-subscribe-bug branch July 30, 2026 13:10
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.

1 participant