Skip to content

docs(claude): fix subagent and skill examples that cite deleted agents/paths - #4326

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:claude/claude-agents-deleted-paths
Sep 26, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:claude/claude-agents-deleted-paths

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Subagent definitions and the GitHub-reply skill told coding sessions to go find CodeAgent, JiraAgent, SDAgent, MedicalIntakeAgent, blender_mcp_server.py, and tests/test_cli.py — all deleted — and gaia-agent-builder.md presented its example under a "verified against the tree" header, the most damaging kind since sessions copy it as a convention. The GitHub-reply skill's own worked example also told a reporter GAIA has no Slack integration and pointed at the deleted Jira agent, even though gaia slack ships today.

Every stale reference is swapped for a live one (GaiaAgent, ChatAgent, hub/agents/hello-world, gaia.connectors, hub/skills, tests/unit/cli/), and a new filesystem-only unit test walks backtick-quoted repo paths across .claude/agents/, .claude/skills/, AGENTS.md, and CONTRIBUTING.md and asserts each one exists (placeholder shapes like hub/agents/<id>/... are allowlisted), so this class of drift can't ship silently again.

Overlaps open issue #3535, which tracks the same class of drift across a broader file set and proposes extending util/check_doc_links.py to walk .claude/ — the more durable long-term fix. This PR's test is scoped to the paths #4248 named. Also overlaps open PR #3812, which doesn't touch any of the lines fixed here.

Test plan

  • pytest tests/unit/test_ai_doc_paths_exist.py -q — 308 passed (confirmed it fails before the fix: reverting any one edit reintroduces a failure)
  • black --check / isort --check-only on the new test file
  • python util/check_doc_links.py --internal-only — 1012/1012 OK

Fixes #4248

…s/paths

Subagent definitions and the GitHub-reply skill cited agents and paths that
no longer exist and presented them as "verified against the tree" — an agent
session copying gaia-agent-builder.md's MRO example would go looking for
CodeAgent, JiraAgent, SDAgent, or MedicalIntakeAgent, none of which exist.
The github-issue-response skill's own worked example told a reporter GAIA has
no Slack integration and pointed at the deleted Jira agent, even though
`gaia slack` ships today.

Replaced every stale reference with a live one (GaiaAgent, ChatAgent,
hub/agents/hello-world, gaia.connectors, hub/skills) across the affected
.claude/agents, .claude/skills, AGENTS.md, and CONTRIBUTING.md files, and
added a filesystem-only unit test that walks backtick-quoted repo paths in
those files and asserts each exists (with a placeholder allowlist for
template shapes like `hub/agents/<id>/...`), so this can't silently rot again.

Overlaps open issue amd#3535, which tracks the same class of drift across a
broader set of files and proposes extending util/check_doc_links.py to walk
.claude/ — that's the more durable fix; this PR's test is scoped to the
paths this issue named. Also overlaps open PR amd#3812, which does not touch
any of the lines fixed here.

Fixes amd#4248
@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes — one small fix, then this is good to merge.

This PR replaces references to deleted agents and files across the subagent/skill instruction files and adds a test that fails when a backticked repo path in those files doesn't exist. Almost every replacement checks out against the tree, and the new guard genuinely works.

The one thing to fix: the builder doc now says the flagship agent declares the registry metadata attributes (AGENT_ID and friends). It doesn't — the registry falls back to the entry-point name for it. That claim sits under a header promising it was verified against the tree, which is the exact failure mode this PR exists to eliminate. The hub hello-world/email/word-count agents and the in-core builder agent do declare them and make correct examples.

Two smaller things worth a look: the contributor-doc test-plan example now names a real test file but filters it with -k startup, which selects zero tests in that file; and the new guard's path regex doesn't recognise .claude/ or .github/ paths, which is most of what these files cite about themselves. Adding those two prefixes passes today — I checked all 35 such references.

Real-world evidence

No evidence-bundle.md was produced for this PR, and none is expected — the change is instruction docs plus one filesystem-only unit test, which touches no CLI, API, MCP, or Agent UI surface.

I did verify the new test myself rather than taking the test plan on trust. pytest isn't installed in this review checkout, so I re-executed the test's own collection and assertion logic directly against the PR head content:

total claims: 307
FAILURES: 0

Running the same logic against the pre-PR content of the changed files reproduces the drift the PR fixes (7 failures: tests/test_cli.py ×3, src/gaia/mcp/blender_mcp_server.py, hub/agents/email/python/README.md ×2, hub/agents/jira/python/), so the guard does catch this class of rot and the fixes are what clear it.

🔍 Technical details

🟡 Important

GaiaAgent does not declare the registry metadata attributes (.claude/agents/gaia-agent-builder.md:80)

hub/agents/gaia/python/gaia_agent/agent.py:235 declares SKILL_DIRS, REQUIRED_CONNECTORS, CONFIRMATION_REQUIRED_TOOLS — no AGENT_ID / AGENT_NAME. The only AGENT_ID = "gaia" in that package is a module-level constant in server.py:54 / stdio.py:112, unrelated to the class attribute the registry reads; registry.py:874 explicitly falls back to entry_point_name "when AGENT_ID is absent". Classes that really declare it: hub/agents/email/…/agent.py:704, hub/agents/word-count/…/agent.py:77, hub/agents/hello-world/…/agent.py:48, src/gaia/agents/builder/agent.py:184.

