Repository navigation
fix(sandbox): require apply_patch update hunks - #4470
Conversation
seratch
left a comment
There was a problem hiding this comment.
The inconsistency has existed since the sandbox feature was introduced in v0.14.0: the executable grammar permits a move-only update, while the accompanying description requires one or more hunks, and both the parser and programmatic editor reject updates without a diff. Move-only updates have therefore never been a working SDK capability.
Supporting them now would introduce a new cross-provider filesystem contract covering metadata, symlinks, read-only grants, existing destinations, cross-filesystem behavior, and partial failures. The reported issue does not demonstrate a concrete user requirement that justifies this additional surface.
The narrower fix resolves the confirmed grammar/runtime mismatch at its owning boundary, preserves the established runtime behavior, and avoids introducing unsupported rename semantics.
Summary
The custom
apply_patchgrammar currently allows anUpdate Fileoperation without any diff lines, even though the runtime parser rejects that input. This pull request requires at least one change after the optionalMove todirective and aligns the model-facing EBNF description with the runtime contract.It also adds regression coverage that:
update_hunkproduction so the oldchange?rule cannot passTest plan
env NO_PROXY=localhost,127.0.0.1 no_proxy=localhost,127.0.0.1 UV_DEFAULT_INDEX=https://pypi.org/simple bash .agents/skills/code-change-verification/scripts/run.shIssue number
Closes #4468
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR