Repository navigation
fix(bridge): treat an empty tool schema as a failed auto-connect - #692
Open
benjaminkincses wants to merge 4 commits into
Open
benjaminkincses wants to merge 4 commits into
benjaminkincses wants to merge 4 commits into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.