feat(toolboxes): support skills on toolbox versions#8396
Conversation
Adds the skills field to ToolboxVersionObject and CreateToolboxVersionRequest, plumbed through: - toolbox create --from-file: accepts an optional skills[] block. - toolbox skill add/remove/list: post-creation mutation subgroup (no dedicated REST endpoint; each mutation publishes a new immutable version via createToolboxVersion). skill remove allows removing the last skill (skills are optional content). - connection add/remove: carry forward existing skills verbatim into new versions. - toolbox show / toolbox version list: surface skill count + per-skill table.
There was a problem hiding this comment.
Pull request overview
Adds “skills” support to the azure.ai.toolboxes extension so toolbox versions can reference Foundry Skills (create-time via --from-file, plus new toolbox skill add/remove/list verbs), and surfaces skill counts/details in listing/show commands.
Changes:
- Extends Foundry toolbox version request/response models to include
skills. - Adds
azd ai toolbox skill {add,remove,list}commands with local validation + tests. - Propagates skills across connection add/remove version publishing; updates
showandversion listoutput to include skill info.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.toolboxes/internal/pkg/azure/foundry_toolsets_client.go | Adds Skills to toolbox version create request + version response models. |
| cli/azd/extensions/azure.ai.toolboxes/internal/exterrors/codes.go | Adds new validation/error codes for skill operations. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_version_list.go | Adds skills_count to JSON output and SKILLS column to table output. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill.go | New helpers for parsing/validating skill specs and building wire entries. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_verbs_test.go | New tests covering skill add/remove/list flows and edge cases. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_test.go | Unit tests for skill parsing, entry building, and duplicate detection. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_remove.go | Implements toolbox skill remove (publishes new version + promotes default). |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_list.go | Implements toolbox skill list and row extraction for output. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_group.go | Adds toolbox skill command group and shared list helpers. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_skill_add.go | Implements toolbox skill add (publishes new version + promotes default). |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_show.go | Surfaces skill count and renders a skills table in toolbox show. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_help.go | Updates --from-file shape docs to include skills. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_files.go | Extends create-file shape with skills; improves parse error suggestions. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_create.go | Accepts skills[] from create file and validates duplicates. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_connection_remove.go | Carries skills forward when publishing a version during connection removal. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_connection_add.go | Carries skills forward when publishing a version during connection addition. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_commands_test.go | Adds tests for skills-from-file and skills carry-forward semantics. |
| cli/azd/extensions/azure.ai.toolboxes/internal/cmd/root.go | Registers the new toolbox skill command group. |
Replace strings.IndexByte/slicing with strings.Cut in parseSkillFlag, and string-append loops with strings.Builder in the over/exactly-64-chars tests. CI enforces these via 'go fix ./...'.
- parseSkillFlag now trims the name portion after splitting on '@' so input like 'my-skill @2' yields Name:'my-skill' instead of leaving a trailing space (which would break duplicate / remove lookups). - runSkillRemoveWith normalizes skillName with TrimSpace at the top, mirroring validateSkillName's internal trim so a user input of ' beta ' matches the canonical stored entry. - toolbox show skills table reuses extractSkillRows so malformed entries are skipped consistently with skill list. - toolbox create file parse-error hint points users at 'skill add' / 'skill remove' instead of implying create-time is the only way to attach skills.
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
trangevi
left a comment
There was a problem hiding this comment.
Blocking this PR while I get some clarity on the API surface
Addresses two open review comments on PR #8396: - therealjohn: drop the 'in v1' phrasing from user-facing strings; it's not a CLI versioning concern, it's a service-side constraint. - trangevi: support batching on mutation verbs so users don't churn versions one item at a time: - toolbox connection remove: variadic positionals (one or many connection names). - toolbox skill add: gains a --from-file mode (skills[] block) alongside the single positional. - toolbox skill remove: variadic positionals. Each invocation publishes exactly one new toolbox version covering the whole batch. Also tightens internal docs to drop a few TypeSpec-name leaks (buildSkillEntry, the parse-error suggestion text) so the verb files don't reach for terms users won't recognize.
… publish Addresses trangevi's review on PR #8396: toolboxes are shared resources, so a connection-add or skill-mutation should not silently redirect every other consumer to the new version. The PATCH that promotes a version is now a deliberate user gesture via the new toolbox publish verb. - connection add, connection remove, skill add, skill remove: drop the SetDefaultVersion call after publishing a new toolbox version. - Rename toolbox update <name> --default-version <v> to toolbox publish <name> <version> (positional shape matches trangevi's wording). - Mutation success messages now say 'Published toolbox <name> version <v>' and append 'The default version is unchanged; run azd ai toolbox publish ... to promote.' - All error suggestions and help text that mentioned 'toolbox update --default-version' now point at 'toolbox publish'. - Drop two error codes that are no longer reachable (CodeMissingUpdateField, CodeSetDefaultVersionFailed). - Tests: invert setDefaultCalls length-1 assertions to assert.Empty, replace runToolboxUpdate test with the equivalent for runToolboxPublish, update the delete-suggestion substring check.
…ename to publish Reverts only the verb rename from PR review comment #4. The behavior change (no auto-promote default on mutation verbs) and the help/error/success-message rewording stay. Rationale: toolbox update --default-version <v> is a superset of a hypothetical publish <v> (extensible to future patchable fields). It also parallels azure.ai.skills' skill update --set-default-version, which keeps the two extensions visually consistent. Behavior unchanged from previous commit: - connection add/remove, skill add/remove still publish new versions without promoting. - All mutation success messages still tell the user the default is unchanged and point at the explicit promote step (now spelled 'azd ai toolbox update <name> --default-version <v>'). - Help text on root.go, connection group, skill group, connection add, skill add all reflect 'default unchanged' semantics. Restores: toolbox_update.go, runToolboxUpdate, toolboxUpdateFlags, CodeMissingUpdateField, TestRunToolboxUpdate_MissingDefaultVersion. Removes: toolbox_publish.go and its newToolboxPublishCommand.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (2)
cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_help.go:61
- The help text points users to
azd ai agent connection list, but the connections command isazd ai connection list(and other suggestions in this extension already use that). Update the referenced command so users aren’t sent to a non-existent subcommand.
skills Optional. Existing project skills to attach by reference.
Each entry needs 'name'; 'version' is optional (omit to
follow the skill's default version).
Project connections must already exist on the Foundry project; this command
does not create them. Run 'azd ai agent connection list' to see available
connections.`
cli/azd/extensions/azure.ai.toolboxes/internal/cmd/toolbox_help.go:100
- The help text points users to
azd ai agent connection list, but the connections command isazd ai connection list(and other suggestions in this extension already use that). Update the referenced command so users aren’t sent to a non-existent subcommand.
The toolbox's existing description is carried forward unchanged; the
description is set at create time and cannot be changed later.
Project connections must already exist on the Foundry project; this command
does not create them. Run 'azd ai agent connection list' to see available
connections.`
- parseSkillFlag / validateNoDuplicateSkills error messages and suggestions no longer reference a non-existent --skill flag (skills are positional or in skills[] of --from-file). - runConnectionRemoveWith now trims whitespace from each connection name (parity with skill remove). User input ' foo ' now matches the stored entry. - Root, connection group, and skill group help text now show the full 'azd ai toolbox update <toolbox> --default-version <version>' form so it's copy-pastable.
Signed-off-by: trangevi <trangevi@microsoft.com>
…oolbox. `update` can be added back if toolboxes ever become mutable. This provides consistency with other UX experience Signed-off-by: trangevi <trangevi@microsoft.com>
|
/check-enforcer override |
Summary
Adds
skillssupport on toolbox versions, per the new optional field onToolboxVersionObject/CreateToolboxVersionRequestin the Foundry spec. Follow-up to #8322.Changes
internal/pkg/azure:Skills []map[string]anyonCreateToolboxVersionRequest(omitempty) andToolboxVersionObject(always serialized, matching service behavior).[]map[string]anykeeps futureToolboxSkilldiscriminator variants forward-compatible.internal/cmd/toolbox_skill.go: name validator (mirrorsazure.ai.skills' regex, documented),parseSkillFlag,buildSkillEntry,validateNoDuplicateSkills.toolbox create --from-file: optionalskills[]block in the input file.toolbox skill add | remove | list: new subgroup. Each mutation publishes a new immutable toolbox version viacreateToolboxVersion; no dedicated REST endpoint exists.skill removeallows removing the last skill (skills are optional content, unlike connections).connection add/connection remove: carry skills forward verbatim into the new version.toolbox show/toolbox version list: surface skill count and a per-skill table /skills_countcolumn.Validation
createskills-from-file path, carry-forward on connection add/remove, and all three skill verbs.skill remove→ empty list →skill addrepublishes. FullTest_CLI_Toolbox_Smokeflow green.