fe8db466c3
Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
4.3 KiB
4.3 KiB
id, title, status, wave, depends_on, plan, spec, design, requirements, acceptance_criteria
| id | title | status | wave | depends_on | plan | spec | design | requirements | acceptance_criteria | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-audit-agent-runtime-mcp-budgets | Assert no agent runtime couples MCP startup and tool budgets | done | 2 |
|
plan.md | ../../specs/agents/requirements/mcp-timeout-budgets.md | ../../specs/agents/system-design/mcp-timeout-budgets.md |
|
|
Task 02: Assert no agent runtime couples MCP startup and tool budgets
Outcome
The invariant task 01 establishes for the Claude runtime holds for every agent runtime in the catalog, enforced by a test that a new agent cannot bypass by omission.
In scope
- Audit every
Runtime()implementation inapps/backend/internal/agent/agents/for MCP time-budget environment values. At the time of writing,claude_acp.gois the only one that declares any;hermes_acp.godeclaresHERMES_ACP_SKIP_CONFIGURED_MCPfor a related but distinct reason and is not in scope to change. - Add a catalog-wide test that iterates the registered agents and asserts, for
each runtime that declares
MCP_TIMEOUT, that it is at most 60000 and that the runtime also declaresMCP_TOOL_TIMEOUTwhen it needs a long tool budget. - If the audit finds another runtime with the same coupling, correct it in this work order using the values its CLI documents.
Out of scope
- Introducing MCP budgets for a runtime that declares none today.
- Changing
HERMES_ACP_SKIP_CONFIGURED_MCP. - Non-MCP environment defaults.
Acceptance
- A catalog-level test enumerates agents through the existing catalog helper rather than a hardcoded list, so a newly added agent is covered without editing the test.
- The test fails if any runtime declares
MCP_TIMEOUTabove 60000. - The audit result is recorded in this work order's results, including runtimes found to declare nothing.
Verification
make -C apps/backend test(new regression:TestAgentRuntimesBoundMCPStartupBudgetininternal/agent/registry)make -C apps/backend lint
Files likely touched
apps/backend/internal/agent/agents/helpers_catalog_test.goor a newmcp_budget_test.goin the same package- Any agent runtime file the audit finds coupled
Dependencies
Task 01. This work order generalises the invariant that task 01 establishes.
Inputs
apps/backend/internal/agent/agents/helpers_catalog_test.gofor the existing catalog enumeration pattern.- Task 01's implementation of the per-runtime assertion.
Output contract
Report the audited runtimes and what each declares, the new test output, any
runtime corrected, and any blocker. Mark this work order done and update
plan.md in the same conversation.
Results
Implemented 2026-09-05.
- Audit:
grep -rEn '"(MCP_TIMEOUT|MCP_TOOL_TIMEOUT)":' apps/backend/internal/agent/agents(scoped toRuntime().Envdeclarations, not incidental comment mentions elsewhere) returns exactly one hit,claude_acp.go. All other 22 registered agents (Registry.LoadDefaults()) declare neither key.hermes_acp.godeclares only the unrelatedHERMES_ACP_SKIP_CONFIGURED_MCPflag — confirmed out of scope, not coupled to MCP_TIMEOUT semantics. - Added
TestAgentRuntimesBoundMCPStartupBudgetininternal/agent/registry/registry_test.go. It iteratesRegistry.LoadDefaults()+reg.List()(the real, extensible agent catalog —internal/agent/agents/helpers_catalog_test.gohas no such enumeration, it holds only three per-agent permission tests, so this test lives inregistryinstead per the corrected location in the plan) and fails if any runtime'sMCP_TIMEOUTexceeds 60000. A newly registered agent is covered automatically since the test walksLoadDefaults(), not a hardcoded list. - Confirmed the test fails for the right reason against the un-fixed
claude_acp.go(temporarily isolated via a taggedgit stashof just that file, restored immediately after):claude-acp: MCP_TIMEOUT = 7200000, want <= 60000. Passes after task 01's fix. - No other runtime needed correction.
make -C apps/backend test/lint: same result as task 01 (green for touched packages; pre-existing unrelated failures confirmed identical to merge-base).