Keep oversized write_file generation recoverable - #795
Draft
Y1fe1Zh0u wants to merge 1 commit into
Draft
Conversation
Bound write_file payloads to 6000 characters and expose an explicit overwrite/append contract so models recover from truncated tool arguments with small sequential writes. Preserve the existing write_file-specific retry identity and optimistic workspace concurrency while appending. Constraint: Provider tool arguments can truncate before JSON parsing or tool execution Rejected: Retry the same oversized whole-file call | repeats the transport failure without progress Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep each append call independently bounded and preserve workspace version checks Tested: 128 focused backend tests; scoped Ruff; git diff --check Not-tested: Real Qwen 3.6 Plus provider run; full backend suite
Y1fe1Zh0u
force-pushed
the
fix/qwen-write-file-truncation
branch
from
July 27, 2026 10:04
ff235b5 to
6d3c7fc
Compare
This was referenced Jul 27, 2026
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.
What changed
Root cause
Large generated files can be truncated inside provider function.arguments before JSON parsing and before write_file executes. Retrying the same whole-file payload repeats the transport failure.
User impact
Long generated files can make bounded forward progress through small native tool calls instead of repeatedly ending in model_tool_protocol_violation. Oversized or invalid calls fail before mutating workspace data.
Validation
Known gaps
Related: #771 #793