Skip to content

feat(core): expand tildes in tool path resolution - #45605

Merged
rekram1-node merged 2 commits into
v2from
expand-tildes
Aug 27, 2026
Merged

rekram1-node merged 2 commits into
v2from
expand-tildes

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

  • Expand a leading ~ / ~/ (and ~\ on Windows) in LocationMutation.resolve, so read, grep, glob, edit, write, patch, and shell cwd all treat home paths as home instead of $location/~/….
  • Share the same expansion for edit/patch lock keys so concurrent mutations of ~/file and the absolute home path serialize.
  • ~draft.md stays literal. Paths outside the Location still need external_directory approval.

Test plan

  • bun test test/location-mutation.test.ts from packages/core
  • bun test test/tool-edit.test.ts test/tool-patch.test.ts test/tool-read.test.ts test/tool-search.test.ts test/tool-write.test.ts from packages/core
  • bun typecheck from packages/core

Tilde prefixes end at the platform path separator: always ~ and ~/, and ~\ only when \ is a separator.
@rekram1-node
rekram1-node merged commit a609174 into v2 Aug 27, 2026
7 of 8 checks passed
@rekram1-node
rekram1-node deleted the expand-tildes branch August 27, 2026 18:41
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 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.

1 participant