Skip to content

agentHost: apply managed model defaults without locking choices - #341682

Merged
Ross Wollman (rwoll) merged 18 commits into
mainfrom
agents/managed-model-startup-defaults
Oct 16, 2026
Merged

Ross Wollman (rwoll) merged 18 commits into
mainfrom
agents/managed-model-startup-defaults

Conversation

@rwoll

@rwoll Ross Wollman (rwoll) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

agentHost: apply managed model defaults without locking choices

Expose the runtime's model, autoTier, effortLevel, and contextTier startup defaults in the Copilot Agent Host picker. Managed defaults take precedence over inherited personal preferences in new chats, while explicit current-chat choices and existing conversations retain their configuration.

Use enableManagedSettings without the separate enforceManagedModelDefaults opt-in. A server-normalized scalar is not evidence of a user lock. Permission/sandbox enforcement and genuinely read-only options advertised by other hosts are unchanged. Ensemble managed-settings integration is out of scope.

Scenarios and Precedence

Scenario Expected Behavior
New chat, supported managed default, conflicting saved preference Managed startup default wins. Auto / Intelligence wins over saved Efficiency; no fresh profile is required.
User changes model, tier, effort, or context in this chat Explicit current-chat choice wins, including edits after draft initialization and before the first send. Notification actions use the same scoped configuration as the picker.
Return to a chat with an available attached model Preserve its model and applied configuration, including previously implicit defaults. Validate restored choices against that chat's schema.
Existing chat's model is conclusively unavailable Use an available managed model default; do not copy the old model's effort/context options to its replacement. A pending catalog is not proof of unavailability.
Automation template explicitly references an unavailable model Preserve the template and unavailable selection until the user chooses another model.
No applicable managed default Use saved personal preferences, then built-in defaults. Existing chat.defaultModel behavior remains the model-selection fallback. A scoped report without managed defaults does not inherit root managed keys.
Managed model or option is unavailable / unsupported Do not invent a picker choice or project options onto an unrelated model. Runtime resolution remains authoritative; see the unsupported-effort caveat below.
Managed default is removed New chats can use saved personal preferences again. Untouched managed defaults are not persisted as personal choices; existing chats keep their own configuration.
Reset with both read-only and editable options Reset only editable properties; retain host-owned values and write protection.

Reports are exact-chat-scoped, coalesced, and asynchronous: readback does not block a completed model change. Catalog refreshes update live reports rather than retaining launch-time choices.

Manual Validation

The maintainer reports that manual testing works in the freshly built Code OSS preview at head bd6fe32086d1f5b44298c7e32fa9d2a63dc44e42. Individual cases were not enumerated, so this is a successful user-reported smoke test, not a claim that every scenario below was independently verified.

Use plain, server-shaped payloads with the native test rig. Restart Agent Host after changing policy. Test both a fresh profile and an existing profile with a conflicting saved preference.

{ "model": "auto", "autoTier": "intelligence" }

Start a new chat with saved Efficiency: expect editable Auto / Intelligence. Choose Balance or Efficiency, send a short prompt, and verify the choice does not snap back. Another model remains selectable.

{ "model": "gpt-5", "effortLevel": "high", "contextTier": "long_context" }

Replace gpt-5 with an available model offering both options. Expect editable High effort and long context. After draft initialization, change both and send: the edited values must remain selected. Switch between two chats and reload: each retains its configuration. Remove policy with {} and restart: new chats use personal preferences rather than retaining an untouched managed default.

Runtime Caveats

  • github/copilot-agent-runtime#26681: unsupported effort still reaches inference in the bundled runtime's default-only mode. Its characterization test reproduces the limitation; it is not a fix. Use supported model/effort combinations.
  • github/copilot-agent-runtime#26739: conflicting-lock resume is nondeterministic in the separate strict SDK mode, not enabled here. Its desired-success test is explicitly skipped pending the runtime fix; default-only resume has independent, enabled coverage.
  • Upstream picker normalization can move HydraFusion to Ensemble High when intelligenceUsesHydraFusion is false. This predates this PR and is separate from managed-default precedence. A general GPT/Claude-to-Ensemble reset has not been reproduced.

🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).

Ross Wollman (rwoll) and others added 5 commits October 14, 2026 19:34
Wire existing runtime model, Auto tier, effort, and context policies into session configuration and the model picker. Preserve personal preferences beneath managed values and publish chat-scoped runtime reports.

