Skip to content

feat: agent tool parity, Tools panel and the tools-per-module rule (CLEAN-109) - #101

Merged
maksymhryzodub-prog merged 15 commits into
mainfrom
feat/CLEAN-109-agent-tool-parity
Sep 23, 2026
Merged

maksymhryzodub-prog merged 15 commits into
mainfrom
feat/CLEAN-109-agent-tool-parity

Conversation

@maksymhryzodub-prog

@maksymhryzodub-prog maksymhryzodub-prog commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Restores the Ranch philosophy that the console is a window and the chat is the hands: everything the admin console can do, the Ranch admin agent can now do through a tool, and a person can see those tools from the chat.

Ticket: CLEAN-109

Three parts (spec, plan and audit in specs/016-agent-tool-parity/):

  1. Parity. 93 new tools across 20 slice files, each beside the controller it mirrors and calling the same services: agents (stop/start/delete/status/env/logs/MCP list/capacity), workspace (files, secrets, channels, share link), templates (create/delete/attach MCP servers/restart fleet/git install/export), skills, LLM credentials, MCP servers and OAuth, knowledge bases and sources, settings (the tool description now carries a catalogue of every key), paddock, users, API keys, chats, usage, integrations, upgrade, Rancher status. 152 tools in total.
  2. Tools panel. A wrench beside the composer in the Rancher chat and on an agent's Chat tab opens a sheet: accordions per topic, search across topics, one click drops a starter prompt into the composer with the first «…» selected. GET /agents/:id/tools returns exactly what that agent's runtime would receive (one shared listing implementation with MCP tools/list). A new AgentToolListing row records what each pod was last told, so tools added after a pod started show "after restart" with a restart button.
  3. The rule. @Tool now requires topic, title and template, and a destructive tool a boolean confirm; the API refuses to boot otherwise. docs/agent-tools.md is the canonical rule, CLAUDE.md states it, the graft skill carries a pointer that scripts/ensure-agent-tools-rule.mjs re-inserts after graft init, and the new PR template asks for the parity check.

Decisions from the ticket discussion: full parity including users, keys and deletes (operator-only, confirm: true on 30 destructive tools); the panel shows the live per-agent list; existing tool names unchanged.

Test plan

  • cd api && NODE_OPTIONS=--experimental-vm-modules npx jest — 121 suites, 1592 tests green. Includes mcp/tool-metadata.spec.ts (loads every tool file and runs the boot-time validation) and mcp/tool-secrets.spec.ts (feeds every credential-taking tool a sentinel and asserts it never comes back; create_api_key is the documented exception).
  • cd api && bun run build clean; bun run generate:swaggercd admin && bun run build:api regenerated the SDK.
  • cd admin && bun test slices (13 new util tests) and npx nuxt typecheck clean.
  • Not run in this PR: the live walkthrough in specs/016-agent-tool-parity/quickstart.md §3–§6 (needs a running stack with a deployed Rancher agent). Please run it as part of review; §4 (after-restart marker) and §6 (parity prompts) are the two to watch.
  • Migration: api/prisma/migrations/20260922120000_agent_tool_listing (additive).

Checklist

  • Jira issue linked above; commits carry the CLEAN-<n> id
  • Console capability added or changed → agent tool added or changed, with a spec (docs/agent-tools.md)
  • Destructive tools take confirm; no secret is echoed in any tool result
  • User-visible app strings went through en.json; admin stays English-only
  • Client state follows docs/state.md (one entity, one store, render by id)

🤖 Generated with Claude Code

maksymhryzodub-prog and others added 15 commits September 22, 2026 15:49
…N-109)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every @tool declares topic, title and a starter template; the registry
refuses to boot without them, and a destructive tool must take a boolean
confirm. All 59 existing tools annotated; shared tool helpers in
mcp/tooling.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ogue (CLEAN-109)

GET /agents/:id/tools lists what the agent runtime would receive, grouped
by topic, with a per-tool "present in the running pod" flag from a new
AgentToolListing snapshot written on tools/list. The admin composer gets
a Tools button: accordions per topic, search, one-click starter
templates, "after restart" markers with a restart button.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
docs/agent-tools.md is the canonical rule (a module ships its agent tools
with tests); CLAUDE.md states it; the graft skill carries a fenced pointer
that scripts/ensure-agent-tools-rule.mjs re-inserts after graft init; the
PR template asks for the parity check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
93 new tools across 20 slices, each beside the controller it mirrors and
calling the same services: agents, workspace, templates, skills, LLM
credentials, MCP servers and OAuth, knowledge bases and sources, settings
(with a key catalogue), paddock, users, API keys, chats, usage,
integrations, upgrade and Rancher status. Operator-only tools are hidden
from plain agents, destructive ones require confirm: true, and a
cross-cutting spec proves no result carries a secret. A boot-equivalent
spec validates every tool file the way the registry does at start.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…underlines (CLEAN-109)

An untouched sheet opens the first topic; once the person collapses it,
the empty choice stays instead of reopening. The hover underline no longer
runs under the count and the after-restart badge.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…LEAN-109)

The button moves out of the composer: on the agent page it sits in the
header action row, on the Rancher page in the chat card header. The sheet
stays with the composer, which owns the draft; the store carries which
agent has it open.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…plate (CLEAN-109)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@maksymhryzodub-prog
maksymhryzodub-prog merged commit 733e755 into main Sep 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant