Skip to content

fix(core): authorize relative external paths - #37839

Closed
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/patch-relative-permission
Closed

fix(core): authorize relative external paths#37839
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/patch-relative-permission

Conversation

@H-TTTTT

Copy link
Copy Markdown

Issue for this PR

Fixes#37687

Type of change

  • Bug fix

What does this PR do?

A relative mutation path that lexically escapes the active Location (e.g. ../sibling/file) was rejected before permission evaluation, so a valid apply_patch/edit against an approved external sibling target failed with an empty durable error instead of routing through external_directory authorization.

Relative paths now resolve from the active Location, and any external target flows through the existing external_directory -> leaf approval path. The unused relative_escape reason is removed.

Ports the V2 fix (#37689) to dev.

How did you verify your code works?

  • bun test test/location-mutation.test.ts — 10 passed (the relative-escape case now asserts external_directory authorization).
  • bun run typecheck in packages/core.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Relative paths that lexically escape the active Location (e.g.
`../sibling/file`) were rejected before permission evaluation, so a
valid patch against an approved external sibling target failed with an
empty error and never reached `external_directory` authorization.
Resolve relative mutation paths from the active Location and route any
external target through the existing `external_directory` -> leaf
approval flow, matching V1 behavior. Drop the now-unused
`relative_escape` reason.
Fixesanomalyco#37687
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

patch: relative external target skips permission and returns blank error

1 participant

@H-TTTTT