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
A Goal completion request overtaken by a queued turn start is never evaluated #1998
When a queued user input starts the next turn at a report turn's end before Goal's turn-end decision for that end runs, the completion request is never evaluated. No evaluator is created, the goal keeps writing continuations, and it later pauses with no_progress.
Reproduction
Deterministic, in the product profile: a fake model calls goal_update inside a real Loop and ToolExecutor turn, and a test hook holds Goal's turn-end decision before it reads the fold.
Set a goal with judge="evaluator".
Submit tool:goal_update {"status":"completed"} as a queued input.
While the report turn runs, submit another queued input.
Hold the report turn's turn-end decision before it reads the fold, and let the queued input's turn/start be folded first.
Release the decision.
Observed sequence on the working branch:
44 turn/end (report turn)
45 goal op=completed (the request)
54 turn/end (the held decision)
56 turn/start (the queued input)
65 turn/end
66 continuation count=1
76 continuation count=2
86 continuation count=3
96 state paused reason=no_progress
No branch/create is written.
Code
decide_evaluation (crates/dim-goal/src/fold.rs) requires !turn_open(). The request is only read by request_in_turn, whose window is the turn that ends at the decision's sequence, and retain_requests drops a request that is no longer in the current turn. Once the next turn/start is folded, the later decision for the earlier turn end cannot see the request any more.
Design
docs/design/plugins/Pursuit.md §4.1 creates the evaluator at turn/end N when the turn contains a completed block, §5 says N is the request's turn end, and the working-branch section says that while the evaluator works the working branch behaves as any active goal. None of these describe a request that is skipped: the request is simply not evaluated.
Scope
Found while fixing the stale-continuation failure in #1989. PR #1970 does not change this race.
Activity
fix(goal): claim an evaluation after committed dispatch catches up
fix(goal): claim a turn end's outcome at the latest committed cutoff
docs(goal): state the closing pause's bounded catch-up
docs(goal): defer the evaluation while driving input is pending
fix(goal): keep a completion request until driving input drains
docs(goal): defer the evaluation while driving input is pending
fix(goal): keep a completion request until driving input drains
fix(goal): claim an evaluation after committed dispatch catches up
fix(goal): claim a turn end's outcome at the latest committed cutoff
docs(goal): state the closing pause's bounded catch-up