fix(coding-agent): reopen oversized sessions and wrap tool output - #1388
Open
leeseunguk wants to merge 2 commits into
Open
fix(coding-agent): reopen oversized sessions and wrap tool output#1388leeseunguk wants to merge 2 commits into
leeseunguk wants to merge 2 commits into
Conversation
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
bash_outputresults using the existing ANSI-aware wrapper instead of returning over-wide physical lines.Reproduction and scope
An isolated source CLI session with a 100,000-token model and 112,006 tokens of saved history exits before the TUI with
ModelUsabilityBudgetError: required 148,861 tokens, even with speculation lead already zero. This follows #1341; omitting speculation lead alone cannot recover this case.Unlike the model-recovery approach in #1263, this change keeps the saved model and opens the session for recovery without selecting another provider. Switching to a different target still validates the restored history.
The output-width issue is separate: the tool component can emit 102/180-column lines inside a 98-column box. The TUI's normal-mode width dump is not proof of a process crash, so this PR does not attribute the startup exception to that diagnostic.
Validation
main, then reran the same isolated source CLI fixture in a real 98-column PTY: saved history rendered, the editor echoed unsubmitted input, and normal shutdown exited 0.npm run buildpassed on the final runtime changes.The broader mock-loop self-test has an unrelated baseline failure: textual-tool-leak recovery cases fail on the unchanged checkout (13/22 overall), while the normal local mock-provider round trip passes. This PR does not modify that behavior.
Independent local gate review approved both commits with high confidence.
Summary by cubic
Resuming a session with its saved model no longer fails on oversized restored history, so the TUI opens and the user can compact or switch models from the UI. Completed and expanded
bash_outputresults now wrap with the ANSI-aware wrapper instead of emitting over-wide lines.Bug Fixes
Written for commit 48e9171. Summary will update on new commits.