mirror of
https://github.com/dohooo/helmor.git
synced 2026-09-22 16:40:02 +08:00
e3b54f66b8
Lever A of the gray-cloud switch fix: get_workspace was the ONLY switch-time input still proxied to the live container. For worktree-mode (container) workspaces its result is 100% DB-derived, so mirror it and answer from the control plane — switching never depends on the container being awake. - D1: new workspace_details table (opaque payload, write-path self-heal CREATE — the git_snapshots precedent, no migration step needed). - PUT /team/sync: new workspaceDetails rows (exact WorkspaceDetail serialization); GET /team/workspace-detail serves them member-readable, D1-only. Local-dev registry mirrors the semantics in-memory. - Container (team_sync.rs): push one workspace's detail on WorkspaceChanged / SessionListChanged / WorkspaceChangeRequestChanged, all workspaces on WorkspaceListChanged, plus a full push in the startup backfill. Detail- mirrored events defer their realtime broadcast until the mirror lands (same P1-6b contract as the session mirror). - Desktop: loadWorkspaceDetail branches to the mirror in team mode (the loadWorkspaceSessions pattern); a null mirror falls through to /rpc.