Skip to content

Right-click a session to move it into another project - #78854

Merged
OutThisLife merged 2 commits into
mainfrom
bb/session-move-project
Aug 4, 2026
Merged

OutThisLife merged 2 commits into
mainfrom
bb/session-move-project

Conversation

@OutThisLife

Copy link
Copy Markdown
Contributor

Summary

A chat created in the wrong directory was stuck there: session.cwd.set only reaches live runtime sessions, so a cold row's workspace — and the project the sidebar groups it under — couldn't be corrected. Session rows now carry a Move to project submenu (kebab and right-click, via the shared MenuKit) that re-homes the session at the target project's root.

  • New session.workspace.move RPC: targets the persisted row by session_key, validates the folder, and replaces the git branch/root identity — update_session_cwd grows a replace_git_meta flag, since the existing enrich-only rule would keep a stale git_repo_root and leave the session grouped under the project it just left. A live idle agent bound to the row is re-anchored through the runtime path; a mid-turn session refuses with "session busy". Registered in _LONG_HANDLERS (git subprocess probes).
  • Desktop: the submenu lists every project with a folder except the current owner, mirrors the returned cwd/branch/root into the $sessions cache, and refreshes the project tree so the row hops immediately. Folderless targets (the Home bucket) are excluded — there is nothing to move into.

Test plan

  • RPC probe against a real temp state.db: move rewrites cwd + git identity, a non-git target clears the stale root, busy live session → 4009, missing session → 4007, bad cwd → 4017
  • update_session_cwd: enrich semantics unchanged without the flag; replace_git_meta=True overwrites/clears
  • pytest tests/tui_gateway/test_projects_rpc.py + the session.cwd.set profile-db test
  • vitest on session-actions-menu / projects / session-row suites; tsc + eslint clean on touched files

…rkspace

A session created in the wrong directory needs its cwd corrected after the
fact. session.cwd.set only reaches live runtime sessions, so cold rows were
stuck. The new RPC targets the persisted row by session_key, validates the
folder, and REPLACES the git branch/root identity (update_session_cwd grows a
replace_git_meta flag) so the project tree's grouping follows the move instead
of pinning the session under the project it left via a stale git_repo_root.
A live idle agent bound to the row is re-anchored through the runtime path;
a mid-turn session refuses with 'session busy'. Runs on the RPC pool — the
git probes are subprocesses.
'Move to project' submenu in the session actions menu (kebab and right-click,
via the shared MenuKit) listing every project with a folder except the current
owner. Picking one calls session.workspace.move at the project root, mirrors
the new cwd/branch/root into the $sessions cache, and refreshes the tree so
the row hops immediately.
@OutThisLife
OutThisLife enabled auto-merge August 4, 2026 19:24
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on edae3ee

all good!

@OutThisLife
OutThisLife merged commit ec9572f into main Aug 4, 2026
45 checks passed
@OutThisLife
OutThisLife deleted the bb/session-move-project branch August 4, 2026 19:35
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 4, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ve-project

Right-click a session to move it into another project
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
…ve-project

Right-click a session to move it into another project
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…ve-project

Right-click a session to move it into another project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants