GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): expand ~\ in session move destinations on Windows by shaojunying · Pull Request #66269 · anomalyco/opencode

Conversation

@shaojunying

@shaojunying shaojunying commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #66268

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

SessionMove.resolveDestination expanded ~ and ~/ itself but not ~\, so on Windows a move to ~\repo resolved under the session's current directory and failed with "destination not found".

It now resolves the destination with FileAccess.resolvePath, the helper tools already use for paths a user or model writes. That expands ~, ~/ and, on win32, ~\ against the given home, and normalizes Windows shell paths the same way the file tools do. The Global home is still passed in, so the result does not change on other platforms.

How did you verify your code works?

Added Session.move home expansion to test/session-move.test.ts. It moves a session to ~/dest and, on Windows, to ~\dest, with an isolated home. On Windows the ~\dest case fails before the change (DestinationNotFoundError for ...\source\~\dest) and passes after it. test/session-move.test.ts passes (18 tests). The other tests that use SessionMove (tool-model-policy, tool-opencode, tool-registry) show the same failures with and without the change on my Windows machine, all from Code Mode and local environment setup.

Screenshots / recordings

Not a UI change.

Checklist

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shaojunying
fix(core): expand ~\ in session move destinations on Windows
6b21568
SessionMove expanded `~` and `~/` but not `~\`, so on Windows a move to
`~\repo` resolved under the session's own directory and failed with
"destination not found". Resolve the destination with
FileAccess.resolvePath, which tools already use for the same input.
@shaojunying shaojunying mentioned this pull request Nov 25, 2026
session move: ~\ destinations are not expanded on Windows #66268
Closed
opencodejr[bot]
opencodejr Bot reviewed Nov 25, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks correct. I couldn't verify it at runtime because the bug only happens on Windows and I could only run Linux here. Using FileAccess.resolvePath with the injected global.home matches how tool paths are resolved: ~\… now expands on win32, the only other change on Windows is that /c/…, /cygdrive/c/… and /mnt/c/… become drive paths (as in the file tools), and Linux and macOS behave as before. test/session-move.test.ts passes (17 pass, 1 skip) and tsc -b passes for packages/core. The branch also merges cleanly with the latest dev.

Public API: unchanged.

No blocking concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@neriousy
neriousy merged commit 7b8a065 into anomalyco:dev Nov 25, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@amrkmn amrkmn mentioned this pull request Nov 26, 2026
opencode 2.4.2 amrkmn/homebrew-tap#1260
Closed
1 task
This was referenced Nov 26, 2026
feat: opencode release v2.4.2 sprisa/opencode-server#97
Merged
Tool release: OpenCode 2 v2.4.2 (was v2.3.2) agent-sh/agnix#1894
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

session move: ~\ destinations are not expanded on Windows

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@shaojunying @neriousy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.