- `AGENT_ID` / `AGENT_NAME` / `AGENT_DESCRIPTION` / `CONVERSATION_STARTERS` — required *only* for agents exposed through the registry/BuilderAgent flow (see `src/gaia/agents/builder/agent.py`). `ChatAgent` and `GaiaAgent` don't declare them (the registry falls back to the entry-point name); `hub/agents/hello-world`, `hub/agents/word-count` and `hub/agents/email` do.

🟢 Minor

-k startup matches nothing in the new example file (CONTRIBUTING.md:61) — tests/unit/test_chat_preflight.py has no test with startup in the name (test_no_model_loaded_triggers_load, test_llm_active_skips_load, …), so a contributor copying the "this is signal" example gets no tests ran.

- **Test plan** — specific commands or steps a reviewer can run. `pytest tests/unit/test_chat_preflight.py -k triggers_load` is signal; "I tested it" is not.

The guard skips .claude/ and .github/ paths (tests/unit/test_ai_doc_paths_exist.py:34) — the top-level allowlist omits the two namespaces these files cite most about themselves (35 such backticked references today, all currently valid, so adding them is green on merge). Without this, a renamed subagent or workflow file rots exactly where the PR is trying to stop rot.

    r"(?:src|hub|tests|docs|tui|cpp|util|scripts|eval|\.claude|\.github)/"

Coverage is narrower than the sibling guard it complements — tests/unit/test_no_stale_agent_paths.py already walks CLAUDE.md, REVIEW.md, .claude/commands/ and the Claude workflows for the weaker migrated-agent check, while this stronger every-path-must-exist check covers fewer files. CLAUDE.md is the most-read file of the set; it passes this check today except for one deliberately aspirational path (tests/fixtures/eval_baselines/gaia-flagship/, documented as not existing yet), so folding it in needs a one-entry allowlist. Worth a follow-up rather than blocking here.

HelloWorldAgent doesn't illustrate the rule it's cited for (.claude/agents/gaia-agent-builder.md:147) — the sentence is about tool mixins going after Agent, but class HelloWorldAgent(Agent) has no mixins at all. GaiaAgent(ProjectMapMixin, ChatAgent, SkillLibraryToolsMixin, …) is a live example that actually shows the ordering.

Strengths

  • The new test is the right shape for the problem: filesystem-only, offline, parametrized one-assert-per-claim so a failure names the exact file:line and path, with test_something_was_checked guarding against the glob/regex silently matching zero — the usual way this kind of guard dies.
  • Every other replacement I spot-checked is accurate against the tree: tests/unit/cli/test_cli_smoke.py really does discover subcommands from build_parser(); the three externally-registered subcommands (connectors, skill, uninstall) are correct; src/gaia/mcp/servers/ really holds just agent_ui_mcp.py and tui_mcp.py; gaia slack and docs/guides/slack.mdx do ship, so the Slack feature-request example was genuinely misleading before.
  • Removing the hand-maintained subcommand list from cli-developer.md in favour of pointing at gaia -h / build_parser() fixes the cause, not just the instance.

… nothing

GaiaAgent does not declare AGENT_ID as a class attribute; the only AGENT_ID = "gaia"
in that package is a module-level constant in server.py/stdio.py, and registry.py
falls back to the entry-point name when the attribute is absent. Name the classes
that actually declare it instead.

CONTRIBUTING.md's example filtered test_chat_preflight.py with -k startup, which
deselects all 17 tests in that file.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Confirmed and fixed — the AGENT_ID claim was wrong, and so was a second new claim in the same diff.

GaiaAgent does not declare AGENT_ID/AGENT_NAME as class attributes. The builder doc now says ChatAgent and GaiaAgent both omit them and the registry falls back to the entry-point name, and names three agents that genuinely declare them.

While verifying, the -k startup example the PR added to CONTRIBUTING.md turned out to be the same failure mode — it deselects all 17 tests in the file it names. Switched to -k triggers_load, which selects 2.

tests/unit/test_ai_doc_paths_exist.py + test_no_stale_agent_paths.py: 312 passed after merging origin/main (clean). check_doc_links.py --internal-only: all valid. black/isort clean.

🔍 Technical details

Verification for the AGENT_ID claim, run against this branch:

  • git grep AGENT_ID hub/agents/gaia/python/ returns only server.py:54 and stdio.py:112, both module-level AGENT_ID = "gaia" constants used to build route prefixes (f"/v1/{AGENT_ID}/version") — not the class attribute the registry reads.
  • registry.py:874: agent_id = getattr(agent_class, "AGENT_ID", "") or entry_point_name, with the docstring at :872 stating the fallback explicitly.
  • Classes with a real class-level declaration: hub/agents/hello-world/…/agent.py:48, word-count/…:77, email/…:704, src/gaia/agents/builder/agent.py:184. hub/agents/chat/…/agent.py has none.

For the -k filter: pytest tests/unit/test_chat_preflight.py -k startup -q → 17 deselected, 0 collected. -k triggers_load → 2 collected.

Not addressed (🟢 in the review, scoped as follow-ups): extending the guard's path regex to .claude/ and .github/, folding CLAUDE.md into the checked file set, and the HelloWorldAgent mixin-ordering example.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 26, 2026
Merged via the queue into amd:main with commit 670aa14 Sep 26, 2026
24 of 25 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claude/claude-agents-deleted-paths branch September 26, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(claude): .claude agents and skills point at deleted agents and paths

2 participants