Skip to content

fix(desktop): bind new-session profile to active gateway profile#45010

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/desktop-new-session-profile
Closed

fix(desktop): bind new-session profile to active gateway profile#45010
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/desktop-new-session-profile

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes new sessions being created in the launch profile (typically default) instead of the user's actively selected profile when using the Desktop sidebar "New Session" button or Ctrl/Cmd+N shortcut in app-global remote mode.

Related Issue

Fixes #45000

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • apps/desktop/src/app/chat/sidebar/index.tsx: Set $newChatProfile to $activeGatewayProfile.get() instead of null when creating a plain new session. Added $activeGatewayProfile to the import from @/store/profile.
  • apps/desktop/src/app/hooks/use-keybinds.ts: Same fix for the Ctrl/Cmd+N keyboard shortcut handler. Added $activeGatewayProfile to the import from @/store/profile.

How to Test

  1. Connect the Desktop to a remote backend that has at least 2 profiles (e.g., default and lab).
  2. Click the lab profile in the profile rail — the sidebar should show lab's sessions.
  3. Click the sidebar "New Session" button (or press Ctrl/Cmd+N).
  4. Send a message and verify the session appears under lab, not default.
  5. Check state.db in the lab profile's HERMES_HOME to confirm the session persisted there.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Code Intelligence

  • Analyzed: apps/desktop/src/store/profile.ts ($activeGatewayProfile atom, exported as atom<string>('default'))
  • Analyzed: tui_gateway/server.py (session.create handler, line ~3605: "None/own profile → launch")
  • Blast radius: LOW — only affects new-session creation in app-global remote mode
  • Related patterns: $newChatProfile atom stores the profile for the next new chat session; null was intended to mean "use current live profile" but the server interpreted it as the launch profile.

When the Desktop app creates a new session via the sidebar "New Session"
button or Ctrl/Cmd+N, it sets $newChatProfile to null. The server
interprets a missing/null profile as the launch profile (typically
"default"), which silently creates the session in the wrong profile
when the user has explicitly selected a different profile in the rail.

Fix: set $newChatProfile to $activeGatewayProfile.get() instead of
null, so the new session binds to whatever profile the user is
currently viewing.

Fixes NousResearch#45000
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: "New Session" button / Ctrl+N creates the chat in the launch profile instead of the active profile (app-global remote mode)

3 participants