Skip to content

fix(coding-agents): answer tools/list when disabled - #3537

Closed
altaywtf wants to merge 1 commit into
vectorize-io:mainfrom
uinaf:fix/coding-agents-empty-tool-discovery
Closed

fix(coding-agents): answer tools/list when disabled#3537
altaywtf wants to merge 1 commit into
vectorize-io:mainfrom
uinaf:fix/coding-agents-empty-tool-discovery

Conversation

@altaywtf

Copy link
Copy Markdown
Contributor

Summary

Keep opted-out Hindsight MCP servers inert while making their tool-discovery contract valid. This prevents clients that probe tools/list from treating an intentionally disabled project as an MCP startup failure.

Changed

  • Build the MCP server through one registration helper.
  • When the resolved project exposes no tools, advertise an empty tool capability and answer tools/list with { "tools": [] }.
  • Add an in-memory MCP client/server regression test for the zero-tool path.

Risks

Low. Normal tool registration is unchanged; only the existing zero-tool path gains an explicit discovery response.

Verification

  • npm test — 530 tests passed.
  • npm run build — passed.
  • ./scripts/hooks/lint.sh — passed.
  • git diff --check upstream/main...HEAD — passed.
  • Project code review — no findings.

Complexity

The zero-tool path is constant-time. No API, persistence, or network behavior changes.

Copilot AI lite review requested due to automatic review settings August 17, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the hindsight-integrations/coding-agents MCP server’s zero-tool (“opted-out/disabled”) mode so that MCP clients probing tools/list don’t misinterpret an intentionally inert server as a startup failure. It introduces a single helper to build the MCP server surface and adds a regression test to ensure the discovery contract is valid when no tools are exposed.

Changes:

  • Centralized MCP server construction into buildMcpServer(...) to consistently register tools (or a valid empty tool surface).
  • When the resolved project exposes zero tools, explicitly advertises an empty tools capability and answers tools/list with { tools: [] }.
  • Added an in-memory client/server test covering the zero-tool tools/list path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
hindsight-integrations/coding-agents/src/mcp-server.ts Adds buildMcpServer and ensures disabled projects still respond to tools/list with an empty tool set.
hindsight-integrations/coding-agents/src/mcp-server.test.ts Adds an in-memory regression test validating capabilities + tools/list response for the zero-tool server.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Rebased onto current main and continued in #3626 — GitHub rejects pushes to this fork branch with a 403 despite maintainer_can_modify: true, so the commit could not be updated in place. Your commit and authorship are preserved there.

The conflicts with main were textual only: #3603 refactored main() onto resolveHostMemory and added resolveHarness after this branch was cut. buildMcpServer and its InMemoryTransport test needed no changes — full suite is 619 passing on the rebase.

Closing in favour of #3626.

@altaywtf
altaywtf deleted the fix/coding-agents-empty-tool-discovery branch August 19, 2026 14:52
@altaywtf

Copy link
Copy Markdown
Contributor Author

thanks @nicoloboschi 🙇
think it's because I forked it to org repo rather than personal.
will keep in mind next time. 👍

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.

3 participants