automations: fix: restore provider configuration and custom agents - #335595
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 8 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
This was referenced Sep 10, 2026
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.
Automation provider configuration and custom-agent follow-ups
Contents
Context
An automation separates its execution target from its provider-owned session template. The target selects the provider, workspace, isolation mode, and branch. The template holds model configuration, custom-agent selection, and native preferences such as Mode, Approvals, and Cloud Sandbox.
Editing and executing an automation must preserve those preferences without turning them into permanent permission grants. The provider's current capabilities and policy still determine the effective runtime behavior. Both the browser fallback executor and the durable Agent Host executor must pass the selected model and custom agent to the first turn.
Stack and review scope
This draft extracts the eight provider-configuration and custom-agent fixes from the already-merged #335018.
The draft is #335595. It intentionally remains a draft with automatic merging disabled.
The review stack is:
ulugbekna/fix-automation-worktree-gating): the smaller seven-commit worktree-discovery, branch-picker, validation, and startup repair.ulugbekna/automation-config-followups: the remaining eight logical commits, based on the smaller worktree branch rather thanmain.Review this draft against #335593, on
ulugbekna/fix-automation-worktree-gating. Its diff is limited to ten files covering provider configuration, custom-agent execution, and their regression tests.There are no standalone worktree-capability, New Worktree gating, branch-search, or worktree-pending-startup changes in this draft. Those belong to its base. There are also no shared ActionList or IME changes. The Codex worktree changes here specifically preserve custom-agent identity and instructions during worktree execution.
Restored fixes
Cloud model selection and canonical preferences
Restoring a Cloud model previously updated the visible selection without consistently updating the extension's model option. The shared model-update path now synchronizes both representations, including when the extension's option catalogue arrives later.
Canonical template configuration takes precedence over legacy mode and permission aliases. Unknown provider values remain intact so saving an automation does not erase preferences the current provider cannot interpret. Unsupported Cloud permission changes are no-ops: they do not silently replace the saved canonical preference or change Cloud's effective default permissions.
Fallback CLI approvals
The fallback CLI keeps a restored approval preference separately from its policy-effective value. Current policy controls display and execution; an unchanged saved preference survives capture so editing an automation does not accidentally replace its intent with a temporary policy restriction.
Cloud Sandbox execution
Cloud Sandbox is part of the automation's own captured template and is restored independently of the ordinary composer's remembered choice. Legacy definitions retain their previous fallback behavior until their first capture. The existing Sandbox control is available in Automation controls and remains gated by AI visibility.
The original regression
does not enable unsupported Cloud worktree or branch configurationis rehomed into this commit rather than the smaller worktree PR. It asserts that Cloud does not acquire worktree support, isolation or branch values, and captures{ autoApprove: Default, useSandbox: false }. It requires these Cloud fixes and therefore belongs with them.First-turn custom agents
The Agent Host executor inherits the creation-time custom agent into the first message, independently of model inheritance. An explicit first-message selection still takes precedence. Fallback-provider tests also cover sending the restored custom agent on the first automation request.
Codex custom agents in worktrees and restored sessions
Codex resolves a selected native workspace agent against the host-owned worktree when preparing customization launch. Host worktree metadata and canonical repository roots establish the relationship; the persisted agent URI is not rewritten.
This keeps agent instructions available on repeated turns, after reapplying the same selection, and after provider reload, including linked source checkouts. Plugin and external selections are not redirected. Existing telemetry injection and workspace-less customization directories are preserved.
Native configuration controls
Automation controls reuse the provider's existing enum and boolean pickers so equivalent settings remain consistent across surfaces. Generic controls do not duplicate the dedicated worktree, branch, Mode, or Approvals controls and do not expose transient session-only configuration.
The existing Dev Container handoff remains separate. The extraction preserves the current picker constructor options and the upstream relocation of the Dev Container control.
Intentional limits
Commit inventory
1b7e62e17e3df4ac6382b11f44f2eaac3173f1775aba507adda226cdeabc94ebcb4d4c118577ef870ec0dc06afc2e297266558f45ca91d6eb7c964c2aa2edf971fb6d5884de7f7e564cd05e5e5c461304d32366ee5f960b0There are exactly eight commits above base
790568f194ff986449c9c1fb62142149fc8e09d7. The draft head is66ee5f960b032875783ab5c1779499cb4142cab2.Validation
npm run typecheck-client: passed.npm run transpile-client: passed.git diff --checkagainst the stacked base: passed.The passing coverage includes the rehomed Cloud worktree/branch regression, canonical and late Cloud model restoration, Sandbox feature gating, policy-effective CLI approvals, native configuration controls, first-message selections, and Codex worktree/provider-reload behavior.
Draft readiness and CI
The branch is pushed and clean, with eight commits across ten files. The current GitHub check snapshot reports CLA and Dependencies Check passing, VS Code PR Check pending, and no failed checks or unresolved review comments.
The main Code OSS, Component Fixtures and CodeQL workflows only trigger for pull requests targeting
mainor release branches. They are not running for this draft's feature-branch base. Local validation is complete, but this must not be described as full GitHub CI coverage.Keep this draft stacked on #335593 while the revert and smaller fix are reviewed. Once those prerequisites land, rebase/retarget this draft onto main, review the eight follow-ups, and run the normal main-targeted checks before considering it ready.
Exact-tree guarantee
The complete stacked tree is byte-for-byte identical to main at
5e142ece6c7aeb3d5f56892328b7300f15de8b36, including unrelated upstream changes.The command exits successfully with no output. Both trees have Git tree ID
62f713c2aa784ad9fb7df897d327822dcf79cc5b. This verifies that the revert, smaller worktree repair, and eight follow-ups only restructure the existing fix and do not introduce content drift.