Apply managed agent config per-agent and honor default model - #276
Merged
Conversation
AarushiShah-db
previously approved these changes
Aug 6, 2026
AarushiShah-db
approved these changes
Aug 6, 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.
Changes
Makes an admin-published managed coding-agent config work for every agent, not just Claude Code, and fixes three bugs found while testing it. All behavior stays behind
ENABLE_MANAGED_AGENT_CONFIG; with it unset the launch path is unchanged.managed_state_overridestranslates the manifest's model list into the shape each agent reads: provider-bucketed for opencode, per-agent keys for pi and copilot. Previously every non-claude agent got a flat list, which crashed opencode and was silently ignored by pi and copilot.pi_models,copilot_models) instead of writing the sharedclaude_models/codex_models/gemini_models. Those are workspace-wide discovery that claude, codex, and gemini also read, so one agent's managed policy could change what another launched.default_modelnow survives the whole session. Non-claude agents applied it once at launch and then immediately overwrote it: pi/copilot'slaunch()and the 30-minute token refresh re-derive the model from state, which never held it, so they fell back to the allowlist's first entry.resolve_statenow overlays<tool>_default_modeland each agent prefers it. Claude was already correct – it pins the model asANTHROPIC_MODELand never re-derives. Family slots are unaffected: an unset family stays unset rather than inheritingdefault_model.enabled_agentsis an allowlist; launching outside it ran fully unmanaged. Checked before model discovery so a rejected launch fails fast instead of after a ~19s sweep.--skip-preflightstill reads the cache by design. This replacesmanaged_launch_statewith a fetch plus a separateresolve_state, since the manifest has to be layered over post-discovery state.classify_model_familyextracted so a model named in a config buckets exactly as discovery would.Test Plan
Screen.Recording.2026-08-05.at.3.12.20.PM.mov