Skip to content

Show agent init warnings during skills selection - #21769

Merged
Ella Hathaway (ellahathaway) merged 2 commits into
mainfrom
ellahathaway-plugin-setup-feedback
Nov 5, 2026
Merged

Ella Hathaway (ellahathaway) merged 2 commits into
mainfrom
ellahathaway-plugin-setup-feedback

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Move the existing skill-source information, trust warning, and local Aspire skill warning above the aspire agent init skills picker, so they are visible while selecting Aspire instead of after confirming it. Keep the existing wording, formatting, and relative/~/ paths. Local-skill scan errors only block setup when Aspire is selected.

Fixes #21405

Condensed example with a project-local Aspire skill:

Before

Which skills and tools do you want to configure?
> [X] aspire
[Press Enter]

ℹ️ Skill sources:
   https://github.com/microsoft/aspire-skills
🚨 Only use sources you trust. Content from these sources can run code on your machine.

🚨 Local Aspire skill files may override plugin skills:
     .agents/skills/aspire/SKILL.md

After

ℹ️ Skill sources:
   https://github.com/microsoft/aspire-skills
🚨 Only use sources you trust. Content from these sources can run code on your machine.

🚨 Local Aspire skill files may override plugin skills:
     .agents/skills/aspire/SKILL.md

Which skills and tools do you want to configure?
> [X] aspire

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21769

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21769"

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

Preview preparation prematurely validates skill sources, blocking tools-only or MCP-only setup when unused Aspire sources are invalid.

1 open issue
1 file not reviewed
  • src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated file
What changed in this PR

This PR improves warning provenance and readability in aspire agent init, and extracts shared warning content for a future doctor integration.

Changes:

  • Displays source guidance and applicable local-skill warnings before interactive asset selection, using absolute configuration and skill paths.
  • Separates output blocks and shares official-source detection and warning formatting.
  • Updates localized resources, regression tests, snapshots, and configuration documentation.
File Description
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitCommandTests.AgentInit_WarnsAboutSelectedClientSourcesBeforeRegistration_agents=opencode.verified.txt Removes obsolete OpenCode warning snapshot.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitCommandTests.AgentInit_WarnsAboutSelectedClientSourcesBeforeRegistration_agents=copilot.verified.txt Removes obsolete Copilot warning snapshot.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitCommandTests.AgentInit_WarnsAboutSelectedClientSourcesBeforeRegistration_agents=copilot,claude,opencode.verified.txt Removes obsolete combined-client warning snapshot.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitCommandTests.AgentInit_WarnsAboutSelectedClientSourcesBeforeRegistration_agents=claude.verified.txt Removes obsolete Claude warning snapshot.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitCommandTests.AgentInit_PreSelectionWarnings.verified.txt Captures consolidated pre-selection warnings.
tests/​Aspire.Cli.Tests/​Commands/​AgentInitCommandTests.cs Tests warning timing, provenance, applicability, and escaping.
tests/​Aspire.Cli.Tests/​Commands/​AgentInitClientSelectionTests.cs Updates warning order and absolute-path expectations.
tests/​Aspire.Cli.Tests/​Agents/​SkillSourceTests.cs Tests configuration provenance and deduplication.
tests/​Aspire.Cli.Tests/​Agents/​LocalAspireSkillsTests.cs Tests sorted, unescaped absolute-path formatting.
src/​Aspire.Cli/​Utils/​ConfigurationHelper.cs Exposes loaded settings through a callback.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.zh-Hant.xlf Synchronizes Traditional Chinese localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.zh-Hans.xlf Synchronizes Simplified Chinese localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.tr.xlf Synchronizes Turkish localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.ru.xlf Synchronizes Russian localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.pt-BR.xlf Synchronizes Brazilian Portuguese localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.pl.xlf Synchronizes Polish localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.ko.xlf Synchronizes Korean localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.ja.xlf Synchronizes Japanese localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.it.xlf Synchronizes Italian localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.fr.xlf Synchronizes French localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.es.xlf Synchronizes Spanish localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.de.xlf Synchronizes German localization resources.
src/​Aspire.Cli/​Resources/​xlf/​AgentCommandStrings.cs.xlf Synchronizes Czech localization resources.
src/​Aspire.Cli/​Resources/​AgentCommandStrings.resx Revises warnings and configuration-result wording.
src/​Aspire.Cli/​Resources/​AgentCommandStrings.Designer.cs Updates resource accessors and associated documentation.
src/​Aspire.Cli/​Commands/​InitCommand.cs Reuses shared official-plugin detection.
src/​Aspire.Cli/​Commands/​AgentInitCommand.cs Moves warnings before selection and separates output blocks.
src/​Aspire.Cli/​Agents/​AspireSkills/​SkillSource.cs Adds source provenance and official-asset detection.
src/​Aspire.Cli/​Agents/​AspireSkills/​LocalAspireSkills.cs Adds reusable plain-text warning formatting.
docs/​specs/​cli-config-sources.md Documents warning provenance, timing, and layout.

Review effort: Balanced

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

Eager source resolution can block independent asset selection, repository warnings can misidentify environment-configured sources, and warning persistence lacks regression coverage.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Cover warning persistence after the skills picker closes

src/​Aspire.Cli/​Commands/​AgentInitCommand.cs:392

