Skip to content

fix(mcp): hydrated tool domains never reach caching clients and readiness gates fail open #665

Closed

Description

@dan-petty

Summary

Found in the release/v0.2.23 review (line numbers at 7fdaa9d).

  1. Most MCP tools are unreachable.
    • The server advertises 37 of its 156 tools, and hydrating a domain sends no notifications/tools/list_changed (src/devops_cli/ai/mcp/server.py:3008-3068). Clients that cache the tool list never see the hydrated tools. That includes this project's own MCPToolset, which create_devops_mcp_toolset builds with cache_tools=True.
    • The docstring advertises a nonexistent secrets domain and omits vault, ssh, tls, rag and repos. hydrate_tool_domain("secrets") still returns hydrated: True.
  2. pr_check_readiness(require_ready=True) always errors. It exits 2 with "No such option", because the MCP tool still passes --require-ready (server.py:2280-2281) after the flag was removed (src/devops_cli/commands/pr.py:1461-1468). tests/test_fastmcp_contracts.py:505-537 asserts the invalid argv. Tracked at docs/ROADMAP.md:763.
  3. pr check-readiness passes when it cannot see the checks. The check-runs gate reads one unpaginated page of 30 runs and treats any API failure or empty output as "no checks" (pr.py:1256-1270, :1293-1320). It also ignores commit statuses. A red check on page 2, a token without checks:read, or a 5xx lets the command certify the PR. tests/test_pr_check_runs.py:40-62 asserts the fail-open result. Tracked at docs/ROADMAP.md:768.
  4. devops ai runs check passes with nothing checked. Runs with no matching metrics produce no checks, and all([]) passes (src/devops_cli/ai/run_store.py:517-529, :741; src/devops_cli/commands/ai_runs.py:642-650). prompt-eval and sample-validation runs always "pass". Corpus-score runs check recall_found but never recall_reported.
  5. An ambiguous run-id prefix acts on an arbitrary run. A prefix that matches several runs picks one in filesystem glob order (run_store.py:361-364).
  6. The coverage index fails open for test helpers (latent). A changed tests/ helper or fixture is selected as a test itself, rather than the tests that import it (src/devops_cli/core/coverage_index.py:205-207). find("/src/") also matches the first /src/ in an absolute path (:111). Nothing calls this yet.

Remediation Plan

  1. Send notifications/tools/list_changed after hydration. Reject unknown domains, and correct the docstring.
  2. Remove --require-ready from the MCP tool, or restore the CLI flag, and fix the contract test.
  3. Paginate check runs, include commit statuses, and fail closed on API errors, updating tests/test_pr_check_runs.py.
  4. Fail runs check when no metric applies, and check recall_reported as well as recall_found.
  5. Refuse an ambiguous prefix and list the matching runs.
  6. Map changed test helpers to the tests that import them, and anchor the /src/ lookup to the repository root.
  7. Add tests for each item.

Activity

  1. added this to the v0.2.23 milestone on Sep 28, 2026
  2. added
    type/bug
    scope/mcp
    priority/p1-high
    on Sep 28, 2026
  3. added a commit that references this issue on Sep 28, 2026
    4804cd4
  4. dan-petty commented on Sep 28, 2026

    @dan-petty
    OwnerAuthor

    Closed by #674, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/mcptype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions