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

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
architecture.md: 40d1641e494d2087e5fb5f9c50dbe1a2df30b103
architecture.zh.md: 324c4ff1950cbe3a3b8f015bb545dad3869dd5b4
architecture.md: 514a74534df4761c2677498b435d0f6cd22e5cd8
architecture.zh.md: c7e88e6f08d361e4cec15b51046145e88ceff5f6

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

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