fix: disclose apply_patch failure reasons and classify recovery advice - #34
Merged
Conversation
Surface the underlying failure message (failures[].message) for each failed path in the model-facing tool result, and classify recovery advice so ENOENT, EACCES, and path errors do not emit 'Recovery: MUST read' — only genuine context-mismatch failures do. Adds code?: string to ApplyPatchFailure and failedFiles to ApplyPatchRecoveryInstructions. Closes #31
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
Issue #31:
apply_patchhid failure reasons behind generic reread instructions. The underlyingfailures[].messagewas recorded but never surfaced to the model, and every failure classified as requiring a reread — including ENOENT, EACCES, and path errors that rereading cannot fix.Changes
Failed:\n- path (op): message).code?: string | undefinedtoApplyPatchFailure; capture the Node fs error code in both catch sites.Recovery: MUST read; ENOENT/EACCES/path errors omit reread advice.failedFiles: string[]toApplyPatchRecoveryInstructions.Closes
Closes #31.
Verification
npm run check(tsgo + biome): cleannpm test(61 tests): all pass