The new tests do not verify that warnings remain in terminal history after the interactive skills picker closes, leaving this persistence behavior without regression coverage. Extend AgentInitCommand_DefaultSelection_RegistersRemotePlugin in tests/Aspire.Cli.EndToEnd.Tests/AgentCommandTests.cs with a configured source and a local Aspire skill copy. Assert that the warnings and absolute paths appear before selection and remain after the picker closes.

Medium severity Show effective skill source when environment variables override defaults

src/​Aspire.Cli/​Commands/​AgentInitCommand.cs:849

SkillSource.Resolve still consumes environment variables, so the absence of a file-defined skillSources section does not imply that the built-in repository is being used. For example, with skillSources__default__repository=example/team and no skillSources in either settings file, this warning directs the user to review microsoft/aspire-skills, but selecting Aspire registers example/team. Report the effective repository/catalog URLs or environment provenance in this case, and reserve the official-URL fallback for the actual built-in source.

1 file not reviewed
  • src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

This comment has been minimized.

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 updated warning breaks two existing E2E assertions, while eager source validation can abort interactive setup before users can opt out of Aspire and configure unrelated tools.

3 open issues
1 file not reviewed
  • src/Aspire.Cli/Resources/AgentCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

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 warnings still omit contributing configuration file paths for skillSources and render conflicting paths as relative or ~/ entries with extra indentation, leaving users unable to identify the relevant files unambiguously.

4 open issues
1 resolved since last review

Review effort: Balanced

@github-actions

This comment has been minimized.

@ellahathaway
Ella Hathaway (ellahathaway) force-pushed the ellahathaway-plugin-setup-feedback branch from 600a490 to 23d2bfa Compare November 4, 2026 23:17
@ellahathaway Ella Hathaway (ellahathaway) changed the title Improve agent init warning provenance and readability Show agent init warnings during skills selection Nov 4, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 4, 2026 23: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.

🟡 Changes recommended

Interactive initialization aborts on invalid skill sources or unreadable local skills before users can deselect Aspire, blocking otherwise unrelated tools-only or MCP-only configuration.

5 open issues

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Display the existing skill-source information, trust warning, and local Aspire skill warning before confirming the skills picker. Preserve the existing wording and display paths.

Co-authored-by: Copilot App <[email protected]>
@ellahathaway
Ella Hathaway (ellahathaway) force-pushed the ellahathaway-plugin-setup-feedback branch from 23d2bfa to 6641860 Compare November 5, 2026 00:49
@ellahathaway
Ella Hathaway (ellahathaway) marked this pull request as ready for review November 5, 2026 00:50
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 5, 2026 00:51
@github-actions

This comment has been minimized.

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

Invalid skill-source settings can throw before the interactive picker opens, blocking MCP-only or tools-only setup even when Aspire would be deselected.

4 open issues
1 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Tests selector

2 / 101 PR test projects · 4 PR jobs, from 3 changed files.

Selected PR test projects (2 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/AgentCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/AgentInitClientSelectionTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Commands/AgentInitCommand.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit e84f6f5.

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.

🟢 Approval recommended

No active review issues are reported for the warning-placement and selection-dependent error-handling changes.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed e84f6f5. No new high-confidence issues found.

Validation:

  • Focused AgentInitClientSelectionTests and AgentInitCommandTests: 224 passed locally.
  • Matching-head CLI E2E AgentCommandTests job: 10 passed, 0 failed, 0 skipped.

@ellahathaway
Ella Hathaway (ellahathaway) merged commit ea9b986 into main Nov 5, 2026
427 of 430 checks passed
Ella Hathaway (ellahathaway) added a commit that referenced this pull request Nov 5, 2026
## Description

Static Aspire skill files can take precedence over skills supplied by
agent plugins. `aspire doctor` now points out those files and suggests
deleting them, then running `aspire agent init --skills aspire`.

The check uses the same discovery as `aspire agent init` and checks both
project and global locations. It only reports what it finds: it does not
delete files, create backups, change registrations, or install skills.

Both output formats share the same warning message and `files` list,
using workspace-relative and `~/` paths with absolute fallback outside
both roots. JSON keeps `metadata.workspaceRoot` as context. There is no
separate `details` field or repeated file list for this warning.

Related to #19726. Depends on #21769.

### Examples

Terminal warning, from the output regression snapshot:

```text
AppHost
  🚨 Local Aspire skill files may override plugin skills
       Delete these files, then run 'aspire agent init --skills aspire'.
       Files:
         .agents/skills/aspire/SKILL.md
         ~/.agents/skills/aspire/SKILL.md
```

The matching JSON check, with an example workspace root:

```json
{
  "category": "apphost",
  "name": "aspire-skill-sources",
  "status": "warning",
  "message": "Local Aspire skill files may override plugin skills",
  "fix": "Delete these files, then run 'aspire agent init --skills aspire'.",
  "files": [
    ".agents/skills/aspire/SKILL.md",
    "~/.agents/skills/aspire/SKILL.md"
  ],
  "metadata": {
    "workspaceRoot": "C:\\Users\\dev\\src\\my-app"
  }
}
```

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [ ] No
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [ ] No
  - [x] No

---------

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b0dbbde1-69ad-48f0-acf6-9b8a33672808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire agent init: provide a cohesive final configuration report

3 participants