Right-click a session to move it into another project - #78854
Merged
Merged
Conversation
…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
enabled auto-merge
August 4, 2026 19:24
Contributor
૮ >ﻌ< ა ci reviewran on edae3ee all good! |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A chat created in the wrong directory was stuck there:
session.cwd.setonly 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.session.workspace.moveRPC: targets the persisted row bysession_key, validates the folder, and replaces the git branch/root identity —update_session_cwdgrows areplace_git_metaflag, since the existing enrich-only rule would keep a stalegit_repo_rootand 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).$sessionscache, 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
update_session_cwd: enrich semantics unchanged without the flag;replace_git_meta=Trueoverwrites/clearspytest tests/tui_gateway/test_projects_rpc.py+ thesession.cwd.setprofile-db testviteston session-actions-menu / projects / session-row suites; tsc + eslint clean on touched files