Skip to content

[Feature]: Move an existing desktop session into an existing project (workspace rebind + artifact relocation) #614

Open

Description

@Chronos1543

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 (onNewTaskInProject in 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 by canUseCloudProjects, which is computed as source === "cloud", and returns early for local sessions; the submenu entries are rendered with a cloud project icon (target: { source: "cloud", id }); the underlying call is PATCH /session/{id} { project_id } against the cloud API, and the local runtime explicitly rejects project_id with project_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_projects constrains project_kind='workspace' rows to exactly one non-empty workspace_dir, with a unique index on it; the default kind holds no directory at all.
  • local_runtime_sessions.project_workspace_dir + is_default_workspace determine project_id through the trg_local_runtime_project_session_assignment_v5 trigger, and the runtime raises Session Project associations are incomplete when a session's project_id does 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:

  1. Rebind the session — workspace_dir / project_workspace_dir / is_default_workspace; project_id is then re-derived by the existing trigger, so it stays consistent.
  2. Relocate the artifacts the session produced; they live in the old session workspace folder (~/.minimax/sessions/<session-id>/workspace/).
  3. Repoint historical path references. local_runtime_turn_diffs and local_runtime_turn_diff_journal store the workspace directory used for each captured change (they back the "review changes / undo" panel), and local_runtime_session_assets stores the absolute path of every delivered file (the file cards in the chat). The runtime never updates workspace_dir on those rows, and there is no UPDATE statement for local_runtime_session_assets.path at 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

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(交付文件卡片)仍指向旧目录,改绑后即成死链,而运行时从不更新这些行。

希望官方提供受支持的「将会话移动到项目」入口,并一并处理产物搬迁与历史引用修正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    desktopMiniMax Code desktop app

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions