Skip to content

Navigation Menu

Sign in
Sign up

Scope Yolo mode to the default agent provider - #828

Open
Dinah Xiaoman G (DinahK-2SO) wants to merge 8 commits into
microsoft:main from
DinahK-2SO:user/DinahK-2SO/yolo-mode-next-publish
Open

Scope Yolo mode to the default agent provider #828
Dinah Xiaoman G (DinahK-2SO) wants to merge 8 commits into
microsoft:main from
DinahK-2SO:user/DinahK-2SO/yolo-mode-next-publish

Conversation

@DinahK-2SO

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Scopes automatic Yolo to the agent provider selected in Settings. Agent panes switched with /agent now enable the persisted preference only when their canonical provider matches the default; non-default providers actively reconcile off. Settings clears and disables Yolo for OpenCode, keeps Gemini conditional on workspace trust, and persists false when organization policy blocks Yolo.

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

SettingsModel 44/44; WTA Yolo 78/78; rebind 6/6; full WTA 2009 passed, 1 ignored; Terminal focused 6/6; ItE2E self-tests 24/24; exact package Yolo 6 passed, 1 policy-ACL skip; SettingsEditor and TestHost builds succeeded; 16 locale XML/BOM checks and deployment freshness passed.

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • In-repo Yolo design spec updated; no external docs PR.
  • Schema updated (if necessary)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 20:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Multiple .resw files have an outdated English <comment> for AIAgents_YoloOpenCodeWarning.Title that no longer matches the updated "OpenCode as Settings default forces Yolo off/disabled" behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Scopes "automatic Yolo" behavior to the Settings default agent provider, ensuring /agent-switched providers actively reconcile Yolo off unless they canonically match the default. This fits into the overall agent-pane/runtime-config pipeline by tightening how Terminal computes the desired Yolo state and how WTA applies it during rebinds and hot settings updates.

Changes:

  • Thread Yolo intent through agent rebind + hot-config events (including generation fencing / backward compatibility) so WTA applies the resolved Yolo state at the right time.
  • Normalize Settings behavior: OpenCode forces Yolo off/disabled; policy blocks persist agentPane.yoloMode=false; Gemini remains conditional; /agent stays scoped to default provider.
  • Add/extend UT + WTA tests + ItE2E coverage, plus spec and release-checklist updates.
File summaries
File Description
tools/wta/src/app_tests.rs Adds WTA regression tests covering Yolo application ordering and generation fencing during agent rebind.
tools/wta/src/app_events.rs Extends rebind wire payload to carry optional Yolo fields and applies them during rebind handling.
test/e2e/tests/Feature.YoloMode.Tests.ps1 Adds E2E coverage for default-provider-scoped Yolo across /agent, plus OpenCode/policy assertions.
test/e2e/selftests/ItE2E.Unit.Tests.ps1 Updates selftest expectations for the expanded Yolo feature suite structure.
test/e2e/README.md Updates suite table to reflect new Yolo coverage and case count.
src/cascadia/UnitTests_SettingsModel/CustomAgentAndPolicyTests.cpp Adds SettingsModel UTs for OpenCode unavailability and policy normalization behaviors.
src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl Adds Clear* APIs to normalize stored Yolo preference for policy/unavailable-default cases.
src/cascadia/TerminalSettingsModel/GlobalAppSettings.h Declares new Yolo normalization helpers.
src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp Implements effective Yolo gating + preference clearing for OpenCode default and policy blocks.
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw Updates Yolo strings and OpenCode warning copy.
src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw Updates pseudo-locale strings/comments for Yolo UX changes.
src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw Updates pseudo-locale strings/comments for Yolo UX changes.
src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw Updates pseudo-locale strings/comments for Yolo UX changes.
src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw Localizes updated Yolo strings / OpenCode warning message.
src/cascadia/TerminalSettingsEditor/MainPage.cpp Clears stored Yolo when saving Settings with an unavailable default provider.
src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.idl Exposes CanEnableAgentPaneYoloMode for UI enablement gating.
src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.h Declares CanEnableAgentPaneYoloMode.
src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.cpp Enforces availability/policy gating and clears stored Yolo when switching default providers.
src/cascadia/TerminalSettingsEditor/AIAgents.xaml Binds Yolo toggle enablement to CanEnableAgentPaneYoloMode.
src/cascadia/TerminalApp/TerminalPage.h Adds resolvers for default-provider-scoped automatic Yolo decisions.
src/cascadia/TerminalApp/TerminalPage.cpp Computes resolved Yolo per binding/rebind/hot-update; threads provider identity and per-tab scoping.
src/cascadia/TerminalApp/Tab.h Tracks current agent ID + whether the tab’s override should be scoped to default-provider Yolo.
src/cascadia/TerminalApp/FreOverlay.cpp Clears Yolo preference when FRE selects an unavailable default provider.
src/cascadia/TerminalApp/AppLogic.cpp Persists agentPane.yoloMode=false when policy blocks Yolo.
src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp Adds UTs for default-provider Yolo inheritance and hot-update binding behavior.
src/cascadia/inc/AgentRegistry.h Centralizes "Yolo unavailable for default agent" and updates notice logic.
doc/specs/Yolo-mode.md Updates Yolo design spec to default-provider-scoped behavior and policy normalization semantics.
doc/release-check-list.md Updates checklist language and adds a new /agent-scoped Yolo verification item.
Review details
  • Files reviewed: 39/39 changed files
  • Comments generated: 16
  • Review effort level: Lite

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

