Add profile-scoped command palette agents - #488
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Not ready to approve
Profile commandPaletteAgent values that aren’t recognized/allowed can currently disable delegation entirely instead of falling back to the global delegate agent.
Pull request overview
This PR adds a new inheritable, profile-scoped setting to control which AI agent (and execution environment: host vs WSL) is used for command palette delegation (?<prompt> and interactive delegation), and threads that selection through Settings UI, schema/docs, and the WTA delegate launcher to enforce strict source selection without environment fallback.
Changes:
- Add
commandPaletteAgentas an inheritable profile setting (IDL + settings macro), cover inheritance/clearing in unit tests, and document it in the profiles schema + README. - Update Terminal to resolve delegation agent/source from the active pane’s profile and pass an explicit
--delegate-source/--delegate-wsl-distrointowta delegate. - Update WTA delegate flow to parse/validate explicit delegate source selection and adjust WSL auto-routing vs explicit-source behavior, with new unit tests.
File summaries
| File | Description |
|---|---|
| tools/wta/src/main.rs | Adds explicit delegate source parsing and uses it to select strict host/WSL launch behavior during delegation. |
| tools/wta/src/cli_tests.rs | Adds unit tests for the new delegate-source argument parsing and source selection logic. |
| src/cascadia/UnitTests_SettingsModel/ProfileTests.cpp | Extends profile inheritance tests to include commandPaletteAgent. |
| src/cascadia/TerminalSettingsModel/Profile.idl | Introduces inheritable CommandPaletteAgent on the Profile model. |
| src/cascadia/TerminalSettingsModel/MTSMSettings.h | Adds commandPaletteAgent JSON key to the profile settings macro list. |
| src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw | Adds localized strings for the new “Command palette agent” profile setting. |
| src/cascadia/TerminalSettingsEditor/Resources/de-DE/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/es-ES/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/fr-FR/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/it-IT/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/ja-JP/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/ko-KR/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/pt-BR/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/ru-RU/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/sr-Cyrl-RS/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/uk-UA/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/zh-CN/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/zh-TW/Resources.resw | Localization for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-ploc/Resources.resw | Pseudo-loc entries for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-ploca/Resources.resw | Pseudo-loc entries for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/Resources/qps-plocm/Resources.resw | Pseudo-loc entries for the new profile setting strings. |
| src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl | Exposes CommandPaletteAgentList and CurrentCommandPaletteAgent in the editor VM contract. |
| src/cascadia/TerminalSettingsEditor/ProfileViewModel.h | Adds backing members and method declarations for the new command palette agent picker. |
| src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp | Implements building both agent lists (pane backend + command palette agent) using filtered registries. |
| src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml | Adds the profile General settings UI for selecting the command palette agent. |
| src/cascadia/TerminalApp/TerminalPage.cpp | Resolves delegation agent/source from the active profile and passes explicit wta delegate source arguments. |
| README.md | Documents the new “Command palette agent” profile setting behavior. |
| doc/cascadia/profiles.schema.json | Adds schema entry for commandPaletteAgent including strictness semantics and pattern validation. |
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Human review recommended
It spans coordinated changes across Rust CLI behavior, C++ settings/model/UI plumbing, schema, and localization, and should get a final human pass for end-to-end UX/policy correctness.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
There was a problem hiding this comment.
⚠️ Not ready to approve
The qps-* pseudo-locale resource entries for the new setting are inconsistent with the surrounding pseudo-localized strings and include an anomalous {Locked=...} comment marker, so localization should be corrected before approval.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 3
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
✅ Ready to approve
The changes appear coherent and well-tested, with only a minor diagnostics wording nit noted.
Note: this review does not count toward required approvals for merging.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Not ready to approve
Profile-scoped delegation currently clears the global delegateModel for explicit commandPaletteAgent selections, which makes delegate launches ignore the configured delegate model.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
✅ Ready to approve
The changes consistently implement the new profile-scoped delegation setting across model/schema/UI and enforce the intended strict delegate source semantics with accompanying tests.
Note: this review does not count toward required approvals for merging.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 0 new
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Not ready to approve
It introduces a sensitive logging issue in wta delegate (logging full agent commandlines) and has a misleading delegation abort message that should be corrected before approval.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 2
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Not ready to approve
The WSL delegate born-bound session registration can record a Windows --cwd as the CWD for a WSL session when the active pane is not WSL, which is incorrect and should be filtered/omitted.
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
⚠️ Not ready to approve
CLI validation currently treats an explicitly-provided empty/whitespace --delegate-wsl-distro as “not supplied,” which can silently bypass intended strict argument validation and needs fixing with accompanying tests.
Review details
Comments suppressed due to low confidence (1)
tools/wta/src/main.rs:2247
- Similarly,
--delegate-source host --delegate-wsl-distro ""currently passes validation because empty/whitespace is treated as absent. It should error whenever--delegate-wsl-distrois present with a non-WSL source, regardless of value.
Some(source) if source.eq_ignore_ascii_case(AgentSource::HOST_KIND) => {
anyhow::ensure!(
wsl_distro.map(str::trim).filter(|distro| !distro.is_empty()).is_none(),
"--delegate-wsl-distro is invalid with --delegate-source host"
);
- Files reviewed: 28/28 changed files
- Comments generated: 2
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
There was a problem hiding this comment.
⚠️ Human review recommended
It introduces cross-cutting behavioral changes across the settings model, Settings UI, Terminal delegation launch, and WTA CLI/source routing that warrant final human validation (especially around policy/WSL edge cases).
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 0 new
- Review effort level: Low
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Port profile-scoped delegate routing onto the refactored WTA CLI modules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b0a2b53-dbbe-4b64-b09b-6c5b6d5e084a
| assert!(cli::delegate::delegate_launchable_for_target(true, false)); | ||
| assert!(cli::delegate::delegate_launchable_for_target(true, true)); | ||
| } | ||
| // `wta delegate`'s own launchability semantics (explicit |
@check-spelling-bot Report
|
| Dictionary | Entries | Covers | Uniquely |
|---|---|---|---|
| cspell:csharp/csharp.txt | 32 | 2 | 2 |
| cspell:aws/aws.txt | 232 | 2 | 2 |
| cspell:fonts/fonts.txt | 536 | 1 | 1 |
Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):
"cspell:csharp/csharp.txt",
"cspell:aws/aws.txt",
"cspell:fonts/fonts.txt",
To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):
"check_extra_dictionaries": []Warnings ⚠️ (1)
See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.
| Count | |
|---|---|
| 54 |
See
✏️ Contributor please read this
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
- ... misspelled, then please correct them instead of using the command.
- ... names, please add them to
.github/actions/spelling/allow/names.txt. - ... APIs, you can add them to a file in
.github/actions/spelling/allow/. - ... just things you're using, please add them to an appropriate file in
.github/actions/spelling/expect/. - ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in
.github/actions/spelling/patterns/.
See the README.md in each directory for more information.
🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
There was a problem hiding this comment.
🟢 Ready to approve
Changes are consistent across settings model/editor/WTA routing, include targeted new tests, and align with the stated strict-selection behavior without introducing obvious correctness issues in the modified code paths.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
- Files reviewed: 30/30 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Summary
commandPaletteAgentprofile setting and expose it as Command palette agent in profile General settings.delegateModelcontinues to apply.wta delegatecalls that omit--delegate-sourcedefault to the Windows host.Builds on #481.
Testing
cargo test --manifest-path tools\wta\Cargo.tomlcargo build --target x86_64-pc-windows-msvc --manifest-path tools\wta\Cargo.tomlbcz no_cleanbzSettingsModel.Unit.Tests.dll /name:*ProfileTests::AgentPaneBackendDefaultsAndInherits*bxinsrc\cascadia\CascadiaPackage