Draft implementation: runtime compatibility bugs and local review findings remain merge blockers. Ensemble managed settings are a separate dependent change.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Keep restored conversation values separate from durable preferences and honor standard read-only defaults without optional provenance metadata. Add cross-chat, late-registration, and lock-removal regressions.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Use runtime model controls as startup defaults without opting into strict model enforcement. Preserve explicit and restored configuration, protect host reports, and keep ordinary picker edits aligned with request assembly.

Cover normalized server payloads and known runtime limitations. Fix review regressions, cross-platform path expectations, formatting, and deterministic AHP report handling.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Replace the text diagram with a Mermaid flowchart and keep the ownership, runtime-mode, and validation rules concise.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 04:20
Ross Wollman (rwoll) and others added 2 commits October 14, 2026 21:21
Remove the new guide and its skill reference at the maintainer's request.

*🤖 Authored with GitHub Copilot on behalf of @rwoll.*

Co-authored-by: Copilot <[email protected]>
Reviewed-head: 64f6c27
Pull-request: #341682
Approved-by: rwoll via PR Sign-Off
Requested-by: copilot
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Base: 6568afc9 Current: 1fa71d5e

No screenshot changes.

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.

🟡 Changes recommended

Configuration restoration and edit-path regressions remain, and report readback adds blocking work before prompt submission.

4 open findings
What changed in this PR

Exposes Copilot Agent Host model defaults as editable picker choices while separating runtime state from personal preferences.

Changes:

  • Adds chat-scoped model reports and default-source tracking.
  • Connects picker configuration, requests, restoration, and read-only controls.
  • Expands regression coverage and documents runtime limitations.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​common/​languageModels.test.ts Tests default persistence and read-only choices.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​modelPicker/​modelPickerTabs.test.ts Tests accessible managed-value descriptions.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatModelConfigurationStore.test.ts Covers scoped defaults, restoration, and preferences.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentSessionSettingsFileSystemProvider.test.ts Tests report-safe settings writes.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostLanguageModelProvider.test.ts Tests host metadata forwarding.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatContribution.test.ts Tests exact-chat report projection.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​accessibility/​chatAccessibilityHelp.test.ts Tests read-only option guidance.
src/​vs/​workbench/​contrib/​chat/​common/​model/​chatModelStore.ts Adds model-report startup state.
src/​vs/​workbench/​contrib/​chat/​common/​model/​chatModel.ts Carries observable model reports.
src/​vs/​workbench/​contrib/​chat/​common/​languageModels.ts Preserves explicit defaults and honors read-only values.
src/​vs/​workbench/​contrib/​chat/​common/​chatSessionsService.ts Exposes session model reports.
src/​vs/​workbench/​contrib/​chat/​common/​chatService/​chatServiceImpl.ts Forwards reports into chat models.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​modelPicker/​modelPickerModelConfig.ts Describes managed values and excludes locked changes.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatModelConfigurationStore.ts Applies scoped reports and tracks preference sources.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatModelConfigurationLogic.ts Adds default tracking and write guards.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Observes active-chat model reports.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentSessionSettingsFileSystemProvider.ts Excludes runtime reports from settings writes.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionHandler.ts Maps exact-chat reports to editor model identifiers.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostLanguageModelProvider.ts Forwards default-tracking metadata.
src/​vs/​workbench/​contrib/​chat/​browser/​actions/​chatAccessibilityHelp.ts Documents editable defaults and read-only options.
src/​vs/​sessions/​contrib/​providers/​agentHost/​test/​browser/​localAgentHostSessionsProvider.test.ts Tests report preservation during replacement.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​baseAgentHostSessionsProvider.ts Keeps reports out of preferences and writes.
src/​vs/​sessions/​contrib/​providers/​agentHost/​AGENT_HOST_SESSIONS_PROVIDER.md Documents chat-scoped report ownership.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionModelSelection.test.ts Tests scoped draft configuration.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionModelSelection.ts Adds fallback configuration access.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts Enables scoped picker configuration.
src/​vs/​sessions/​contrib/​automations/​browser/​automationModelConfiguration.ts Separates implicit defaults from captured preferences.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotAutoTier.integrationTest.ts Tests runtime defaults, edits, and resume behavior.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​README.md Documents integration coverage and runtime caveats.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​providers/​copilotAgentHostE2E.integrationTest.ts Asserts protected runtime model reports.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​harness/​ahpSnapshot.ts Omits asynchronous report-only traffic from summaries.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Updates launcher assertions and configuration helpers.
src/​vs/​platform/​agentHost/​test/​node/​copilotSdkManagedSettings.integrationTest.ts Tests managed-setting composition contracts.
src/​vs/​platform/​agentHost/​test/​node/​copilotManagedSettings.test.ts Tests policy resolution inputs and failures.
src/​vs/​platform/​agentHost/​test/​node/​copilotManagedModelConfiguration.test.ts Tests default projection and omission.
src/​vs/​platform/​agentHost/​test/​node/​copilotApprovalPolicy.test.ts Moves resolution coverage to its dedicated suite.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Tests owning-chat report publication and removal.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Updates policy and metadata expectations.
src/​vs/​platform/​agentHost/​test/​node/​ahpSnapshot.test.ts Tests report-only traffic filtering.
src/​vs/​platform/​agentHost/​test/​node/​agentService.test.ts Tests protection against client report writes.
src/​vs/​platform/​agentHost/​test/​common/​agentModelConfigurationMeta.test.ts Tests report and metadata validation.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionLauncher.ts Omits implicit managed options at creation.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotManagedSettings.ts Extracts shared runtime policy resolution.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotManagedModelConfiguration.ts Projects defaults and builds runtime reports.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotApprovalPolicy.ts Removes relocated resolution code.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Refreshes and publishes chat-owned model reports.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Integrates catalog defaults and model-change policy.
src/​vs/​platform/​agentHost/​node/​agentService.ts Protects runtime reports from client writes.
src/​vs/​platform/​agentHost/​common/​meta/​vscode/​agentModelConfigurationDefaults.ts Reads and writes default-tracking metadata.
src/​vs/​platform/​agentHost/​common/​meta/​agentModelConfigurationMeta.ts Exports metadata helpers.
src/​vs/​platform/​agentHost/​common/​agentModelConfiguration.ts Defines reports, validation, and source markers.
.github/​skills/​policy-and-managed-settings/​github-managed-settings.md Distinguishes workbench policy from runtime defaults.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Ross Wollman (rwoll) and others added 2 commits October 15, 2026 09:30
Keep saved personal preferences below managed startup defaults while preserving existing chats and explicit current-chat choices. Carry validated default provenance through model catalogs and chat-scoped reports, and cover restoration and unavailable-model fallback.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
Integrate main at 82b09e6, preserving managed-model reports alongside per-chat configuration. Correct restoration test identity and diagnose native policy contamination before synthetic managed-model integration tests.