Comment thread src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw Outdated
Comment thread src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw Outdated
Copilot AI review requested due to automatic review settings September 3, 2026 20:18

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.

🔵 Needs a closer look

The change spans Terminal runtime behavior, Settings persistence/UI, WTA event wiring, localization, and E2E coverage, so it warrants final human review despite strong test updates.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.cpp:847

  • namespace Reg = ... is declared but never used in this function, which can trigger warnings and is unnecessary noise.
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Refresh the OpenCode translator comments, guard their semantics with a source selftest, and remove an unused namespace alias.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 20:43

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

The new resolver still enables automatic Yolo for some non-default-provider override paths (when both scopeToDefaultProvider and usesSettingsDefaultProvider are false), which conflicts with the stated goal/spec of scoping automatic Yolo to the Settings default provider only.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 39/39 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment on lines +2097 to +2100
}

return true;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional compatibility boundary, so I am not changing this branch. This PR scopes default-following and explicit /agent paths; profile backend, saved-layout restore, historical resume, and other non-/agent override owners are explicitly out of scope to avoid changing existing behavior. TestDefaultProviderYoloInheritance locks the (false, false) case, while doc/specs/Yolo-mode.md defines runtime provider selection for /agent. Leaving this thread open for maintainer review.

Comment thread test/e2e/selftests/ItE2E.Unit.Tests.ps1
Compare translator-comment coverage with the discovered locale directories instead of a fixed locale count.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 20:57

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

GlobalAppSettings::EffectiveAgentPaneYoloMode can report Yolo enabled even when AllowedAgents/AllowCustomAgents policy makes the effective default provider empty, which can produce inconsistent UI/runtime behavior under policy.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 39/39 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp Outdated
Use the policy-filtered default agent for effective Yolo state and Settings enablement while preserving the raw preference.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 21:23

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.

🔵 Needs a closer look

Settings save normalization currently omits clearing agentPane.yoloMode when policy blocks Yolo, which can transiently persist a policy-invalid value.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/cascadia/TerminalSettingsEditor/MainPage.cpp:902

  • SaveButton_Click normalizes Yolo for an unavailable default provider, but it doesn't also normalize when AllowYoloMode policy is currently blocking Yolo. That can allow saving a clone that still contains agentPane.yoloMode=true even though policy requires persisting false (until a later ReloadSettings pass corrects it). Clearing both cases before writing avoids persisting a policy-invalid value even transiently.
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Clear policy-blocked Yolo on the Settings clone before writing it and guard the save boundary with a source selftest.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 21:47

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.

🔵 Needs a closer look

Tab::AgentCurrentId is set optimistically during rebind_agent request emission, which can misrepresent the in-flight provider and lead to incorrect per-tab hot Yolo resolution.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/cascadia/TerminalApp/TerminalPage.cpp:2348

  • Tab::AgentCurrentId is used as the "actual current provider" input for _ResolveHotAutomaticYoloForAgentBinding (see the agent_config_changed Yolo path), but it’s being set here to the target binding.agentId before the helper has actually rebound. That can temporarily misrepresent the running provider during an in-flight rebind, and can cause hot Yolo updates to be computed for the wrong (not-yet-active) provider.

Consider only updating AgentCurrentId from authoritative status updates (e.g., OnAgentStatusChanged when state == "connected"), and avoid setting it on the outbound rebind request.

  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Leave the current provider unchanged until helper status confirms the rebind target, preventing hot Yolo updates from targeting an in-flight provider.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 22:12

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.

🔵 Needs a closer look

It changes high-impact Yolo/policy behavior across Terminal (C++), WTA (Rust), and E2E wiring, so a final human review is recommended despite strong test coverage.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/cascadia/TerminalApp/TerminalPage.cpp:2412

  • agent_config_changed now delivers Yolo updates as per-tab events where yolo_enabled is the resolved desired value for that tab’s current provider. Adding a short comment here would prevent future readers from assuming yoloEnabled is a single window-wide "global default" (especially since defaultAgentId is now part of the change detection).
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Document that hot Yolo events carry provider-resolved per-tab state rather than a window-wide default.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 22:28

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.

🔵 Needs a closer look

It changes security-sensitive Yolo behavior across SettingsModel, UI, Terminal↔WTA protocol wiring, and per-tab runtime reconciliation, warranting final human review despite strong test updates.

Review details
  • Files reviewed: 39/39 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort, defaults to Lite
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /