Repository navigation
fix(runtime): keep tools declared on the slice checkpoint and reject a call there (RR1) - #108
Merged
Merged
Conversation
…a call there instead of failing the run The 256-call slice checkpoint removed the tool schemas from its request and treated any tool call the model streamed anyway as a ProviderProtocol failure. Over OpenAI-compatible routes Anthropic models keep emitting tool_use when the transcript is dense with tool calls, so the checkpoint itself ended runs of 6 to 80 minutes (5 runs, plus two sub-agents, in the 2026-09-21 audit) with the work complete and durable but the run marked failed. Tools now stay declared on the checkpoint turn; the notice in the system prompt asks the model not to use them. A call streamed there is admitted through the same PendingToolCall.rejection path as calls past the per-turn cap, never executes, does not count toward the slice, and settles as one not-executed result the continuation turn sees, so the model re-issues it with tools available again. The slice resets whether or not the model obeyed the notice: the persisted turn is the boundary. The "declared no tools" protocol failure remains for budget-final turns, which still send no schemas. Regression: a_tool_call_on_the_checkpoint_turn_settles_as_a_rejection_and_the_run_continues (255 executed reads, one rejected call at the checkpoint, continuation carries its result, run completes). Fixtures that identified the checkpoint request by an empty tool list now key on the notice. The measured-token chain test now expects the seam to vary only by the notice bytes rather than the whole schema. RR1 of docs/plans/run-reliability.md.
…tools stay declared
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #107 (plan). RR1 of
docs/plans/run-reliability.md; audit finding R03.Behaviour
The 256-call slice checkpoint used to remove the tool schemas from its request and treat any tool call the model streamed anyway as a
ProviderProtocolrun failure. Over OpenAI-compatible routes Anthropic models keep emittingtool_usewhen the transcript is dense with tool calls, so the checkpoint itself ended runs of 6–80 minutes (5 runs plus two sub-agents in the audit) with the work complete and durable but the run marked failed.Now:
PendingToolCall.rejectionpath (same as calls past the 16-per-turn cap), never executes, does not count toward the slice, and settles as one not-executed result (SLICE_CHECKPOINT_REJECTION) that the continuation turn sees, so the model re-issues it.Design
Principle 2 of the plan: bounds are enforced by what QQ sends next, never by declaring the model's reply illegal.
tool_choice: nonewas not added — no adapter carries a tool-choice field today and the rejection result is sufficient for correctness. Once RR12's loop result lands, the checkpoint itself is a candidate for deletion (in-run compaction from #92 is already the durable boundary).Verification
a_tool_call_on_the_checkpoint_turn_settles_as_a_rejection_and_the_run_continues: 255 executed reads, one rejected call at the checkpoint, continuation request carries its result andSLICE_CONTINUATION_NOTICE, run completes with noFailedevent.RenewableSliceProvider,MeasuredCheckpoint,CompletesAfterCheckpoint,EmptyCheckpoint) now key on the notice and assert the schemas are present.cargo test -p qq-core --lib: 686 passed.cargo fmt --check,cargo clippy -p qq-core --all-targets --all-features -D warningsclean.Impact
Checkpoint requests now carry the tool schema bytes (previously credited back for one turn); no other hot-path change. No protocol or schema change.