Describe the bug
When using Hermes Desktop Windows connected to a remote Ubuntu gateway, new sessions (Cmd+N or global "New Session" when not scoped into a project) land in the wrong project's workspace directory.
Example: A configuration discussion thread lands in the TradingView project because the session's CWD resolves to the tradingview directory instead of being detached or using the configured default.
In local mode (gateway on Windows), this does not happen — sessions are correctly detached when no explicit default is set.
Root Cause
workspaceCwdForNewSession() in apps/desktop/src/store/session.ts:341-353 special-cases remote mode:
export const workspaceCwdForNewSession = (): string => {
if ($connection.get()?.mode === "remote") {
return getRememberedWorkspaceCwd() // ← stale localStorage value
}
return getConfiguredDefaultProjectDir()
}
In remote mode, the function completely ignores the configured default project directory and uses only the remembered workspace CWD from localStorage. This CWD can be from a completely different project (e.g., tradingview).
Flow
- User presses Cmd+N or clicks global "New Session" without being scoped into a project
resolveNewSessionCwd() → $projectScope === ALL_PROJECTS → falls through
workspaceCwdForNewSession() → remote mode → returns stale getRememberedWorkspaceCwd()
session.create is called with this wrong CWD
- Server maps the CWD to a different project via
project_tree.py
Expected behavior
workspaceCwdForNewSession() should behave identically in local and remote mode — new sessions should be detached when no explicit default project directory is configured, matching the local mode behavior.
Proposed Fix
Remove the remote-mode special case. The getRememberedWorkspaceCwd() is already scoped by connection (baseUrl + profile via workspaceCwdKey), so it remains safely available for resume/restore flows (ensureDefaultWorkspaceCwd). A bare new chat should always be detached when no explicit default is set:
export const workspaceCwdForNewSession = (): string => {
return getConfiguredDefaultProjectDir()
}
Environment
- Hermes version: v0.18.0 (2026.7.1)
- Desktop: Windows 11 (Tauri)
- Gateway: Ubuntu 24.04 (remote via Tailscale)
- Connection mode: remote
Describe the bug
When using Hermes Desktop Windows connected to a remote Ubuntu gateway, new sessions (Cmd+N or global "New Session" when not scoped into a project) land in the wrong project's workspace directory.
Example: A configuration discussion thread lands in the TradingView project because the session's CWD resolves to the tradingview directory instead of being detached or using the configured default.
In local mode (gateway on Windows), this does not happen — sessions are correctly detached when no explicit default is set.
Root Cause
workspaceCwdForNewSession()inapps/desktop/src/store/session.ts:341-353special-cases remote mode:In remote mode, the function completely ignores the configured default project directory and uses only the remembered workspace CWD from localStorage. This CWD can be from a completely different project (e.g., tradingview).
Flow
resolveNewSessionCwd()→$projectScope === ALL_PROJECTS→ falls throughworkspaceCwdForNewSession()→ remote mode → returns stalegetRememberedWorkspaceCwd()session.createis called with this wrong CWDproject_tree.pyExpected behavior
workspaceCwdForNewSession()should behave identically in local and remote mode — new sessions should be detached when no explicit default project directory is configured, matching the local mode behavior.Proposed Fix
Remove the remote-mode special case. The
getRememberedWorkspaceCwd()is already scoped by connection (baseUrl + profile viaworkspaceCwdKey), so it remains safely available for resume/restore flows (ensureDefaultWorkspaceCwd). A bare new chat should always be detached when no explicit default is set:Environment