Skip to content

🗂️ feat: Choose Conversation Checkout Mode - #16679

Merged
danny-avila merged 6 commits into
devfrom
danny-avila/workspace-checkout-selection
Oct 2, 2026
Merged

danny-avila merged 6 commits into
devfrom
danny-avila/workspace-checkout-selection

Conversation

@danny-avila

@danny-avila danny-avila commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A coding chat currently inherits the worker's checkout policy: conversation-worktree workers always isolate, while other workers use their registered checkout. The owner cannot explicitly choose between shared files and a conversation-owned checkout.

Add a Checkout mode choice under the selected repository in the composer: Isolated worktree or Registered checkout. Save it in the existing conversation decision, preserve it on reload and stale ordinary saves, and show the recorded mode in the workspace chip. The choice is available before the decision is sealed; existing attach/detach transitions remain intact.

Mechanism

composer checkout choice
  → codeWorkspaces[].checkout
  → existing durable decision and admission checks
  → live policy + worker capability validation
  → source root OR server-derived conversation workspaceInstanceId
  → existing file, command and programmatic execution paths

No new worker operation, creation-on-render, status poll, database query, or second binding is introduced. An explicit isolation choice fails closed if worker support disappears; it never becomes shared-root execution. Legacy field-less selections keep their current policy. The same canonical selection identity is used for sealing and replay.

Enablement and scope

Opt in with configSchema.workspaces.allowCheckoutSelection: true on the attached environment/control plane after all API replicas and clients are updated. Isolation requires workspaceInstances: [git_worktree]; a worker's existing conversation-worktree configuration supplies it. Linked-worktree lanes and conversation-worktree provisioning are different worker configurations, not interchangeable modes. See setup and rollout notes.

An isolated checkout starts from the worker's admitted Git snapshot; uncommitted source files are not copied. environment.ref remains operator metadata, not a branch switch. Arbitrary base-ref selection and archive/restore are subsequent worker-protocol slices, not implemented here. No live workers were changed.

Tests

  • 154 focused client tests passed: checkout selection, same-machine repository changes, explicit attach/recovery, multi-environment reload summaries, capability/policy loss, ambiguous transition choices, existing attach/detach and machine transitions.
  • 607 API/contract tests passed: actual browser payload construction, selection identity, execution-context routing, effective-policy validation before transition CAS, configuration validation and real Mongoose schema serialization.
  • 2 real-Mongo persistence cases passed: source/isolated save, reload and stale-save preservation.
  • Data-provider tsc --noEmit passed locally. Client, API and data-schemas local typechecks encountered stale compiled workspace dependency types in the reused installation; CI typechecks with rebuilt packages passed on the final head.
  • Local Lighthouse was attempted; preparation stopped at missing tsdown before a browser audit. This reused installation also lacks @shadcn/lint; no broad dependency repair was performed. Test configuration maps this branch's data-provider source and uses reused external dependencies.

Final head: 1c195a4d0a0a9a0ad423a5b6f271d3d2bde1668d. Exact-head review reported no major issues. CI typechecks, package builds, static checks and Lighthouse passed. Broader frontend/E2E checks are still running; no failures have been reported at handoff.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 16:38
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 8a2f253. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T17:15:46.392701Z 1c195a4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The UI can misrepresent an automatic checkout as explicit isolation, omits modes from multi-environment chips, and the new toggle lacks its required default.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds opt-in, per-conversation checkout selection across persistence, execution routing, and the composer UI.

Changes:

  • Adds source and isolated checkout modes to workspace decisions.
  • Validates capabilities and routes isolated sessions through conversation worktrees.
  • Adds configuration, UI controls, documentation, and focused tests.
File Description
packages/​data-schemas/​src/​schema/​defaults.ts Persists checkout mode.
packages/​data-schemas/​src/​schema/​defaults.spec.ts Tests schema serialization.
packages/​data-schemas/​src/​methods/​conversation.spec.ts Tests stale-save preservation.
packages/​data-provider/​src/​config.ts Adds the feature toggle.
packages/​data-provider/​src/​config.spec.ts Tests toggle validation.
packages/​data-provider/​src/​code/​workspace.ts Defines checkout modes and validation.
packages/​data-provider/​src/​code/​selection.spec.ts Tests selection identity.
packages/​api/​src/​code/​capabilities.ts Resolves checkout routing.
packages/​api/​src/​code/​capabilities.spec.ts Tests routing and failure behavior.
packages/​api/​src/​agents/​execution.ts Preserves checkout selections.
packages/​api/​src/​agents/​execution.spec.ts Tests capability stripping.
docs/​workspace-checkouts.md Documents setup and semantics.
client/​src/​locales/​en/​translation.json Adds checkout labels.
client/​src/​hooks/​Agents/​useCodeWorkspace.ts Validates checkout availability.
client/​src/​hooks/​Agents/​__tests__/​useCodeWorkspace.test.tsx Tests restored selections.
client/​src/​components/​Chat/​Input/​CodeWorkspaceMenu.tsx Adds checkout controls and chip labels.
client/​src/​components/​Chat/​Input/​__tests__/​CodeWorkspaceMenu.spec.tsx Tests checkout interaction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/src/components/Chat/Input/CodeWorkspaceMenu.tsx Outdated
Comment thread packages/data-provider/src/config.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a2f253d75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/data-provider/src/code/workspace.ts
Comment thread client/src/components/Chat/Input/CodeWorkspaceMenu.tsx
Comment thread client/src/components/Chat/Input/CodeWorkspaceMenu.tsx Outdated
Comment thread packages/data-provider/src/code/workspace.ts
@danny-avila

danny-avila commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 13675d6. Confirm the exact reviewed commit. Audit checkout submission, durable persistence, explicit transitions, and effective-policy validation together.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current PR head 8b2b378. Confirm this exact reviewed commit. This head additionally corrects the parsed-default test fixture and reuses the shared checkout enum. Please audit submission, transition admission and durable execution-target identity together.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b2b378c42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/components/Chat/Input/CodeWorkspaceMenu.tsx Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current PR head cc895af, confirming the exact reviewed commit. Source is now offered independently of isolation. Transition readiness shares the policy/capability validator and requires an explicit mode when predecessor decisions differ. Tests cover unsupported-isolation correction and ambiguous transitions. Please review this lifecycle as a whole.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review final current PR head 1c195a4, confirming this exact reviewed commit. The source audit additionally preserves explicit mode when selecting another repository on the same machine; both modes have regression tests. Review mode continuity across initial selection, payload, persistence, move/recovery and execution, including capability loss and mixed predecessor modes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 1c195a4d0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila marked this pull request as ready for review October 2, 2026 17:17
@danny-avila
danny-avila merged commit 35a2bee into dev Oct 2, 2026
45 checks passed
@danny-avila
danny-avila deleted the danny-avila/workspace-checkout-selection branch October 2, 2026 18:41
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.

2 participants