Skip to content

fix(team-session): continue with matching local workspace - #2159

Merged
Neonforge98 merged 3 commits into
developfrom
codex/cloud-continuation-autoselect
Sep 26, 2026
Merged

Neonforge98 merged 3 commits into
developfrom
codex/cloud-continuation-autoselect

Conversation

@Neonforge98

@Neonforge98 Neonforge98 commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Opening a teammate's Cloud session on a second device exposes Fork/Take Over actions even when that device already has a checkout of the same repository. The legacy fork affordance sends people through setup and creates a separate child conversation. Without a matching checkout, the expected workspace prompt also produced a generic send-failure toast. The existing local checkout resolver also favored the source machine's path over the workspace selected on the receiving device, and could accept a repointed path without matching its Git remote.

Solution

Continue member Team Sessions through the existing canonical Agent composer and queue. Resolve the receiving device's selected checkout first, then other local checkouts, verifying each against the Cloud session's repository scope. Refresh that resolution when the selected workspace or local inventory changes, and wait for remote metadata and a complete cold-start repo inventory before declaring a checkout missing. Remove member-facing Fork actions from the session header/sidebar, and make Kanban's Continue action open the shared replay. Keep guest share-link Fork because guests cannot write to the member Cloud conversation.

When an imported Cloud replay has no matching local checkout, retain the Agent draft and show an Open workspace prompt before dispatch, without a duplicate error toast. Team Chat is routed first and remains a human discussion message without starting an Agent run. No persistence schema, RPC, or wire format changes are included.

Potential risks

  • The no-match UI was verified on two isolated macOS app instances after temporarily moving the source-only test checkout out of the shared filesystem. This models a second machine on one Mac; a physical second host and non-macOS directory picker remain unverified. The test checkout was restored. No full-window screenshot is attached because it includes local workspace metadata.
  • A selected clone can now receive a continuation ahead of the source machine's same-path clone when both match the same Git remote. This follows the receiver's explicit workspace selection; switching workspaces invalidates the resolution.
  • Native conversations containing historical tool calls still need the independent transcript-normalization fix in fix(session-replay): preserve native materialization fidelity #2157. The native continuation check here used a test Rust binary carrying that fix, while this PR changes the TypeScript surface and dispatch selection.
  • No database, public API, or sync payload changes require migration. Reverting this PR restores the previous local selection and Fork controls; previously queued Cloud turns remain in the canonical conversation.

Verification

  • pnpm test -- src/features/Org2Cloud/SessionConversation/CloudWorkspaceRequiredDialog.test.ts src/engines/ChatPanel/hooks/conversationSubmit/useConversationSubmitRouter.test.ts src/features/TeamCollaboration/forkSession.test.ts src/scaffold/NavigationSidebar/connectors/WorkstationSidebarConnector/cloudSessionNativeMenuItems.test.ts src/features/Org2Cloud/SessionConversation/useCloudConversationSource.test.ts — 76 passed.
  • pnpm test -- src/features/TaskKanban/components/ListView/index.test.ts src/scaffold/NavigationSidebar/connectors/WorkstationSidebarConnector/cloudSessionsSection.autoReplayReveal.test.ts — 25 passed.
  • pnpm test -- src/features/Org2Cloud/SessionConversation/useCloudConversationSource.hydration.test.ts — 1 passed, covering remote-row and local-inventory cold-start ordering.
  • pnpm test -- src/engines/ChatPanel/hooks/conversationSubmit/useConversationSubmitRouter.test.ts src/engines/ChatPanel/hooks/useInputArea/__tests__/useSubmitMessage.test.ts — 45 passed after the dialog-handled rejection change, including draft restoration without a generic error toast.
  • pnpm typecheck:fast, targeted pnpm exec eslint, pnpm check:i18n-keys, pnpm check:circular, pnpm check:test-placement, node --check tests/e2e/specs/core/cloud-org-ui.spec.mjs, and git diff --check — passed. The repository pre-commit hook also passed lint-staged and tsgo.
  • Native macOS test with separate Neonforge/VantaNode app data homes and local clones: on the receiver, opened a shared Team Session with no Fork header or sidebar action, sent an Agent pwd turn directly, and received /private/tmp/orgii-cua-validation/vantanode without a setup dialog. The source reply and earlier human Team Chat turns remained in the shared transcript.
  • Native no-match macOS test: in the shared unique-repository Cloud workspace, temporarily moved the source-only checkout away, reopened the Team Session on the receiver, and attempted an Agent turn. Only the Open a matching workspace dialog appeared; Cancel preserved the draft, no Agent turn was created, and Open workspace launched the system directory picker. After the dialog-specific toast fix, the same test showed no generic send-failure toast. The test checkout was restored.
  • The rendered WebDriver E2E suite was not run; its changed Kanban selector was syntax-checked, while the native check covered the primary direct-continuation flow.

Audit

Architecture review covered Cloud authority, local repository identity, selected runtime/queue admission, UI entry points, and repo-inventory lifecycle; Rust, SQL, and wire layers were unchanged. Performance review found no new timer, polling loop, worker, or persistent subscription. Checkout probes run when the remote row or local inventory/selection changes and cancel stale async results.

@Neonforge98
Neonforge98 merged commit 1cd5299 into develop Sep 26, 2026
16 checks passed
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