Skip to content

Fix apply_patch path handling and final diff preview#22

Open
bstncartwright wants to merge 2 commits into
code-yeongyu:mainfrom
bstncartwright:fix-outside-cwd-patch-paths
Open

Fix apply_patch path handling and final diff preview#22
bstncartwright wants to merge 2 commits into
code-yeongyu:mainfrom
bstncartwright:fix-outside-cwd-patch-paths

Conversation

@bstncartwright

@bstncartwright bstncartwright commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • resolve patch paths with path.resolve(cwd, filePath) instead of enforcing cwd containment
  • allow absolute paths, parent traversal paths, and symlinked paths outside cwd
  • retain the computed diff preview on final tool results so completed patches render with changed-line previews
  • update tests for outside-cwd path handling and final preview rendering

Closes #21.
Closes #23.

Validation

  • npm test
  • npm run check
  • git diff --check

@bstncartwright bstncartwright changed the title Allow apply_patch paths outside cwd Fix apply_patch path handling and final diff preview Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Final apply_patch result should keep diff preview after completion apply_patch cannot edit files outside cwd despite documented path support

1 participant