[GH-ISSUE #501] Hopper list_strings / list_names double-convert the address → -32000 invalid_request on every inspect #270

Closed
opened 2026-10-15 18:23:14 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Kyzcreig on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/501

Version: rea-agents 3.2.1 (also present on main at the time of filing), macOS 26.7 arm64, Hopper 6.6.0 demo.

Repro:

rea inspect <any Mach-O> --provider hopper --format json
# -> Hopper list_strings failed (-32000, invalid_request): Invalid Hopper bridge request

rea search, rea trace, and rea decompile on the same target work, so the bridge/session is healthy; only the inventory calls fail.

Cause: bridge/hopper_bridge.py, list_strings branch. _search_inventory(document, "string") already yields hex-string addresses; the final comprehension then calls _hex(address) on them:

return [{"address": _hex(address), "value": value} for address, value in sorted(values.items())]

which raises TypeError: %x format: an integer is required, not str, surfaced to the client as -32000 invalid_request. list_names has the same pattern (int('0x…') on an already-hex string). Reproduced offline against the shipped bridge module.

Suggested fix: don't re-_hex() the inventory keys (or normalise _search_inventory to return ints and convert once at the edge). Happy to open a PR if you'd like.

Originally created by @Kyzcreig on GitHub (Oct 4, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/501 **Version:** rea-agents 3.2.1 (also present on `main` at the time of filing), macOS 26.7 arm64, Hopper 6.6.0 demo. **Repro:** ``` rea inspect <any Mach-O> --provider hopper --format json # -> Hopper list_strings failed (-32000, invalid_request): Invalid Hopper bridge request ``` `rea search`, `rea trace`, and `rea decompile` on the same target work, so the bridge/session is healthy; only the inventory calls fail. **Cause:** `bridge/hopper_bridge.py`, `list_strings` branch. `_search_inventory(document, "string")` already yields hex-string addresses; the final comprehension then calls `_hex(address)` on them: ```python return [{"address": _hex(address), "value": value} for address, value in sorted(values.items())] ``` which raises `TypeError: %x format: an integer is required, not str`, surfaced to the client as `-32000 invalid_request`. `list_names` has the same pattern (`int('0x…')` on an already-hex string). Reproduced offline against the shipped bridge module. **Suggested fix:** don't re-`_hex()` the inventory keys (or normalise `_search_inventory` to return ints and convert once at the edge). Happy to open a PR if you'd like.
bsakaguchi 2026-10-15 18:23:14 +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#270
No description provided.