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: normalize Windows session directory filters by duyiliu · Pull Request #26463 · anomalyco/opencode

Conversation

@duyiliu

@duyiliu duyiliu commented May 9, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Issue for this PR

Fixes #23864

Type of change

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

What does this PR do?

On Windows, session rows can be stored with native backslashes while the web client requests the same directory with forward slashes. The session list endpoint currently does an exact directory match, so valid sessions can disappear from the web sidebar.

This adds a small helper for session directory filters. When the input looks like a Windows drive or UNC path, the query accepts both slash variants. Non-Windows-looking paths keep the previous exact-match behavior.

The change is applied to both current session listing implementations:

  • packages/opencode/src/session/session.ts
  • packages/opencode/src/v2/session.ts

This is server-side because direct API requests like /session?directory=C:/Users/... still miss rows stored as C:\Users\..., even if client-side cache keys are normalized.

How did you verify your code works?

Verified the failing behavior locally on Windows 11 with OpenCode 1.14.41:

GET /session?directory=C%3A%5CUsers%5Czhangqianfeng%5Cplayground&roots=true&limit=55
=> returns 9 sessions

GET /session?directory=C%3A%2FUsers%2Fzhangqianfeng%2Fplayground&roots=true&limit=55
=> returns 0 sessions before normalization

A temporary local proxy that only rewrites the directory query/header from C:/Users/... to C:\Users\... makes the web UI show the full session list again, confirming the server-side exact-match mismatch.

Screenshots / recordings

N/A. This is an API/session-listing fix; the bug is visible as missing sidebar rows rather than a visual rendering 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
duyiliu added 2 commits May 9, 2026 10:59
@duyiliu
fix: normalize windows session directory filters
524901c
@duyiliu
fix: normalize windows session directory filters
7d36add
@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 9, 2026
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found the following potentially related PRs:

Related PRs Found:

  1. fix: sessions missing from sidebar on Windows due to path separator mismatch #23862 - fix: sessions missing from sidebar on Windows due to path separator mismatch

    • fix: sessions missing from sidebar on Windows due to path separator mismatch #23862
    • Relation: This is explicitly mentioned in the current PR as complementary. It appears to handle client-side path normalization, while PR fix: normalize Windows session directory filters #26463 addresses server-side normalization.
  2. fix: normalize windows path separators in session queries #20215 - fix: normalize windows path separators in session queries

    • fix: normalize windows path separators in session queries #20215
    • Relation: Directly related to normalizing Windows path separators in session queries - similar scope to the current PR.
  3. fix: normalize windows path separators in session queries #20216 - fix: normalize windows path separators in session queries

    • fix: normalize windows path separators in session queries #20216
    • Relation: Another PR addressing the same Windows path separator normalization issue.
  4. fix/windows path normalization(#21441) #21852 - fix/windows path normalization(SortableWorkspace session list empty due to store.path.directory not bootstrapped #21441)

    • fix/windows path normalization(#21441) #21852
    • Relation: General Windows path normalization fix that may overlap with session directory handling.

These should be reviewed for potential duplication or to understand if they already solve the issue being addressed in PR #26463.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 9, 2026
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot mentioned this pull request May 9, 2026
fix: normalize Windows desktop session paths #26580
Closed
3 of 6 tasks
This was referenced May 17, 2026
fix(session): normalize session directory filters across path variants #28040
Closed
Fix/windows path separator session list #28165
Closed
fix: normalize forward slashes to backslashes for Windows directory matching #28240
Closed
fix: normalize forward slashes to backslashes for Windows directory matching #28251
Closed
Fix(opencode): windows path separator session list #28306
Closed
This was referenced May 28, 2026
fix(server): normalize Windows path separator and drive letter in Web API directory entry points #29756
Closed
fix(session): normalize Windows directory paths in session list #30367
Closed
@duyiliu

duyiliu commented Jun 4, 2026

Copy link
Copy Markdown
Author

Closing this PR because the current dev branch now handles the Windows session directory mismatch at the storage layer instead. Existing rows are normalized by the 20260601010001_normalize_storage_paths migration, and new session/project paths go through DatabasePath.directoryColumn(), which stores Windows paths with forward slashes and converts them back on read. That supersedes this query-level variant matching approach. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@duyiliu duyiliu closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Sessions missing from sidebar on Windows due to path separator mismatch

Uh oh!

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

1 participant

@duyiliu
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.