Skip to content

bug: TUI sessions don't record cwd — Desktop groups them under default workspace #50438

Description

@Prontsevich

Bug: TUI sessions don't record cwd — Desktop groups them under default workspace

_launch_cwd_for_session() in run_agent.py only records cwd when source == "cli". TUI sessions (source == "tui") get cwd = NULL, so the Desktop GUI cannot group them by workspace — they all land in the default/"No workspace" group.

Steps to reproduce

  1. cd ~/Documents/pa && hermes --tui
  2. Start a new session
  3. Open Desktop GUI — the session appears under the default workspace, not under a "pa" workspace

Root cause

run_agent.py:80:

def _launch_cwd_for_session(source: str) -> Optional[str]:
    if source != "cli":  # <-- TUI excluded
        return None

All TUI sessions in state.db show cwd = /Users/lestroy (home) or NULL, regardless of the actual launch directory.

Suggested fix

if source not in ("cli", "tui"):
    return None

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/sessionsSession lifecycle, resume, persistence, historycomp/desktopElectron desktop app (apps/desktop/*)comp/tuiTerminal UI (ui-tui/ + tui_gateway/)sweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions