Skip to content

fix(app): bypass path normalization to fix sidebar session queries on…#1164

Open
shanliuling wants to merge 1 commit intodifferent-ai:devfrom
shanliuling:fix/860-windows-session-persistence
Open

fix(app): bypass path normalization to fix sidebar session queries on…#1164
shanliuling wants to merge 1 commit intodifferent-ai:devfrom
shanliuling:fix/860-windows-session-persistence

Conversation

@shanliuling
Copy link
Copy Markdown

Fixes: #860

What

Bypass aggressive path normalization for the directory query when fetching sidebar workspace sessions from the OpenCode server on Windows.

Why

Currently on Windows, the normalizeDirectoryQueryPath function converts raw Windows paths (e.g., D:\Projects\MyWork) into forward-slashed lowercase paths (e.g., d/projects/mywork). However, the OpenCode server's underlying SQLite database stores the raw paths. This mismatch causes the server-side directory filter to fail, resulting in an empty session history list in the sidebar on app restart.

How

  • Removed normalizeDirectoryQueryPath from the queryDirectory assignment in refreshSidebarWorkspaceSessions (located in app.tsx).
  • By passing the raw directory string directly to the server, the query correctly matches the stored SQLite payload.
  • Client-side filtering logic (filtered = root ? list.filter(...) : list) remains unchanged, safely using normalizeDirectoryPath on both sides to ensure exact matching after the data is received.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, Comment, Open in v0 Mar 31, 2026 2:16am

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

@shanliuling is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@lrq3000
Copy link
Copy Markdown

lrq3000 commented Mar 30, 2026

Please merge this PR, OpenWork is unusable on Windows without this fix (bug still happening on v0.11.196).

@shanliuling
Copy link
Copy Markdown
Author

shanliuling commented Mar 31, 2026

Please merge this PR, OpenWork is unusable on Windows without this fix (bug still happening on v0.11.196)

Thanks for the support!
If you are building from source and need this fix immediately, you can manually apply the changes:

  1. Open the file: apps/app/src/app/context/sidebar-sessions.ts
  2. Find line 142: const queryDirectory = normalizeDirectoryQueryPath(directory) || undefined;
  3. Change it to: const queryDirectory = directory || undefined;
    This will bypass the path normalization that causes the query mismatch on Windows. Hope this helps while we wait for the

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.

2 participants