Summary
The detailed applicator records each underlying error in ApplyPatchFailure.message, but the model-facing tool result discards those messages. It classifies every failure as requiring a reread and emits Recovery: MUST read ..., even for missing files, permissions, invalid paths, and other errors that rereading cannot fix.
Why this matters
The agent cannot see the actual reason carried in details.result.failures. In the outside-cwd regression from #21, for example, the real Patch path escapes workspace error appeared only as an instruction to reread a file that had already been read. The same misleading behavior remains for unrelated I/O errors even after #21 is fixed.
Expected behavior
The model-facing result should report:
- whether no files or only some files were applied;
- the paths that were applied;
- every failed path, operation, and underlying message.
Recovery advice should either be omitted or narrowly classified. A context mismatch may justify rereading; an ENOENT or permission error does not.
Suggested output
apply_patch partially failed.
Applied files: ok.txt
Failed:
- broken.txt (update): Failed to find expected lines in broken.txt ...
The structured failures and appliedFiles fields already contain the required information.
Summary
The detailed applicator records each underlying error in
ApplyPatchFailure.message, but the model-facing tool result discards those messages. It classifies every failure as requiring a reread and emitsRecovery: MUST read ..., even for missing files, permissions, invalid paths, and other errors that rereading cannot fix.Why this matters
The agent cannot see the actual reason carried in
details.result.failures. In the outside-cwd regression from #21, for example, the realPatch path escapes workspaceerror appeared only as an instruction to reread a file that had already been read. The same misleading behavior remains for unrelated I/O errors even after #21 is fixed.Expected behavior
The model-facing result should report:
Recovery advice should either be omitted or narrowly classified. A context mismatch may justify rereading; an
ENOENTor permission error does not.Suggested output
The structured
failuresandappliedFilesfields already contain the required information.