Repository navigation
fix: reject malformed write payloads before changing files - #2028
Merged
Merged
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
Malformed
writecalls could create empty files or truncate existing files because missing/null payloads decoded as empty strings. Validate the required payload before filesystem work across compact workers (text), chat writes (content), and appends. Explicit empty strings remain valid.write(path, payload) + require payload to be a string create parent directories write bytesEvidence
After: regressions reject missing/null/non-string payloads before mutation, preserve existing files, and avoid creating parent directories. Valid content and intentional empty writes pass.
make buildandmake pr-readypassed, including fresh tests for the changed execution and session packages. Independent standards and requirements reviews found no blocking issues.27615d9fb8a4: 3/3 passed, using OpenRouterdeepseek/deepseek-v4.1-flashfor every model call: compactexec, normalchat --once, and chat append. The test deliberately renamed the first write's required field to reproduce the malformed argument. Each path returned an actionable tool error with no filesystem mutation; the real model then corrected its arguments and completed the valid write. This is controlled fault injection with a live model, not a claim that the model spontaneously generated the malformed call.Merge Danger
Door: two-way
Blast Radius: write
Valid tool schemas and successful-write outputs are unchanged. Malformed calls now return an error for the model to correct.