Skip to content

fix(workspace): reuse persisted root after workspace creation#1273

Open
benjaminshafii wants to merge 1 commit intodevfrom
fix/windows-new-workspace-path
Open

fix(workspace): reuse persisted root after workspace creation#1273
benjaminshafii wants to merge 1 commit intodevfrom
fix/windows-new-workspace-path

Conversation

@benjaminshafii
Copy link
Copy Markdown
Member

Summary

  • reuse the persisted local workspace path after create/import instead of continuing to use the raw folder-picker path
  • add focused regression coverage for the Windows case where the picker/root string differs from the canonical persisted workspace path
  • keep starter-session materialization, workspace activation, and empty-session fallback aligned to the same local root

Why

On Windows, the folder picker can return a path string that does not exactly match the canonical local workspace path persisted by Tauri/OpenWork (for example C:/... vs C:\..., or raw picker output vs normalized persisted root).

The new-workspace flow kept using the raw picker path after creation for:

  • host activation
  • starter session materialization / polling
  • empty session fallback

Session filtering uses exact directory equality in OpenCode, so those follow-up steps could miss the sessions that were just materialized under the persisted workspace root. That explains the symptoms where a newly created workspace showed no prepopulated starter sessions and then behaved as if session creation was broken.

What changed

  • added resolveCreatedLocalWorkspacePath() in apps/app/src/app/lib/workspace-path.ts
  • updated apps/app/src/app/context/workspace.ts to pivot from the raw picker path to the persisted workspace path after create/import before continuing the workflow
  • added apps/app/scripts/workspace-path.ts and pnpm test:workspace-path

Verification

Ran from apps/app:

  • pnpm typecheck
  • pnpm test:workspace-path
  • pnpm test:session-scope

Notes

I did not run the full Docker + Chrome MCP flow for this PR because the reported bug is Windows-specific and this environment is macOS, so I could not reproduce the real OS boundary here. The focused regression test covers the mismatched-path case directly.

Windows folder pickers can return a raw path string that differs from the
canonical workspace path persisted by Tauri/OpenWork (for example C:/...
vs C:\...). The new-workspace flow kept using the raw picker path for
host activation and starter-session loading, so exact directory filters
missed the newly materialized sessions.

Use the persisted local workspace path after creation/import before
starting the host, waiting for starter sessions, or opening an empty
session, and add focused regression coverage for that path pivot.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment Apr 1, 2026 4:25am
openwork-den Ready Ready Preview, Comment Apr 1, 2026 4:25am
openwork-den-worker-proxy Ready Ready Preview, Comment Apr 1, 2026 4:25am
openwork-landing Ready Ready Preview, Comment, Open in v0 Apr 1, 2026 4:25am
openwork-share Ready Ready Preview, Comment Apr 1, 2026 4:25am

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

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

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