Skip to content

fix(repl): recover from empty replies and read-budget stalls - #53

Merged
fuseraft merged 6 commits into
mainfrom
gpt-5.4
Aug 1, 2026
Merged

fix(repl): recover from empty replies and read-budget stalls#53
fuseraft merged 6 commits into
mainfrom
gpt-5.4

Conversation

@fuseraft

@fuseraft fuseraft commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Improve REPL robustness by handling empty model responses and reducing read-budget dead ends.

  • reject or recover from empty assistant replies in the REPL turn flow
  • make file reads more resilient when the first read would exceed the per-turn budget
  • add regression coverage for the read-budget behavior

Stauffer, Scott added 6 commits August 1, 2026 07:07
- Limit previews to first 3 evicted results (160 chars each, down from 300)
- Cap evicted labels shown in manifest to 5 entries
- Replace full active tool list with a count to save tokens
- Evict only oldest results needed to fit budget (not all unprotected results)

Measured impact: ~75% token reduction in manifest overhead when many tool results are evicted. The count-based format scales better for agents that read dozens of files.
- Detect and strip internal tool-call syntax that leaks when models hallucinate
- Extract JSON arrays from responses wrapped in markdown or prose
- Improve error messages to guide agents toward correct JSON format
- Prevents user-facing display of internal implementation details
- First read in a turn now truncates to budget instead of failing
- Subsequent reads still error when budget is exhausted
- Prevents agents from being blocked when the first file is simply too large
- clear ITurnResettable plugins at the start of each REPL turn so per-turn state does not leak across prompts
- register the file system, shell, and todo plugins with the session context for centralized turn resets
- prevent empty assistant output from ending a turn without a user-facing answer
- degrade oversized file reads into compact slices so work can continue in the same turn
- keep regression coverage aligned with the non-error follow-up read behavior
@fuseraft
fuseraft merged commit d269773 into main Aug 1, 2026
3 checks passed
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