Skip to content

feat(workspaces): allow binding project SOP workspaces via workspaceRunId - #974

Open
crispinhu27 wants to merge 2 commits into
mainfrom
feat/workspace-resume-sop
Open

crispinhu27 wants to merge 2 commits into
mainfrom
feat/workspace-resume-sop

Conversation

@crispinhu27

Copy link
Copy Markdown
Collaborator

Summary

  • Restore optional workspaceRunId on workbench_workspace_open so an ordinary project conversation on the same execution machine can bind directly to a historical/paused SOP run's workspace (automatically resolving child SOPs to their parent workspace via engine.WorkspaceRunID) or switch back to an earlier workspace opened by the same conversation.
  • Enforce execution-machine matching (ExecutionRunnerID) with clear machine-name errors when source SOP and conversation are on different machines, and validate Docker/native sandbox drivers.
  • Preserve existing borrowed-SOP lifecycle semantics:
    • Reclaimed SOP checkpoints are restored in place on open.
    • Edits made in the conversation are saved to the SOP workspace / checkpoint and preserved when subsequently retrying or resuming SOP nodes (Retry / runs_resume).
    • Borrowed SOP runs are kept out of OwnWorkspaceRunIDs, so deleting an ordinary conversation never deletes the SOP workspace.
    • Failed preparation when switching to another workspace rolls back the session binding to the previous workspace.
  • Update workspaceTurnContext, assistantNativeSystemPrompt, docs/conversation-workspaces.md, and add unit/integration tests in internal/httpapi/assistant_workspace_resume_test.go.

Testing

  • go test -race -count=1 ./internal/httpapi -run 'TestWorkspaceOpen|TestBorrowedSOP|TestConversationSandbox|TestTurnContextOffersWorkspaces|TestNativePromptsAreToolFirst|TestConversationWorkspaceTools|TestDeletingConversationRemovesItsWorkspace|TestOpeningSOPWorkspaceOnlyHandsOffWhenStopped|TestAssistantWorkspaceTurn'
  • go test -count=1 ./internal/httpapi (passed; Docker-gated tests skipped without AGENTFLOW_TEST_DOCKER=1)
  • go test -race -count=1 ./internal/engine -run 'TestMainBotControlReusesRunWorkspaceLease|TestConversationWorkspace|TestWorkspaceRestore|TestWorkspaceCheckpoint|TestMaterializeConversationWorkspace'
  • go test -count=1 ./internal/repo ./internal/domain
  • npm --prefix chatbot run build && npm --prefix chatbot test (56 files, 373 tests)
  • go vet ./..., go build ./..., python3 scripts/check-public.py

crispinhu27 and others added 2 commits November 17, 2026 01:18
…unId

- Restore optional workspaceRunId on workbench_workspace_open to bind a same-project SOP run (resolving child SOPs to their parent workspace) or an earlier own conversation workspace.

- Enforce execution-machine matching with explicit machine names when the target SOP lives on a different runner/cloud host, and validate Docker/native sandbox drivers.

- Restore reclaimed checkpoints on open, keep borrowed SOP runs out of OwnWorkspaceRunIDs so deleting a conversation never deletes the SOP workspace, and preserve edits made in chat across SOP Resume / Retry.

- Roll back session workspace binding if opening/preparing a switched target workspace fails.
Co-Authored-By: Claude Code <noreply@anthropic.com>
@crispinhu27

Copy link
Copy Markdown
Collaborator Author

03:00 轮:同步最新 main(head d8d3df2)

改动

本地验证(合并结果)

  • go vet ./...、python3 scripts/check-public.py 通过;scripts/build-chatbot.sh 构建前端通过。
  • go test -p=2 ./...(跳过 CI 单独跑的 5 个真实浏览器用例):除 internal/runtime 外全部通过;internal/runtime 失败的 6 个均是 Docker 沙箱用例(本地容器内 Docker 不能运行容器),在未改动的 main 上同样失败,与本 PR 无关,CI 中由正常 Docker 环境覆盖。
  • 部署:MySQL 8.4.7(本地原生二进制,独立库)+ 本 head 构建的 agentflow,loopforge-account 建管理员、按仓库脚本补 001_run_obs_generated_columns 生成列并导入 seed;/api/health 返回 {"status":"ok"},启动日志无 panic / 5xx。
  • Chrome CDP:登录后打开下列页面,页面正常渲染,控制台无报错、无 5xx 请求。
AI 工作台首页 运行记录

CI 在新 head 上重新运行中。本 PR 目前与 main 无冲突,仍需维护者评审批准后才能合并。

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.

1 participant