Skip to content

feat(workspaces): enable personal conversation workspaces - #1046

Merged
crispinhu27 merged 3 commits into
mainfrom
feature/personal-conversation-workspaces
Nov 18, 2026
Merged

crispinhu27 merged 3 commits into
mainfrom
feature/personal-conversation-workspaces

Conversation

@crispinhu27

Copy link
Copy Markdown
Collaborator

What changed

  • 个人对话可以直接打开和复用可写工作区,在里面写文件、运行命令、预览和下载产物。涉及已有代码时,Agent 在工作区里按需克隆仓库。
  • 个人工作区仅限会话所有者访问。Agent 只能接入本对话开启的工作区。已有个人工作区时,选择项目会新开项目对话。
  • 项目对话继续提供仓库提示,支持按项目权限接入 SOP 工作区和登记 PR。

Closes #167

Scope

  • Platform core / API / runner
  • Shared behavior contract

Compatibility

复用现有工作区、会话绑定和快照字段。个人对话使用共享 Docker 或 native 沙箱。

Validation

  • 本地 Docker 实测模式交接、空白工作区写入 HTML、发布及下载。
  • go test 通过 internal/httpapi、internal/engine、internal/runner、internal/knowledge 和 internal/domain,并复测个人工作区权限与复用用例。
  • 本地 Docker MySQL 的 internal/repo 回归通过,跳过一项在 main 可复现的既有统计失败 TestMySQLReadsObserveExternalChangesWithoutReload。
  • npm --prefix chatbot test 通过 388 项用例。前端构建、go vet、公开内容检查和凭据扫描均通过。

Safety

  • 变更仅包含仓库源码、文档及测试数据。
  • 保留了其他工作区与无关改动。

@Robert0622 Robert0622 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本地 Docker 工作区写入、发布和下载通过。补充回归发现首次开工作区失败后无法绑定项目,已标在代码行。

return
}
s.workspaceRunID = bound.Previous
if err := h.repo.SetAssistantSessionWorkspaceRun(s.ChatOwnerID, s.ChatSessionID, s.ProjectID, bound.Previous, false); err != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 打开个人工作区失败时回滚本次新增的归属记录

首次打开个人工作区时,准备失败会取消 run 并恢复 WorkspaceRunID。新增的 ID 仍留在 OwnWorkspaceRunIDs。模拟工作区树接口返回 503 后,当前对话已经解绑,绑定项目的 PUT 仍返回 HTTP 409,前端也会改走新开对话。请在回滚时一并移除本次创建失败的归属记录。

Robert0622
Robert0622 previously approved these changes Nov 18, 2026

@Robert0622 Robert0622 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复测通过。首次打开个人工作区失败后可以绑定项目,切换环境失败后可以在同一轮恢复并复用原工作区。所有者访问和 Docker 写入、发布、下载回归通过。另有一项旧用例仍期待项目对话自动检出仓库,在 main 同样失败。

@Robert0622 Robert0622 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审 4f86af0。真实 Docker 中的个人工作区写入、发布和下载通过,打开失败回滚后仍可绑定项目。个人工作区权限、按主机提供 Git 凭证以及项目对话自动登记 GitHub PR 和 GitLab MR 的回归通过。旧的 runner 自动检出用例在当前 main 同样失败。最新提交的 CI 全绿。

@crispinhu27
crispinhu27 merged commit 6f7edc7 into main Nov 18, 2026
16 checks passed
@crispinhu27
crispinhu27 deleted the feature/personal-conversation-workspaces branch November 18, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 个人对话可打开工作区,且不再强制绑定 Git 仓库

2 participants