[PR #5262] [MERGED] fix(hopper): bound bridge request frames like the Cutter bridge #6846

Closed
opened 2026-11-01 21:43:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5262
Author: @DeryFerd
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: fix/hopper-bridge-request-frame-bound


📝 Commits (4)

  • 828c938 fix(hopper): bound bridge request frames like the Cutter bridge
  • 9c62695 fix(bridges): exclude line delimiter from payload limit
  • c3bf224 Merge main into Hopper bridge frame limit fix
  • 25ee0c7 test(hopper): cover partial request at EOF

📊 Changes

6 files changed (+266 additions, -3 deletions)

View changed files

📝 bridge/cutter/rea_bridge.py (+3 -1)
📝 bridge/hopper_bridge.py (+18 -1)
📝 docs/reverse-engineering-tools.md (+5 -1)
➕ tests/boundary/providers/hopper/hopperBridgeFrameLimit.test.ts (+87 -0)
📝 tests/fixtures/cutter_bridge_protocol_test.py (+21 -0)
➕ tests/fixtures/hopperBridgeFrameLimitProbe.py (+132 -0)

📄 Description

Summary

The Hopper and Cutter bridges now apply the same 16 MiB request-payload limit. The limit counts JSON payload bytes and excludes the terminating LF, so a payload exactly at the limit is accepted with its delimiter; oversized unterminated frames are rejected without waiting for EOF. Shorter incomplete frames are refused when the stream ends without the required delimiter.

Change and validation

Hopper reads at most the payload limit plus one delimiter byte, distinguishes an exact-limit complete frame from an oversized or incomplete frame, and returns the existing invalid_request diagnostic on refusal. Cutter's bounded receive path likewise accepts an exactly-limit payload when the LF arrives in a later fragment. The response direction remains unchanged so valid large analysis output is unaffected.

  • npm run test:focused -- tests/boundary/providers/hopper/hopperBridgeFrameLimit.test.ts tests/boundary/providers/cutterBridgeProducer.test.ts — 2 files, 7 tests passed. Coverage includes exact-limit payloads, fragmented delimiters, oversize input, and incomplete frames.
  • npm run docs:check passed.
  • npm run check:fast passed (typecheck and lint).
  • The tests exercise bridge fixtures and socket/protocol boundaries; no installed Hopper or Cutter provider was run. At the latest query, hosted checks consisted of Greptile and readiness/declaration validation; no current hosted CI test run was visible.

Scope and limitations

This changes bridge request framing only. Tool schemas, Evidence semantics, target selection, and response handling are unchanged. A refused oversized request closes through the existing connection cleanup path.

Author readiness

These declarations are left for the human owner to complete.

Human owner: @DeryFerd

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Merged main 82e4e032 as c3bf2243 to resolve the documentation conflict. The combined tree preserves main's deadline/discovery/no-override wording and current Hopper bookmark changes, together with the LF-excluded request-payload framing fix. The focused Hopper/Cutter fixture tests passed 7/7, check:fast and docs:check passed on Node 24.18.0/npm 11.16.0. No real Hopper/Cutter instance was run; current hosted checks remain separate.

Partial-frame follow-up (25ee0c70): a distinct probe now sends valid authenticated JSON shorter than the payload cap without LF, half-closes only the write side, and verifies invalid_request, zero dispatch and connection/thread release. The stalled open-peer oversized case remains separate. Hopper/Cutter focused tests passed 7/7 and check:fast passed on Node 24; this is bridge-fixture proof, not a real Hopper/Cutter run.


🔄 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/5262 **Author:** [@DeryFerd](https://github.com/DeryFerd) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/hopper-bridge-request-frame-bound` --- ### 📝 Commits (4) - [`828c938`](https://github.com/morluto/rea/commit/828c93893548d9cf02953641e3955061ee7888d4) fix(hopper): bound bridge request frames like the Cutter bridge - [`9c62695`](https://github.com/morluto/rea/commit/9c626950859da7a9c3163aaf874060f688981c57) fix(bridges): exclude line delimiter from payload limit - [`c3bf224`](https://github.com/morluto/rea/commit/c3bf22434ccc44ae654cfc6ee12e5dbe6f2562d1) Merge main into Hopper bridge frame limit fix - [`25ee0c7`](https://github.com/morluto/rea/commit/25ee0c70991b1be14b74acbaeacbb8f9ed5e1e43) test(hopper): cover partial request at EOF ### 📊 Changes **6 files changed** (+266 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `bridge/cutter/rea_bridge.py` (+3 -1) 📝 `bridge/hopper_bridge.py` (+18 -1) 📝 `docs/reverse-engineering-tools.md` (+5 -1) ➕ `tests/boundary/providers/hopper/hopperBridgeFrameLimit.test.ts` (+87 -0) 📝 `tests/fixtures/cutter_bridge_protocol_test.py` (+21 -0) ➕ `tests/fixtures/hopperBridgeFrameLimitProbe.py` (+132 -0) </details> ### 📄 Description ## Summary The Hopper and Cutter bridges now apply the same 16 MiB request-payload limit. The limit counts JSON payload bytes and excludes the terminating LF, so a payload exactly at the limit is accepted with its delimiter; oversized unterminated frames are rejected without waiting for EOF. Shorter incomplete frames are refused when the stream ends without the required delimiter. ## Change and validation Hopper reads at most the payload limit plus one delimiter byte, distinguishes an exact-limit complete frame from an oversized or incomplete frame, and returns the existing `invalid_request` diagnostic on refusal. Cutter's bounded receive path likewise accepts an exactly-limit payload when the LF arrives in a later fragment. The response direction remains unchanged so valid large analysis output is unaffected. - `npm run test:focused -- tests/boundary/providers/hopper/hopperBridgeFrameLimit.test.ts tests/boundary/providers/cutterBridgeProducer.test.ts` — 2 files, 7 tests passed. Coverage includes exact-limit payloads, fragmented delimiters, oversize input, and incomplete frames. - `npm run docs:check` passed. - `npm run check:fast` passed (typecheck and lint). - The tests exercise bridge fixtures and socket/protocol boundaries; no installed Hopper or Cutter provider was run. At the latest query, hosted checks consisted of Greptile and readiness/declaration validation; no current hosted CI test run was visible. ## Scope and limitations This changes bridge request framing only. Tool schemas, Evidence semantics, target selection, and response handling are unchanged. A refused oversized request closes through the existing connection cleanup path. ## Author readiness These declarations are left for the human owner to complete. Human owner: @DeryFerd - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. Merged main `82e4e032` as `c3bf2243` to resolve the documentation conflict. The combined tree preserves main's deadline/discovery/no-override wording and current Hopper bookmark changes, together with the LF-excluded request-payload framing fix. The focused Hopper/Cutter fixture tests passed 7/7, `check:fast` and `docs:check` passed on Node 24.18.0/npm 11.16.0. No real Hopper/Cutter instance was run; current hosted checks remain separate. Partial-frame follow-up (`25ee0c70`): a distinct probe now sends valid authenticated JSON shorter than the payload cap without LF, half-closes only the write side, and verifies `invalid_request`, zero dispatch and connection/thread release. The stalled open-peer oversized case remains separate. Hopper/Cutter focused tests passed 7/7 and `check:fast` passed on Node 24; this is bridge-fixture proof, not a real Hopper/Cutter run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:29 +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#6846
No description provided.