Skip to content

fix: prevent prose-only and long-prefill agent stalls - #335

Open
Bostonvex wants to merge 2 commits into
lessweb:mainfrom
Bostonvex:codex/no-intent-narration
Open

fix: prevent prose-only and long-prefill agent stalls#335
Bostonvex wants to merge 2 commits into
lessweb:mainfrom
Bostonvex:codex/no-intent-narration

Conversation

@Bostonvex

@Bostonvex Bostonvex commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • reject recognized intent narration when a model emits no tool call
  • retry with a concise corrective system message without persisting the rejected assistant turn
  • expand the default action-intent vocabulary while preserving conversational phrases such as let me know and let me explain
  • enforce one tool call per model step and hard-stop after a configurable rejection threshold
  • give expensive local-model prefills five minutes to produce their first stream chunk
  • do not replay a first-chunk timeout, because resubmitting the same large prompt multiplies compute without improving recovery
  • retain the 60-second idle timeout and retry behavior after streaming has actually begun
  • expose default-on guard settings, phrase replacement/extension, an environment override, a persisted session counter, an event callback, and JSONL diagnostics
  • document the guard in English and Chinese

Behavior

Prose accompanied by a real tool call and tool-only turns continue unchanged. The default narration hard cap is four rejected turns in the last six model turns. Setting hardStopRejections to zero disables only that cap.

Streaming now distinguishes initial prefill latency from a stream that stops making progress. A first chunk may take up to five minutes and is attempted once. After the first chunk, a 60-second idle period remains retryable.

Tests

  • replay all supplied stalls plus the observed set-up, update, fetch, and add variants
  • cover prose plus tool, tool-only, conversational false positives, configured phrase overrides, normalization, logging, counters, retry behavior, and the 4-of-6 hard stop
  • cover first-chunk timeout behavior and post-first-chunk idle retry behavior
  • npm run check
  • npm run build
  • core, CLI, and VS Code workspace tests pass

@Bostonvex Bostonvex changed the title fix: prevent prose-only agent stalls fix: prevent prose-only and long-prefill agent stalls Sep 4, 2026
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.

1 participant