[PR #2086] [CLOSED] fix(mcp): keep prompt completion from cold-starting deep providers #5014

Closed
opened 2026-10-31 00:58:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2086
Author: @VarunGore36
Created: 10/12/2026
Status: ❌ Closed

Base: main ← Head: main


📄 Description

Fixes #2076.

Behavior change

Document and procedure prompt completion (completion/complete) no longer cold-starts Ghidra/Hopper as a side effect. After open_binary, completion returns [] until a real tool call warms the provider; a target switch re-arms the gate. Warm completion is bounded by a 5s timeout so it cannot wait behind the deep-provider serial queue indefinitely.

How

  • BinarySession tracks whether a non-health operation has been dispatched to the active client and exposes it via a new optional BinarySessionPort.isProviderWarmed(). open only runs the composite health probe (which never creates a child), so a fresh session reads cold without any provider side effect and without registering in the call-drain set.
  • promptCompletion gates list_documents/list_procedures on that bit and passes AbortSignal.timeout(5000) on the warm path. Ports without warmth reporting keep their existing behavior.
  • docs/mcp-prompts.md documents the warm-only, 5s-bound behavior.

Validation

  • npm run check:fast (typecheck + lint) and npm run docs:check pass.
  • 15 prompt completion tests (promptCompletion.test.ts, promptMcp.test.ts, updated + 1 new regression test asserting zero provider dispatches while cold) and 64 related session/server tests pass.
  • Verified with recording fake providers only; no real Ghidra/Hopper run, so the engine-specific startup/cancellation path is source-derived per the issue analysis.

🔄 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/2086 **Author:** [@VarunGore36](https://github.com/VarunGore36) **Created:** 10/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📄 Description Fixes #2076. ## Behavior change Document and procedure prompt completion (`completion/complete`) no longer cold-starts Ghidra/Hopper as a side effect. After `open_binary`, completion returns `[]` until a real tool call warms the provider; a target switch re-arms the gate. Warm completion is bounded by a 5s timeout so it cannot wait behind the deep-provider serial queue indefinitely. ## How - `BinarySession` tracks whether a non-`health` operation has been dispatched to the active client and exposes it via a new optional `BinarySessionPort.isProviderWarmed()`. `open` only runs the composite `health` probe (which never creates a child), so a fresh session reads cold without any provider side effect and without registering in the call-drain set. - `promptCompletion` gates `list_documents`/`list_procedures` on that bit and passes `AbortSignal.timeout(5000)` on the warm path. Ports without warmth reporting keep their existing behavior. - `docs/mcp-prompts.md` documents the warm-only, 5s-bound behavior. ## Validation - `npm run check:fast` (typecheck + lint) and `npm run docs:check` pass. - 15 prompt completion tests (`promptCompletion.test.ts`, `promptMcp.test.ts`, updated + 1 new regression test asserting zero provider dispatches while cold) and 64 related session/server tests pass. - Verified with recording fake providers only; no real Ghidra/Hopper run, so the engine-specific startup/cancellation path is source-derived per the issue analysis. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:58:00 +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#5014
No description provided.