Repository navigation
Description
Product or interface
Desktop app
Use case and problem
I want to keep a session that started in the default workspace (no project) and later promote it into a real project directory: the session keeps its conversation and the files it produced, and from then on it runs inside that project.
Today the desktop app has no way to do this.
What exists today, and why none of it covers this case:
- Create a new task inside the project (
onNewTaskInProjectin the sidebar) — binds a new conversation to the project directory. It does not carry over the existing conversation, and the old session stays where it was. - "Move to project" in the session menu — the entry exists in the UI bundle (
sidebar.action_move_to_project) but it is cloud-only. The action is gated bycanUseCloudProjects, which is computed assource === "cloud", and returns early for local sessions; the submenu entries are rendered with a cloud project icon (target: { source: "cloud", id }); the underlying call isPATCH /session/{id} { project_id }against the cloud API, and the local runtime explicitly rejectsproject_idwithproject_id is not supported by desktop local-runtime. - "Move to section" (
sidebar.action_section) only changes a front-end grouping inside the sidebar store (assignments/sections/sessionOrder). It does not touch the session's workspace or its project, and the runtime does not know about it. - Dragging a session in the sidebar drops it into a section as well, not into a project.
So for a local desktop session there is currently no action that changes which project (that is, which directory) the session belongs to.
Why this is not only a UI toggle
In the local runtime model a workspace project is its directory, so moving a session into a project is a change of the session's run location rather than a metadata edit:
local_runtime_projectsconstrainsproject_kind='workspace'rows to exactly one non-emptyworkspace_dir, with a unique index on it; thedefaultkind holds no directory at all.local_runtime_sessions.project_workspace_dir+is_default_workspacedetermineproject_idthrough thetrg_local_runtime_project_session_assignment_v5trigger, and the runtime raisesSession Project associations are incompletewhen a session'sproject_iddoes not match a project row with the same directory.resolveWorkspace()prefers the session's explicit workspace directory over the agent/session default, so the bound directory is also the agent's working directory.
Consequences of a local move, which a metadata-only implementation would miss:
- Rebind the session —
workspace_dir/project_workspace_dir/is_default_workspace;project_idis then re-derived by the existing trigger, so it stays consistent. - Relocate the artifacts the session produced; they live in the old session workspace folder (
~/.minimax/sessions/<session-id>/workspace/). - Repoint historical path references.
local_runtime_turn_diffsandlocal_runtime_turn_diff_journalstore the workspace directory used for each captured change (they back the "review changes / undo" panel), andlocal_runtime_session_assetsstores the absolute path of every delivered file (the file cards in the chat). The runtime never updatesworkspace_diron those rows, and there is noUPDATEstatement forlocal_runtime_session_assets.pathat all — so after a rebind the delivered-file cards and the undo records still point at the old directory and become dead links.
Desired behavior
- A local session's context menu offers a working Move to project, listing local (directory-backed) projects.
- Selecting a project rebinds the session: it stays the same conversation (same session id, same history and attachments) and its working directory becomes the project directory for subsequent turns.
- The user is asked whether to relocate the workspace files that session produced into the project directory, or is clearly told that they remain in the old folder.
- After the move, the delivered-file cards and the change/undo panel of that session resolve to the new location.
- Moving one session does not affect other sessions of the same project, and deleting a project still behaves as it does today.
Platform
Windows
Alternatives and additional context
- Workaround used locally: update
runtime-state.sqlitedirectly (with a backup) to rebind the session, copy the produced files into the project directory, and repair the path fields inlocal_runtime_turn_diffs/local_runtime_turn_diff_journal/local_runtime_session_assetsby hand. This shows the operation is feasible, but it is unsupported, it touches a runtime-owned database, and step 3 is easy to miss — which is the reason a supported action would help. - Related: [Feature]: add option to move chat session from "No Projects" to Project #136 (closed as
not_plannedin a backlog cleanup; it asked for the same move, including moving the workspace data) and [Feature]: Allow creating a project without a local directory, and attach multiple directories to one project #554 (projects with several directories).
Environment: MiniMax Code 3.1.16.226, Windows 10 x64.
中文摘要
桌面端目前无法把一个已存在的本地会话迁入已有项目。会话菜单里的「移动到项目」是云端专用:canUseCloudProjects 仅在 source === "cloud" 时为真,本地会话点了直接 return;子菜单图标写死 source: "cloud";底层是云端 PATCH /session/{id} { project_id },而本地运行时会明确拒绝 project_id。「移动到分区」只是侧边栏的纯前端分组,拖拽落到的也是分区。
由于本地项目在数据模型里就等于它的目录,迁移实际包含三件事:① 改绑会话(workspace_dir / project_workspace_dir / is_default_workspace,project_id 由既有触发器自动重算);② 搬迁会话产出的文件;③ 修正历史路径引用——local_runtime_turn_diffs / turn_diff_journal(撤销/回滚面板)与 local_runtime_session_assets(交付文件卡片)仍指向旧目录,改绑后即成死链,而运行时从不更新这些行。
希望官方提供受支持的「将会话移动到项目」入口,并一并处理产物搬迁与历史引用修正。
Activity