Skip to content

fix(mcp): add master_agent + master_reporter to RESOURCE_CATALOG#4717

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/mcp-master-agent-catalog
Jul 8, 2026
Merged

fix(mcp): add master_agent + master_reporter to RESOURCE_CATALOG#4717
senamakel merged 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/mcp-master-agent-catalog

Conversation

@CodeGhost21

@CodeGhost21 CodeGhost21 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds the missing RESOURCE_CATALOG entries for the master_agent and master_reporter built-ins so src/openhuman/mcp_server/resources.rs mirrors src/openhuman/agent_registry/agents/loader.rs::BUILTINS again (43 ↔ 43).
  • No behaviour change beyond making the two new subagent prompts fetchable over MCP as openhuman://prompts/agents/master_agent and openhuman://prompts/agents/master_reporter.

Problem

catalog_mirrors_builtins in src/openhuman/mcp_server/resources.rs is a parity guard: it iterates every BUILTINS entry and asserts a matching openhuman://prompts/agents/<id> catalog entry exists. When #4660 (feat(orchestration): Master chat) introduced master_agent and master_reporter in BUILTINS, the RESOURCE_CATALOG was not updated in the same commit — so BUILTINS.len() == 43 but only 41 agent entries live in the catalog.

Main CI stayed green because the changed-files coverage lane (scripts/ci/rust-coverage-changed.sh) only selects tests for the domains touched by the PR. Post-#4660 pushes didn't touch src/openhuman/mcp_server/ or src/openhuman/mod.rs, so mcp_server::resources::tests::* were never scoped. Any PR that widens the filter to a bare openhuman (e.g. by touching src/openhuman/mod.rs) surfaces the pre-existing gap. Repro on PR #4600:

thread '…::catalog_mirrors_builtins' panicked at src/openhuman/mcp_server/resources.rs:382:13:
RESOURCE_CATALOG is missing an entry for built-in agent `master_agent`
(expected URI `openhuman://prompts/agents/master_agent`).

read_resource_returns_content_for_each_subagent fails for the same reason (master_agent has no URI mapping).

Solution

Append two PromptResource entries — grouped with the other orchestration/* subagents right after reasoning_agent — pointing at the existing prompt files:

  • openhuman://prompts/agents/master_agentsrc/openhuman/orchestration/master_agent/prompt.md
  • openhuman://prompts/agents/master_reportersrc/openhuman/orchestration/master_reporter/prompt.md

The descriptions mirror each agent's when_to_use in the corresponding agent.toml. No production code changes — only the static catalog + include_str! bindings.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) — N/A: the existing mcp_server::resources::tests::catalog_mirrors_builtins and read_resource_returns_content_for_each_subagent already cover both branches (present/absent, valid/empty content). This PR flips them from red → green; no new test needed.
  • Diff coverage ≥ 80% — the 12 changed lines are PromptResource {…} literals whose uri, name, and content fields are read by the two parity tests above, so diff-cover will attribute them.
  • Coverage matrix updated — N/A: behaviour-only surface (subagent prompt catalog) with no feature-ID mapping in docs/TEST-COVERAGE-MATRIX.md.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related — N/A: no feature-ID rows change.
  • No new external network dependencies introduced — no new deps.
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: MCP static catalog is not on the release-cut smoke list.
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: no tracking issue; discovered while investigating PR feat(safety): Emergency Stop for desktop automation (#4255) #4600 CI red.

Impact

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A (GitHub-only)
  • URL: N/A

Commit & Branch

  • Branch: fix/mcp-master-agent-catalog
  • Commit SHA: 3966d1962

Validation Run

  • pnpm --filter openhuman-app format:check — N/A: no frontend files changed.
  • pnpm typecheck — N/A: no TS/TSX changes.
  • Focused tests: GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml -p openhuman --lib openhuman::mcp_server::resources → 9 passed, 0 failed (both previously failing tests now pass).
  • Rust fmt/check (if changed): cargo fmt --check clean on src/openhuman/mcp_server/resources.rs.
  • Tauri fmt/check (if changed): N/A: no app/src-tauri changes.

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: MCP clients can now fetch the master_agent and master_reporter prompt.md via the documented openhuman://prompts/agents/<id> scheme.
  • User-visible effect: two additional entries in the MCP resources/list response.

Parity Contract

  • Legacy behavior preserved: yes — every previously-listed URI and its content are unchanged. Only two additions.
  • Guard/fallback/dispatch parity checks: the catalog_mirrors_builtins guard now holds (43 == 43); read_resource_returns_content_for_each_subagent covers non-empty content for each new entry.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none
  • Canonical PR: this
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features
    • Added two new bundled prompt resources for agent workflows.
    • New prompt URIs are now available for master_agent and master_reporter, with built-in names, descriptions, and embedded content for easier access.

The `catalog_mirrors_builtins` parity check in
`src/openhuman/mcp_server/resources.rs` iterates every `BUILTINS` entry
and asserts a matching `openhuman://prompts/agents/<id>` catalog entry
exists. When tinyhumansai#4660 introduced the `master_agent` and `master_reporter`
built-ins, the catalog was not updated in the same commit, leaving
BUILTINS at 43 entries and RESOURCE_CATALOG at 41 agent entries.

Main CI stayed green because the changed-files coverage lane
(`scripts/ci/rust-coverage-changed.sh`) only selects tests for the
domains touched by the PR — post-tinyhumansai#4660 pushes didn't touch
`src/openhuman/mcp_server/` or `src/openhuman/mod.rs`, so
`mcp_server::resources::tests::*` were never scoped. Any PR that
happens to widen the filter to `openhuman` (e.g. by touching
`src/openhuman/mod.rs`) surfaces the pre-existing gap:

  thread '...::catalog_mirrors_builtins' panicked ...
    RESOURCE_CATALOG is missing an entry for built-in agent
    `master_agent` (expected URI `openhuman://prompts/agents/master_agent`).

Add the two missing `PromptResource` entries pointing at the existing
`orchestration/master_agent/prompt.md` and
`orchestration/master_reporter/prompt.md`. Restores parity and unblocks
the mcp_server::resources parity + read-content-for-each-subagent tests.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b881cce7-6e60-477c-b6ac-bb9cc8f0e94d

📥 Commits

Reviewing files that changed from the base of the PR and between 2e5eb4f and 3966d19.

📒 Files selected for processing (1)
  • src/openhuman/mcp_server/resources.rs

📝 Walkthrough

Walkthrough

The RESOURCE_CATALOG in resources.rs is extended with two new PromptResource entries for master_agent and master_reporter, each defining a URI, name, description, and embedded markdown content loaded at compile time via include_str!.

Changes

Prompt catalog update

Layer / File(s) Summary
Register new agent prompt resources
src/openhuman/mcp_server/resources.rs
Adds two PromptResource entries to RESOURCE_CATALOG for openhuman://prompts/agents/master_agent and openhuman://prompts/agents/master_reporter, embedding markdown via include_str!.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Poem

Two new scrolls join the catalog's den,
Master agent and reporter, embedded again,
With a hop and a include_str! cheer,
This rabbit's PR review is clear! 🐇📜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding master_agent and master_reporter entries to RESOURCE_CATALOG.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@senamakel senamakel merged commit bcdad32 into tinyhumansai:main Jul 8, 2026
19 checks 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.

2 participants