Repository navigation
feat: ship kagent 1.x skills bundle in the tools OCI image - #91
Conversation
Make the kagent-tools image usable as a kagent 1.x Agent Plugin source: - /opt/kagent-tools: full bundle (stdio MCP server, kubectl, helm, istioctl, kubectl-argo-rollouts, cilium, kubeconfig, skills) - /opt/kagent-tools-skills: skills-only root for use with the Helm-deployed server - seven SKILL.md skills, one per tool provider - legacy /tool-server and /bin/* paths preserved as symlinks - env fallbacks (KAGENT_TOOLS_TOOLS, KAGENT_TOOLS_READ_ONLY, KAGENT_TOOLS_DEFAULT_KUBECONFIG); kubeconfig exported to all CLIs - stdio mode keeps stdout clean (trace exporter writes to stderr) - plugin bundle/image tests, make plugin-verify, CI job, docs Co-authored-by: Copilot App <[email protected]> Signed-off-by: Dmytro Rashko <[email protected]>
golangci-lint v2.13.2 cannot load Go 1.27 export data, so the lint pin moves with the toolchain. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Dmytro Rashko <[email protected]>
- track plugin/mcp.json (a global **/mcp.json ignore had dropped it) - docs: omit apiGroup on RemoteMCPServer refs (kagent CEL rejects it) - share logger.UseStderrEnv/UseStderr instead of repeated literals - move env export out of run() into tested applyServerEnvironment, propagating Setenv errors - generic decodeStrict without any; KUBECONFIG constant - image test: resolve root symlinks, assert /usr/bin legacy links - verify script runs /tool-server, /bin/kubectl and /bin/helm Co-authored-by: Copilot App <[email protected]> Signed-off-by: Dmytro Rashko <[email protected]>
There was a problem hiding this comment.
🤖 written by AI, but I extensively reviewed and vetted every suggestion/comment. 🤖
Thanks for putting this together. Shipping the skills inside the tools image is a nice way to keep skills and tool names in step. I checked it against current kagent and left some comments. Each one has a suggested change, and I applied all of them together on top of this branch to check them: go test -tags=test ./pkg/... ./internal/... ./cmd/..., make lint and make plugin-verify all pass.
The main point: kagent's plugin loader applies its 100 MiB package limit to mounted OCI images too (maxPackageBytes in go/core/pkg/agentplugins/materialize.go in kagent-dev/kagent). I ran that loader (agentplugins.Materialize, kagent main at d9cc3a82) against this branch's image, unpacked:
opt/kagent-tools: REJECTED: validate mounted artifact: artifact exceeds 104857600 bytes
opt/kagent-tools-skills: ACCEPTED (k8s-troubleshooting/SKILL.md copied)
So the skills-only root, plus the tool server deployed by the Helm chart, is the path that works today. Most of the comments follow from that.
Also, could you drop docs/superpowers/? Those plan and spec files don't belong in the repo, and docs/kagent-skills.md already covers the user-facing content.
- prometheus: read PROMETHEUS_URL as the default endpoint for all tools - skills: align arguments with real tool schemas (cilium node_name and ids, istio pod discovery and istio-proxy access log, argo container=image, kubescape manifest_name, k8s previous logs) and drop the LLM-backed prometheus_promql_tool reference - docs/README: lead with the skills-only root that works on kagent 1.x today, add modelConfig and an explicit tools list to AgentTemplates, mark the full root as needing a future kagent release - Dockerfile: plugin stage only assembles small files on wolfi-base; the final image has three content layers ordered by change frequency (CLIs, plugin files, Go server) so a code or skill change does not re-ship the CLI layer - tests: validate skill `arg: value` references against tool input schemas, deny LLM-backed tools in skills, lint the guide's AgentTemplates (modelConfig, binding kind, <=50 tools, pinned digest, tool coverage) - remove docs/superpowers design notes Co-authored-by: Copilot App <[email protected]> Signed-off-by: Dmytro Rashko <[email protected]>
|
Thanks for the thorough review, @danielle-mustillo. Every item is addressed in cc1e04e, and all threads are resolved. Review items
Same-class fixes found by sweeping the other skills
New guards, so these classes fail CI
Follow-ups (pre-existing issues, out of scope here): #92 chart env vars nothing reads · #93 LLM-backed tools registered without an LLM · #94 |
|
Thanks, every review item is fixed. I filed #97 as a follow-up, not a blocker: publish the skills-only root as its own small image, so an Agent that mounts it doesn't pull the whole tools image. |
Summary
Makes the kagent-tools image usable as a kagent 1.x Agent Plugin (OCI image source), bundling every CLI tool plus skills.
Image layout
/opt/kagent-tools— full bundle: stdio MCP server (plugin.json+mcp.json),kubectl,helm,istioctl,kubectl-argo-rollouts,cilium, plugin kubeconfig, skills/opt/kagent-tools-skills— skills-only root, for use alongside the Helm-deployed server/tool-serverand/bin/*preserved as symlinks (Helm chart unchanged)Changes
plugin/skills/(k8s, helm, istio, argo rollouts, cilium, kubescape, prometheus)KAGENT_TOOLS_TOOLS,KAGENT_TOOLS_READ_ONLY,KAGENT_TOOLS_DEFAULT_KUBECONFIG; resolved kubeconfig exported to all CLIscmd/plugin_bundle_test.go(manifests, frontmatter, every skill-referenced tool is registered),cmd/plugin_image_test.go(mirrors kagentvalidatePackage)make plugin-verify+plugin-verifyCI jobdocs/kagent-skills.md, README, AGENTS.md; design + plan underdocs/superpowers/Known limitation
kagent's current 100 MiB per-package limit rejects the full root (~546 MiB). The skills-only root works on current kagent. The full root needs an upstream kagent change exempting platform-mounted OCI packages (Task 0 in the plan). The bundled MCP server is only started by the Go ADK harness.
Testing
make test-only✅,go vet✅, golangci-lint v2.15.0 ✅ (pinned v2.13.2 can't load Go 1.27 export data — pre-existing)make plugin-verify✅ (layout check + stdiotools/listsmoke test)Toolchain