Skip to content

loop, glue, cmd/glue: next-speaker stall recovery (closes #343)#351

Merged
erain merged 1 commit into
mainfrom
issue/343-next-speaker
Jun 9, 2026
Merged

loop, glue, cmd/glue: next-speaker stall recovery (closes #343)#351
erain merged 1 commit into
mainfrom
issue/343-next-speaker

Conversation

@erain

@erain erain commented Jun 9, 2026

Copy link
Copy Markdown
Owner

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):

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

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]>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

glue-review

No concerns — LGTM.

Implemented auto‑continue feature with thorough tests and documentation updates. All existing and new tests pass.


🤖 Posted by glue-review.

@erain erain merged commit 7dfe7fe into main Jun 9, 2026
5 checks passed
@erain erain deleted the issue/343-next-speaker branch June 9, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

providers/gemini + loop: next-speaker check and stall recovery for Gemini

1 participant