Commit Graph

6 Commits

Author SHA1 Message Date
ben
75532f9f77 refactor(app): branded TransportDirectory type prevents Windows path mismatch (#1257)
The server compares session.directory with strict equality, but call sites
could silently pick the wrong path formatter (normalizeDirectoryQueryPath
vs toSessionTransportDirectory) — producing forward-slash paths on Windows
where the server stores native backslashes.

Changes:
- Add TransportDirectory branded type so the compiler rejects raw strings
  where a transport-formatted directory is expected.
- Fix connections/store.ts: switch path discovery from normalizeDirectoryQueryPath
  to toSessionTransportDirectory — this value feeds mcp.status/disconnect calls
  that use the same exact-match semantics (latent Windows bug).
- Fix workspace.ts: remote directory discovery now goes through
  toSessionTransportDirectory (caught by the branded type at compile time).
- Mark normalizeDirectoryQueryPath with JSDoc deprecation for server-query use.
- Add round-trip invariant and idempotency tests that assert create-path
  equals list-path for both Unix and Windows directory formats.
2026-03-31 11:14:00 -07:00
Benjamin Shafii
cf1de4d54c fix(session): normalize verbatim UNC scope comparisons 2026-03-24 07:32:55 -07:00
Benjamin Shafii
45a314c090 fix(session): strip verbatim Windows path prefixes 2026-03-24 07:15:01 -07:00
Benjamin Shafii
2204cae486 debug(session): trace Windows workspace scope drift 2026-03-24 07:12:41 -07:00
Benjamin Shafii
58b8780601 fix(session): normalize Windows directory transport
Use one slash-normalized directory format for local session create, delete, and sidebar client scope so Windows worker switches query the same session directory they were created under. Add a focused regression check for Windows-style transport parity.
2026-03-24 06:56:30 -07:00
Benjamin Shafii
7e4e8ec153 fix(session): keep workspace history scoped during local reconnects
Use the active workspace root instead of stale engine directories when reloading local sessions so workspace creation, switching, and restart flows do not hide another workspace's history. Add a regression check for stale session loads overwriting sidebar and route state.
2026-03-23 22:36:57 -07:00