Skip to content

fix(bridge): treat an empty tool schema as a failed auto-connect - #692

Open
benjaminkincses wants to merge 4 commits into
bethington:devfrom
benjaminkincses:fix/auto-connect-empty-schema
Open

benjaminkincses wants to merge 4 commits into
bethington:devfrom
benjaminkincses:fix/auto-connect-empty-schema

Conversation

@benjaminkincses

Copy link
Copy Markdown
Contributor

Refs #640.

_auto_connect() reported success when /mcp/schema came back empty. That stops the background retry, so a bridge that starts next to a Ghidra that is not ready yet sits there with only the static tools and never picks the analysis tools up.

An empty schema now raises in all three connect paths (UDS, discovered TCP, configured URL) and counts as a failed connect, so the retry keeps running until the server reports tools. Facade mode is unchanged: it caches a nonempty schema and registers nothing by design, and that still counts as connected.

The URL precedence half of #640 stays as designed in #649 (GHIDRA_MCP_PIN_URL). This takes only the false-success half.

Tests: three new cases in TestAutoConnectRetry (empty schema on the fallback path, empty schema from a single UDS instance, zero registrations on a nonempty schema). Eight existing auto-connect tests mocked _fetch_schema with an empty schema next to a positive registration count, which cannot happen in production; their schema mocks now return one tool entry, assertions unchanged. Ran pytest tests/unit/: the bridge files pass (322 passed); the only failures are the pre-existing Gradle, Maven and protocol-safety environment failures, identical on the base tree.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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