loop, glue, cmd/glue: next-speaker stall recovery (closes #343)#351
Merged
Conversation
Gemini's classic stall — "I will now update the file." with no tool call — now gets a bounded synthetic "Please continue." nudge: - loop: opt-in RunRequest.AutoContinue. A no-tool assistant turn whose closing sentence matches future-intent phrasing (and contains no question) triggers a synthetic user message marked glue/auto-continue in metadata, at most twice per run; EventAutoContinue is emitted with the stalled turn. Conservative by construction: only the final sentence is matched, questions to the user never trigger, and turns with tool calls are exempt. - glue: AgentOptions.AutoContinue plumbs through sessions. - cmd/glue: enabled automatically for the gemini provider when tools are registered (per-model gating arrives with the capability registry, #345). The roadmap's surrogate-sanitization item was verified unnecessary in #313: Go's encoding/json already sanitizes invalid UTF-8 on glue's path. Port of Gemini CLI nextSpeakerChecker fast paths per docs/coding-harness-roadmap.md P2.7. Co-Authored-By: Claude Fable 5 <[email protected]>
glue-reviewNo concerns — LGTM. Implemented auto‑continue feature with thorough tests and documentation updates. All existing and new tests pass. 🤖 Posted by glue-review. |
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.
Closes #343. Roadmap P2.7.
The classic Gemini stall — the model narrates "I will now run the tests." and stops without a tool call — is recovered with a deterministic next-speaker check (Gemini CLI's fast-path heuristics; we deliberately skip its auxiliary-LLM judge):
RunRequest.AutoContinue(opt-in): a no-tool assistant turn whose closing sentence matches future-intent phrasing and asks no question gets a synthetic"Please continue."user message — markedglue/auto-continuein metadata, bounded to 2 per run,EventAutoContinueemitted with the stalled turn. No tools registered → never triggers.AgentOptions.AutoContinueplumbs it through sessions;cmd/glueenables it for--provider geminiwith tools (per-model gating moves to the providers: per-model capability registry + tool-owned prompt snippets #345 capability registry).encoding/jsonsanitizes invalid UTF-8 already. Noted in CHANGELOG instead of dead code.Conservative-by-construction false-positive guards (tested): questions never trigger; intent earlier in the message but a concluding final sentence doesn't trigger; turns with tool calls are exempt; off by default.
Tests: intent table (9 cases), nudge round-trip (transcript shape, metadata, event), boundedness (gives up after 2), off-by-default, requires-tools. Full suite + vet green.
🤖 Generated with Claude Code