feat: add 'docker agent debug skills' command#2881
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The docker agent debug skills command is a clean, well-structured addition that mirrors the existing debug toolsets command. The implementation correctly:
- Walks agent toolsets and type-asserts to
*skillstool.ToolSetusingtools.As - Handles the nil/empty case with a clear "No skills" message
- Annotates fork-context skills with the
[forked]marker - Properly tracks telemetry with
TrackCommand/TrackCommandErrorfollowing the established pattern - Defers
stopToolSetsfor cleanup, consistent with other debug subcommands
Tests cover both the empty-skills path (no_tools.yaml) and the local-discovery path (plain + forked skills), and the new skills_local.yaml fixture follows the same structure as existing fixtures.
No bugs found in the changed code.
aheritier
left a comment
There was a problem hiding this comment.
Test - single comment on debug.go
|
|
||
| if skillsToolset == nil || len(skillsToolset.Skills()) == 0 { | ||
| out.Printf("No skills for %s\n", agent.Name()) | ||
| continue |
There was a problem hiding this comment.
Test comment on Skills() guard line
| @@ -0,0 +1,7 @@ | |||
| agents: | |||
| @@ -0,0 +1,7 @@ | |||
| agents: | |||
| root: | |||
| @@ -0,0 +1,7 @@ | |||
| agents: | |||
| root: | |||
| model: openai/gpt-3.5-turbo | |||
| agents: | ||
| root: | ||
| model: openai/gpt-3.5-turbo | ||
| description: A helpful AI assistant |
| root: | ||
| model: openai/gpt-3.5-turbo | ||
| description: A helpful AI assistant | ||
| instruction: | |
| model: openai/gpt-3.5-turbo | ||
| description: A helpful AI assistant | ||
| instruction: | | ||
| You are a knowledgeable assistant. |
| description: A helpful AI assistant | ||
| instruction: | | ||
| You are a knowledgeable assistant. | ||
| skills: true |
aheritier
left a comment
There was a problem hiding this comment.
Test line-based comment
| description: A helpful AI assistant | ||
| instruction: | | ||
| You are a knowledgeable assistant. | ||
| skills: true |
| } | ||
| } | ||
|
|
||
| if skillsToolset == nil || len(skillsToolset.Skills()) == 0 { |
| continue | ||
| } | ||
|
|
||
| loadedSkills := skillsToolset.Skills() |
aheritier
left a comment
There was a problem hiding this comment.
The implementation is correct, idiomatic, and follows existing conventions closely. tools.As[T] correctly handles wrapped toolsets, telemetry hooks match every other debug subcommand exactly, and t.Setenv is correctly used without t.Parallel() in the local-skills test. Two minor suggestions worth addressing before merge:
1. Skills() called twice — see inline comment on runDebugSkillsCommand.
2. skills_local.yaml missing version: field — see inline comment on the new fixture.
No blocking issues. Everything else (alphabetical ordering, stopToolSets defer, variable rename tools → agentTools) is well done.
| continue | ||
| } | ||
|
|
||
| loadedSkills := skillsToolset.Skills() |
There was a problem hiding this comment.
Skills() is called twice: once in the nil || len(...) guard on the line above, and again here to bind loadedSkills. The method returns the struct's internal slice so both calls are safe, but it's redundant. Capturing the result once makes intent clearer and removes the double call:
var loadedSkills []skills.Skill
if skillsToolset != nil {
loadedSkills = skillsToolset.Skills()
}
if len(loadedSkills) == 0 {
out.Printf("No skills for %s\n", agent.Name())
continue
}| description: A helpful AI assistant | ||
| instruction: | | ||
| You are a knowledgeable assistant. | ||
| skills: true |
There was a problem hiding this comment.
Every other fixture in e2e/testdata/ includes a version: field (e.g. version: "2"). The loader defaults gracefully via cmp.Or, so this works, but the omission is inconsistent and may surprise future contributors. Consider adding version: "9" (current latest) to match the rest.
This adds a mirror of the existing
docker agent debug toolsetscommand, providing introspection into the skills wired into each agent. Users can now rundocker agent debug skillsto see which skills are available to an agent, including their descriptions and whether they run in a forked context.The implementation adds a
skillssubcommand to the debug command that looks up the*skillstool.ToolSetamong each agent's toolsets and prints the skill name, a[forked]marker forcontext: forkskills, and the skill description. When an agent has no skills, it emits a clear empty message.New tests cover both agents with no skills and agents with locally-discovered skills (both plain and forked variants), ensuring the feature works across different configurations.