Repository navigation
fix(team-session): continue with matching local workspace - #2159
Merged
Merged
Conversation
Pre-commit hook ran. Total eslint: 0, total circular: 0
Pre-commit hook ran. Total eslint: 0, total circular: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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, targetedpnpm exec eslint,pnpm check:i18n-keys,pnpm check:circular,pnpm check:test-placement,node --check tests/e2e/specs/core/cloud-org-ui.spec.mjs, andgit diff --check— passed. The repository pre-commit hook also passed lint-staged andtsgo.pwdturn directly, and received/private/tmp/orgii-cua-validation/vantanodewithout a setup dialog. The source reply and earlier human Team Chat turns remained in the shared transcript.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.