Repository navigation
fix(local): keep a continued reply's space, retire a stale retry note on Stop, fix the out-of-memory notice - #410
Merged
Merged
Conversation
…red retry note on Stop, and drop 'try again' from the GPU out-of-memory notice Three defects the final regression run found in the stream retry of #403/#405/#407, each reproduced independently first. - A completion that continues a cut-off reply (a retry after a partial reply, or a continuation past the output limit) no longer loses its leading whitespace in the local providers' stream recovery, so 'brown fox' + ' jumps' no longer reads 'foxjumps'. The agent marks the provider call (CONTINUES_A_REPLY) from the shape of the history: the model's own text followed by an agent-only user row. That shape also matches a few fresh replies after another agent-only note (self-critique or done-gate feedback, a supervision prompt); those keep a leading space too, which is harmless. Whitespace alone is still no reply (R14). - A Stop, or a failed stream, while a provider retry waits hides that retry's note from the model in place (a compare-and-set of its metadata; nothing is deleted), so the person's next message is not sent behind a 'continue the reply' order the retry never acted on. The daemon runner and Crew do it in settle_interrupted_turn and record_turn_stopped; the CLI and ACP call Agent::retire_unanswered_retry_note once the turn's token is cancelled, because there a Stop usually ends the stream on its own rather than through the cancel arm. A note the retry answered stays, as does a note followed by an agent-visible row such as a steer. - Llama Server's GPU out-of-memory notice, shown right before 'Trying again (1/1)', no longer asks the person to try again or says the server was restarted, matching the compute-failure notice.
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.
Summary
Three defects the final regression run found on main after #403-#407, in the local providers' stream retry. Each was reproduced independently before it was fixed.
recover_leaked_tool_calls(providers/formats/text_tool_calls.rs) trimmed the leading whitespace of the first text of every completion, continuations included.CONTINUES_A_REPLY), and recovery keeps that call's leading whitespace. The mark is read from the shape of the history: the model's text followed by an agent-only user row. That shape also matches a few fresh replies after another agent-only note (self-critique or done-gate feedback, a supervision prompt). Those keep a leading space too, which is harmless. Whitespace alone is still no reply.settle_interrupted_turnandrecord_turn_stopped;Agent::retire_unanswered_retry_noteonce the turn's token is cancelled.Test plan
New tests:
text_tool_calls.rs(a continuation keeps its joining whitespace),llamacpp_sidecar.rs(an_out_of_memory_failure_does_not_ask_the_person_to_try_again), and five retire tests intests/output_recovery_agent_loop.rs(Stop, failed stream, the reply loop's own stop, a client that settles no turn, a client that drops the stream). Every new test fails with its fix undone, checked by mutation.Ran:
cargo fmt --check,./scripts/clippy-lint.sh,cargo test -p biorouter --lib -- providers:: agents::,--test output_recovery_agent_loop, and the steer and stack binaries (soft_interrupt_agent_loop,turn_abort_tests,subagent_delegation,steer_always_lands).Live against a mock llama-server, on the desktop's HTTP path, the CLI and ACP: each reproduction fails with the pre-fix binary and passes with this build.
Known and not changed here:
Both are narrower than the reported Stop path.
🤖 Generated with Claude Code