fix(agent-loop): let a concluding tool result beat same-step steering

concludesTurn is terminal: a completed step now carries the concluded fact
to the driver, which ends the turn immediately instead of letting steering
that arrived during the tool batch (or from an agent/stopping listener)
reopen it. The steering is not lost — it drained into the log as
steering/message before the decision point, so it feeds the next turn's
request. Also annotates the driver's unreachable invariant guards
(exhaustiveness default, abort-slot ownership) for the coverage gate.
This commit is contained in:
_Kerman
2026-07-26 11:47:25 +08:00
parent 7b875b9f62
commit 2154034a0b
5 changed files with 60 additions and 3 deletions

View File

@@ -100,6 +100,7 @@ forever:
each model-order result -> ordered tools/post-execute -> 'tool/result'
drain accepted tool context and steering
'step/end'
a concluding tool result ends the turn; drained steering waits for the next turn
continue when tools or steering require another step
otherwise agent/stopping -> drain once more -> continue only for steering
'turn/end' -> agent/idle