GeezerVison is showing github.com — fix: normalize Windows desktop session paths by Blueteemo · Pull Request #26580 · anomalyco/opencode
Conversation
Blueteemo
commented
May 9, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #17765
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
On Windows Desktop, all session history disappears every time the client is closed and reopened. The sessions still exist in the SQLite database but the UI shows an empty list.
Root cause: Path normalization was inconsistent across different parts of the system:
project.worktree stored as "/" (Unix-style root)
session.directory stored as "C:\" (Windows path format)
lastProjectSession key stored as "/"
This path mismatch prevented the Desktop UI from matching/loading existing sessions after restart.
Solution: Added consistent path normalization in two places:
packages/app/src/utils/path-key.ts - Simplified pathKey() to properly handle Windows root paths (e.g., C:\ or /) -> normalize to /
packages/opencode/src/session/session.ts - Added normalizeDirectory() helper to normalize directory paths before storing sessions
How did you verify your code works?
- Manually edited the Desktop's
opencode.global.dat file to fix path mismatches (changing "/" to "C:\" for worktree and lastProject)
- Confirmed sessions reappeared in the sidebar after the path fix
- The fix ensures new sessions are created with normalized paths, preventing future mismatches
Screenshots / recordings
N/A - This is a backend fix, 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced May 17, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.