Validation: 3007 unit tests passed (27 pending); client type-check, targeted ESLint, and branch hygiene passed. Real-SDK policy tests are blocked by machine-wide device policy; the explicit preflight was verified. No policy files were changed.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>

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.

Preserve telemetry revocation handling while coalescing model reports off the send path and reading the live catalog. Route notification edits through scoped preferences, retain scoped restore choices and inherited-default provenance, and exclude read-only options from reset payloads.

Fix the concurrent-policy-query ordering assertion. Validation: 2168 unit tests, 25 native SDK tests, and 268 Copilot replay tests passed; client typecheck and branch hygiene passed.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
Reviewed-head: bd6fe32
Pull-request: #341682
Approved-by: rwoll via PR Sign-Off
Requested-by: astra
Ross Wollman (rwoll) and others added 2 commits October 15, 2026 13:44
Bring in #341849 and latest main after the upstream panel regression fix landed. Client fast build and focused panel/terminal-style validation passed (14 tests).

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
Reviewed-head: 4e1dc95
Pull-request: #341682
Approved-by: rwoll via PR Sign-Off
Requested-by: astra
The strict managed-lock runtime reproduction can either reject or successfully reconcile the same saved chat. Specify the desired success contract and narrowly skip this unsupported opt-in scenario under github/copilot-agent-runtime#26739 instead of requiring the defect to occur. Default-only coverage remains active.

Validated client build, ESLint and 24 passing / 1 pending focused integration tests across six runs. No manual CI triggered.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
roblourens
roblourens previously approved these changes Oct 15, 2026
Replace timer and root-catalog query-count assumptions with the session configuration publication event. Retain exact workspace-query and no-session-start assertions, and cover a deliberately blocked catalog.

Validation: client fast build, targeted ESLint, 95 restart tests (1 existing pending), and 10 repetitions of both catalog timing variants passed.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
Reviewed-head: 757856a
Pull-request: #341682
Approved-by: rwoll via PR Sign-Off
Requested-by: astra
roblourens
roblourens previously approved these changes Oct 15, 2026
Register a concrete DisposableStore for Event.toPromise instead of passing the suite's add-only disposable helper. Validated client type-check, client build, 95 restart tests (1 existing pending), and targeted hygiene.

🤖 Authored with GitHub Copilot on behalf of @rwoll.

Co-authored-by: Copilot <[email protected]>
Reviewed-head: cfd4a3f
Pull-request: #341682
Approved-by: rwoll via PR Sign-Off
Requested-by: astra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants