[PR #2307] [MERGED] fix(ida): report missing tools when a compatibility profile mismatches #5151

Closed
opened 2026-10-31 01:04:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2307
Author: @vt0x78
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/ida-profile-mismatch-diagnostics


📝 Commits (2)

  • b49f127 fix(ida): report missing tools when a compatibility profile mismatches
  • 3c8b468 fix: reconcile main and review findings for PR #2307

📊 Changes

4 files changed (+112 additions, -6 deletions)

View changed files

📝 docs/ida-provider.md (+9 -0)
📝 src/ida/IdaSessionClient.test.ts (+70 -0)
📝 src/ida/IdaSessionClient.ts (+21 -4)
📝 tests/composition/idaProvider.test.ts (+12 -2)

📄 Description

Closes part of #2301.

Problem

When an upstream server serves a tool set that matches neither compatibility profile, #initialize() throws an AnalysisProtocolError naming every missing tool. That message never reaches the caller. AnalysisProtocolError maps to unreadable_output, so the CLI prints this and nothing else:

code: unreadable_output
category: execution_failure
message: "Analysis returned an unreadable result. Retry once; if it continues, run `rea doctor`."

Nothing points at a version or profile mismatch, and doctor still 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 after tools/list.

This is easy to hit today. Upstream's main is at 2.0.0, which renamed the GUI tools and no longer serves idb_close, so both profiles reject it. Installing from GitHub is upstream's documented method, so anyone following it lands there.

Change

Throw a ProviderAdapterError instead, carrying the mode, the expected profile and the missing tool names through the diagnostics channel that already surfaces in details. The same text stays as userMessage, so no information is lost, and the projected code moves from unreadable_output to execution_failure, which describes a startup refusal better than malformed output does.

The caller now gets:

details:
  provider_id: ida
  diagnostics:
    mode: headless
    expected_profile: database-supervisor
    missing_tools: [idb_close]

I also added a short section to docs/ida-provider.md saying which upstream versions each profile accepts. The existing text was accurate but never stated that current main is unsupported.

Scope

This is the diagnosability half of #2301. I deliberately left the compatibility question alone: #closeDatabase() verifies that the response reports owned, saved and backend, 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 typecheck passes.
  • Two new tests in IdaSessionClient.test.ts cover the headless and attached paths, asserting the projected details names the absent tool and the expected profile. Both pass.
  • oxfmt --check and oxlint are clean on the changed files. The remaining max-lines and complexity warnings in src/ida/ are pre-existing.

One thing worth flagging: on an unmodified checkout, vitest run src/ida/IdaSessionClient.test.ts already 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2307 **Author:** [@vt0x78](https://github.com/vt0x78) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/ida-profile-mismatch-diagnostics` --- ### 📝 Commits (2) - [`b49f127`](https://github.com/morluto/rea/commit/b49f1272cde5438afe888322c22209349979c801) fix(ida): report missing tools when a compatibility profile mismatches - [`3c8b468`](https://github.com/morluto/rea/commit/3c8b4684c7a3331b8d2d783659bf69ec79a9b584) fix: reconcile main and review findings for PR #2307 ### 📊 Changes **4 files changed** (+112 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/ida-provider.md` (+9 -0) 📝 `src/ida/IdaSessionClient.test.ts` (+70 -0) 📝 `src/ida/IdaSessionClient.ts` (+21 -4) 📝 `tests/composition/idaProvider.test.ts` (+12 -2) </details> ### 📄 Description Closes part of #2301. ## Problem When an upstream server serves a tool set that matches neither compatibility profile, `#initialize()` throws an `AnalysisProtocolError` naming every missing tool. That message never reaches the caller. `AnalysisProtocolError` maps to `unreadable_output`, so the CLI prints this and nothing else: ``` code: unreadable_output category: execution_failure message: "Analysis returned an unreadable result. Retry once; if it continues, run `rea doctor`." ``` Nothing points at a version or profile mismatch, and `doctor` still 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 after `tools/list`. This is easy to hit today. Upstream's `main` is at 2.0.0, which renamed the GUI tools and no longer serves `idb_close`, so both profiles reject it. Installing from GitHub is upstream's documented method, so anyone following it lands there. ## Change Throw a `ProviderAdapterError` instead, carrying the mode, the expected profile and the missing tool names through the `diagnostics` channel that already surfaces in `details`. The same text stays as `userMessage`, so no information is lost, and the projected code moves from `unreadable_output` to `execution_failure`, which describes a startup refusal better than malformed output does. The caller now gets: ``` details: provider_id: ida diagnostics: mode: headless expected_profile: database-supervisor missing_tools: [idb_close] ``` I also added a short section to `docs/ida-provider.md` saying which upstream versions each profile accepts. The existing text was accurate but never stated that current `main` is unsupported. ## Scope This is the diagnosability half of #2301. I deliberately left the compatibility question alone: `#closeDatabase()` verifies that the response reports `owned`, `saved` and `backend`, 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 typecheck` passes. - Two new tests in `IdaSessionClient.test.ts` cover the headless and attached paths, asserting the projected `details` names the absent tool and the expected profile. Both pass. - `oxfmt --check` and `oxlint` are clean on the changed files. The remaining `max-lines` and `complexity` warnings in `src/ida/` are pre-existing. One thing worth flagging: on an unmodified checkout, `vitest run src/ida/IdaSessionClient.test.ts` already 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5151
No description provided.