Thread PromptBindings through AgentInitCommand and NewCommand#18192
Thread PromptBindings through AgentInitCommand and NewCommand#18192JamesNK wants to merge 2 commits into
Conversation
- Add PromptBinding<string?> params for --skill-locations and --skills to PromptAndChainAsync and ExecuteAgentInitAsync so all prompts are controllable via CLI options in non-interactive mode. - Register --skill-locations and --skills options on InitCommand and NewCommand with Recursive=true so they propagate to subcommands. - Remove ParseResult parameter from ExecuteAgentInitAsync since bindings already capture whether an option was explicitly provided. - Make all PromptBinding params non-nullable (required) and remove default values from CancellationToken and selectByDefault parameters. - Simplify ShouldSkipBundleCatalogResolution to resolve from binding instead of branching on ParseResult presence. - Add integration tests for non-interactive --skill-locations/--skills on AgentInitCommand, InitCommand, and NewCommand. - Move CancellationToken to last parameter position consistently.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18192Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18192" |
There was a problem hiding this comment.
Pull request overview
This PR threads PromptBinding<string?> parameters for --skill-locations and --skills through AgentInitCommand.PromptAndChainAsync and ExecuteAgentInitAsync, making all prompts controllable via CLI options in non-interactive mode. It also simplifies ShouldSkipBundleCatalogResolution by removing the ParseResult-based branching in favor of unified binding resolution.
Changes:
- Add
--skill-locationsand--skillsoptions toInitCommandandNewCommand(sharing the option instances defined inAgentInitCommandwithRecursive = true), and convertPromptAndChainAsync/ExecuteAgentInitAsyncto accept explicit non-nullablePromptBinding<string?>parameters. - Reorder parameters to place
CancellationTokenlast consistently, including in theINewCommandPrompter.PromptForOutputPathinterface and all its implementations. - Add integration tests verifying
--skill-locations noneprevents skill installation and--skill-locations standard --skills <name>installs only the specified skill.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Cli/Commands/AgentInitCommand.cs | Make s_skillLocationsOption internal, add Recursive = true to both options, refactor PromptAndChainAsync/ExecuteAgentInitAsync/ShouldSkipBundleCatalogResolution signatures to use explicit bindings |
| src/Aspire.Cli/Commands/InitCommand.cs | Register --skill-locations option, create binding, update call to PromptAndChainAsync |
| src/Aspire.Cli/Commands/NewCommand.cs | Register both options, create bindings, update call to PromptAndChainAsync, reorder INewCommandPrompter.PromptForOutputPath params |
| src/Aspire.Cli/Templating/DotNetTemplateFactory.cs | Update call site for reordered PromptForOutputPath |
| src/Aspire.Cli/Templating/CliTemplateFactory.cs | Update call site for reordered PromptForOutputPath |
| tests/Aspire.Cli.Tests/Commands/AgentInitCommandTests.cs | Add new parameters to existing PromptAndChainAsync tests, add 2 new tests for --skill-locations/--skills |
| tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs | Add 2 new integration tests for --skill-locations/--skills |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Add 2 new integration tests for --skill-locations/--skills |
| tests/Aspire.Cli.Tests/TestServices/TestNewCommandPrompter.cs | Update PromptForOutputPath signature |
| tests/Aspire.Cli.Tests/Templating/DotNetTemplateFactoryTests.cs | Update PromptForOutputPath signature |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: CLI Version VerificationObjective: Verify locally-built CLI matches PR head commit Evidence:
Scenario 2:
|
| Scenario | Status | Notes |
|---|---|---|
| CLI Version Verification | ✅ Passed | Local build matches PR head |
| agent init --skill-locations none | ✅ Passed | No skills installed |
| agent init --skill-locations standard --skills aspire | ✅ Passed | Only specified skill |
| aspire new --skill-locations none | ✅ Passed | Options propagate via Recursive |
| agent init in existing project | ✅ Passed | Works in real project |
| Invalid --skill-locations | ✅ Passed | Clear error, exit 21 |
| Invalid --skills | ✅ Passed | Clear error, exit 21 |
| Unrecognized bundle skill | ✅ Passed | Clear error, exit 21 |
Overall Result
✅ PR VERIFIED
Observations
- All non-interactive
--skill-locationsand--skillsoptions work correctly - Options propagate to
aspire newtemplate subcommands viaRecursive = true - Invalid inputs produce clear, actionable validation errors with exit code 21
aspire inithas a pre-existing limitation: the AppHost Language prompt is not yet PromptBinding-enabled for non-interactive mode (unrelated to this PR)- Full CLI test suite (4099 tests) passes with 0 failures
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
❓ CLI E2E Tests unknown — 115 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #27456840465 |
Summary
Thread
PromptBinding<string?>parameters for--skill-locationsand--skillsthroughAgentInitCommand.PromptAndChainAsyncandExecuteAgentInitAsyncso all prompts are controllable via CLI options in non-interactive mode.Changes
PromptBinding<string?>params for--skill-locationsand--skillstoPromptAndChainAsyncandExecuteAgentInitAsyncso all prompts are controllable via CLI options in non-interactive mode.--skill-locationsand--skillsoptions onInitCommandandNewCommandwithRecursive = trueso they propagate to subcommands.ParseResultparameter fromExecuteAgentInitAsyncsince bindings already capture whether an option was explicitly provided.PromptBindingparams non-nullable (required) and remove default values fromCancellationTokenandselectByDefaultparameters.ShouldSkipBundleCatalogResolutionto resolve from binding instead of branching onParseResultpresence.CancellationTokento last parameter position consistently.--skill-locations/--skillsonAgentInitCommand,InitCommand, andNewCommand.Testing
All 4099 CLI tests pass locally (4073 succeeded, 26 skipped).