You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ui-server: a refused finish record leaves the turn open until restart and stops other turns #4448
Part of #4426 (follow-ups from #4278). Deferred from the review of PR #4447. The first point is also on main.
Context
In finish (packages/ui-server/src/brain/turn-journal.ts:1014-1049), the single finish-record write (:1036-1042) can be refused by capacity or a pinned WAL. Two things follow:
The rejection leaves held() with completed=false (:501-513). The scope observer then SIGKILLs every held turn's workers and stops those turns (packages/ui-server/src/brain/turn-scope.ts:289-298), although the shared final observation succeeded.
The turn is already out of active, so a retried finish returns at once, and ended_at stays NULL until restart recovery. Until then collectOne (:657) never collects the turn, and the worker scrub skips with journal_busy (packages/ui-server/src/brain/journal-scrub.ts:30).
The regression test a refused finish write removes the ended turn before the next note observation counts scrubObjects calls, so it passes while the scrub is skipped.
Scope
Finish-record refusal handling in turn-journal.ts, and its tests. No change to the scope observer's handling of a failed observation.
Acceptance criteria
A refused finish record after a successful final observation resumes other turns' held workers; a failed observation still stops them.
The ended turn's terminal record is retried without a restart (on next admission, a finish retry or idle maintenance), and ended_at is set once storage admits it.
After the retry, idle scrub returns a non-skipped result and the turn's objects are collectable.
The regression test asserts the scrub result, not the call count.
Mutation receipts for both the resume and the retry.
Activity