[PR #1405] [MERGED] perf(hopper): stop repeating Hopper replies as raw_result #2861

Closed
opened 2026-10-17 21:11:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1405
Author: @kaoru0822-kitauji
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: perf/hopper-raw-result


📝 Commits (1)

  • eba614f perf(hopper): stop repeating Hopper replies as raw_result

📊 Changes

2 files changed (+4 additions, -1 deletions)

View changed files

📝 src/hopper/HopperProvider.ts (+2 -1)
📝 tests/acceptance/applications/runtime.test.ts (+2 -0)

📄 Description

Problem

In HopperProvider.execute, mapped is the reply itself (mapped = result) for every operation except address_to_file_offset, yet Evidence was built with

createAnalysisExecution(mapped.value, executionProvider, { rawResult: result.value, … })

so raw_result was the same object as normalized_result. Every Hopper Evidence record carried its complete result twice: decompilation, procedure/string listings, xrefs, call graphs and instructions. An MCP response repeats Evidence in text and structured content, so it carried the result four times. The duplicate also counted twice against the 10 MiB transport budget. Hopper is the primary deep-analysis provider, so this affects the largest everyday results.

Change

rawResult: mapped === result ? null : result.value. Only address_to_file_offset transforms Hopper's reply (mapHopperFileOffset), and it keeps the original reply as raw_result. Everything else records null, meaning no distinct provider representation (see #1402). normalized_result, the analysis profile and limitations are unchanged.

Tests

  • tests/acceptance/applications/runtime.test.ts ("returns the selected document on macOS through MCP…") drives the production stdio server with the fake Hopper launcher and now asserts raw_result === null. The assertion fails on main and passes here.
  • npx vitest run tests/boundary/providers/hopper src/hopper tests/boundary/mcp tests/composition: 641 passed, 4 skipped
  • npm run check:fast

Not verified with real Hopper (not installed on this machine). The change is confined to how REA records the reply after Hopper returns it; no bridge or protocol behavior changes.

Related: #1402 (createAnalysisExecution default copy) and #1404 (pwntools diagnostics). The three PRs are independent. Refs #723, #1065.

🤖 Generated with Claude Code


🔄 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/1405 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `perf/hopper-raw-result` --- ### 📝 Commits (1) - [`eba614f`](https://github.com/morluto/rea/commit/eba614f578f5ff2daa68d53d30646cb172d2f5c8) perf(hopper): stop repeating Hopper replies as raw_result ### 📊 Changes **2 files changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/hopper/HopperProvider.ts` (+2 -1) 📝 `tests/acceptance/applications/runtime.test.ts` (+2 -0) </details> ### 📄 Description ## Problem In `HopperProvider.execute`, `mapped` is the reply itself (`mapped = result`) for every operation except `address_to_file_offset`, yet Evidence was built with ```ts createAnalysisExecution(mapped.value, executionProvider, { rawResult: result.value, … }) ``` so `raw_result` was the **same object** as `normalized_result`. Every Hopper Evidence record carried its complete result twice: decompilation, procedure/string listings, xrefs, call graphs and instructions. An MCP response repeats Evidence in text and structured content, so it carried the result four times. The duplicate also counted twice against the 10 MiB transport budget. Hopper is the primary deep-analysis provider, so this affects the largest everyday results. ## Change `rawResult: mapped === result ? null : result.value`. Only `address_to_file_offset` transforms Hopper's reply (`mapHopperFileOffset`), and it keeps the original reply as `raw_result`. Everything else records `null`, meaning no distinct provider representation (see #1402). `normalized_result`, the analysis profile and limitations are unchanged. ## Tests - `tests/acceptance/applications/runtime.test.ts` ("returns the selected document on macOS through MCP…") drives the production stdio server with the fake Hopper launcher and now asserts `raw_result === null`. The assertion fails on `main` and passes here. - `npx vitest run tests/boundary/providers/hopper src/hopper tests/boundary/mcp tests/composition`: 641 passed, 4 skipped - `npm run check:fast` Not verified with real Hopper (not installed on this machine). The change is confined to how REA records the reply after Hopper returns it; no bridge or protocol behavior changes. Related: #1402 (`createAnalysisExecution` default copy) and #1404 (pwntools diagnostics). The three PRs are independent. Refs #723, #1065. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:08 +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#2861
No description provided.