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

Đang mở
#614 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
desktop

Hướng nghiên cứu

Start by tracing the existing “Move to project” action and canUseCloudProjects gate in the desktop sidebar, then inspect the local runtime session and project assignment logic described in the issue. Follow how workspace paths are stored for turn diffs, diff journals, and session assets. Done means a local session can be rebound to a directory-backed project while preserving its conversation and keeping its workspace files, delivered-file cards, and change/undo records usable.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

desktop
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
  • Workaround used locally: update runtime-state.sqlite directly (with a backup) to rebind the session, copy the produced files into the project directory, and repair the path fields in local_runtime_turn_diffs / local_runtime_turn_diff_journal / local_runtime_session_assets by 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: #136 (closed as not_planned in a backlog cleanup; it asked for the same move, including moving the workspace data) and #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(交付文件卡片)仍指向旧目录,改绑后即成死链,而运行时从不更新这些行。

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

Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
315
Merge trung bình
3 giờ 54 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MiniMax-AI/minimax-code

Tất cả issue của MiniMax-AI/minimax-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.