mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-12 21:02:17 +02:00
The sessions layer tracked live advances in a map keyed by bare turnId with overwrite-on-set and unconditional delete-on-settle. A turn can legally have several live advances at once — a running invocation plus external-input invocations queued on the turn lock (e.g. a permission response while an async result is pending). The overwrite made stopTurn abort the wrong controller and await an outcome that couldn't settle; the unconditional delete untracked a sibling advance, so a later stopTurn missed the abort path, fell back to a cancel input, and could reject with TurnInputError if the turn had completed meanwhile — a user-visible stop failure. Durable state was never affected. Track a set of advances per turn: each advance removes only its own entry on settle, and stopTurn aborts every live controller and awaits all outcomes. A cancel input that loses the race with a concurrent settle now counts as a successful stop (the turn is already terminal) instead of rejecting. Adds four tests: concurrent invocations both aborted, an earlier settle not untracking a later advance, the settle-race cancel treated as success, and non-terminal rejections still surfacing. Updates session-design.md §9.3 and §13.5 accordingly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| core | ||
| shared | ||