Repository navigation
fix(ida): report missing tools when a compatibility profile mismatches - #2307
Conversation
A profile mismatch reached the caller as a bare AnalysisProtocolError, which projects to `unreadable_output` with a generic message. The error already named every missing tool, but none of that detail survived, so the only way to identify the cause was to log the JSON-RPC traffic and notice the exchange stopping after `tools/list`. Throw a ProviderAdapterError instead, carrying the mode, the expected profile and the missing tool names through the diagnostics channel that already surfaces in `details`. Document which upstream versions each profile accepts, since upstream `main` now serves neither. Refs morluto#2301
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Checked this branch (head b49f127) on real IDA Professional 9.1 against the pinned headless supervisor (ida-pro-mcp c133c38,
The headless supervisor at upstream |
|
@greptileai review |
|
This PR is set for a Plus review. TREX isn't supported with Plus or Apex reviews yet, so Greptile reviews this PR at Base while TREX is on. |
|
Closes part of #2301.
Problem
When an upstream server serves a tool set that matches neither compatibility profile,
#initialize()throws anAnalysisProtocolErrornaming every missing tool. That message never reaches the caller.AnalysisProtocolErrormaps tounreadable_output, so the CLI prints this and nothing else:Nothing points at a version or profile mismatch, and
doctorstill reports the registration as healthy because it validates the registration shape rather than probing the live tool list. I found the cause by logging the stdio traffic and noticing the exchange stops right aftertools/list.This is easy to hit today. Upstream's
mainis at 2.0.0, which renamed the GUI tools and no longer servesidb_close, so both profiles reject it. Installing from GitHub is upstream's documented method, so anyone following it lands there.Change
Throw a
ProviderAdapterErrorinstead, carrying the mode, the expected profile and the missing tool names through thediagnosticschannel that already surfaces indetails. The same text stays asuserMessage, so no information is lost, and the projected code moves fromunreadable_outputtoexecution_failure, which describes a startup refusal better than malformed output does.The caller now gets:
I also added a short section to
docs/ida-provider.mdsaying which upstream versions each profile accepts. The existing text was accurate but never stated that currentmainis unsupported.Scope
This is the diagnosability half of #2301. I deliberately left the compatibility question alone:
#closeDatabase()verifies that the response reportsowned,savedandbackend, and upstream 2.0.0 has no close tool to map that contract onto, so what should replace it looks like a maintainer decision rather than something to guess at here. Happy to follow up once there is a direction.Verification
npm run typecheckpasses.IdaSessionClient.test.tscover the headless and attached paths, asserting the projecteddetailsnames the absent tool and the expected profile. Both pass.oxfmt --checkandoxlintare clean on the changed files. The remainingmax-linesandcomplexitywarnings insrc/ida/are pre-existing.One thing worth flagging: on an unmodified checkout,
vitest run src/ida/IdaSessionClient.test.tsalready fails 27 of 37 tests on Windows. The same 27 fail before and after this change, and my two additions pass, but I could not get a fully green suite locally to compare against. Happy to look into those separately if they are not already known.