[PR #5372] [MERGED] fix(pwndbg): separate the words in the debugger-context limit message #6906

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5372
Author: @XiaoBinGan
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @morluto

Base: main ← Head: fix/pwndbg-output-limit-message


📝 Commits (1)

  • 0825cef fix(pwndbg): separate the words in the debugger-context limit message

📊 Changes

3 files changed (+13 additions, -4 deletions)

View changed files

📝 bridge/pwndbg/core_context.py (+1 -1)
📝 bridge/pwndbg/test_core_context.py (+11 -2)
📝 package.json (+1 -1)

📄 Description

Summary

When the complete recorded-crash debugger mapping context encodes above the 64 MiB reply budget, the pwndbg bridge refuses it with a message whose word and limit are joined: Complete debugger context exceeds64 MiB reply budget. This names the budget the same way the pwntools sibling already does, and adds the first producer regression for that refusal.

Fixes #5329

Problem and expected behavior

  • Smallest trigger: inspect-recorded-crash --debugger-context (MCP include_debugger_context: true) where the encoded mapping reply exceeds OUTPUT_BYTES in bridge/pwndbg/core_context.py, so the reply is replaced by the output-limit refusal object.
  • Violated invariant: a refusal that states a limit must state it readably. The rendered message joins "exceeds" and "64", reported on 39275420e and still present on 799e8265b (the string is unchanged between 048d70755 and 799e8265b).
  • Expected: Complete debugger context exceeds the 64 MiB reply budget., which is how bridge/pwntools/decoder_runtime.py words the same budget.

Change and scope

  • bridge/pwndbg/core_context.py: the refusal message only. The reason (output-limit), the 64 MiB limit, and the reply shape are untouched.
  • bridge/pwndbg/test_core_context.py: the existing inspect() fixture gains an objfile parameter, and a regression drives the real boundary by padding the mapping entry past OUTPUT_BYTES and asserting the reason, the exact message, and the absence of exceeds64.
  • package.json: the pwndbg suite was not part of test:python, so a producer regression there would never execute in CI. It is added to that command, which already runs the native and mitmproxy producer suites.
  • Not included: no change to the limit, the refusal contract, the pwntools bridge, or the documented output-limit behavior.

Contract and boundary impact

  • Semantic owner and earliest changed stage: pwndbg bridge producer, reply projection in bridge/pwndbg/core_context.py.
  • Contribution scope fit and linked maintainer decision: not applicable — an ordinary fix inside an existing boundary, no new provider or capability.
  • CLI and MCP/tool-catalog contract: message text only. reason: "output-limit" and the tool result remain unchanged, so no tool-catalog or metadata regeneration is involved.
  • Provider, bridge, target-format, or platform compatibility: pwndbg bridge only; the pwntools and Ghidra bridges are untouched.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged; the refusal still carries no partial context.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable — this path inspects an existing recorded snapshot and only allocates the bounded reserve it already allocated.
  • Generated metadata, package, or installation impact: none. The authored change is a package.json script argument, and no ignored catalog or skills/ output is touched.

Expected effects (check known effects; use documentation-only on its own).

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: bridge/pwndbg/test_core_context.py::test_output_limit_message_separates_the_words_and_names_the_limit.
  • Base reproduction or other evidence: with the pre-fix string restored in the same worktree, the suite fails on the new regression — AssertionError: 'exceeds64' unexpectedly found in 'Complete debugger context exceeds64 MiB reply budget.' (6 tests, FAILED (failures=1)). With the fix, 6 tests pass. The refusal is reached through the real 64 MiB comparison, not by patching the message.
  • User-visible CLI/MCP output (if applicable): {"ok": false, "reason": "output-limit", "message": "Complete debugger context exceeds the 64 MiB reply budget."}
  • Remaining proof gaps: no native GDB/pwndbg session was run here; like the report's reproduction, the producer test drives the real limit with the repository's own mocked GDB/pwndbg modules. The CI-visible effect is that test:python now executes this suite.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:python — 41 tests OK, then 81 tests OK (exit 0) on Node 24.18.0 with python3.14; this now includes bridge/pwndbg/test_core_context.py.
  • python3 -m unittest bridge/pwndbg/test_core_context.py — 6 tests OK.
  • python3 -m unittest bridge/pwndbg/test_core_context.py with the pre-fix message restored — FAILED (failures=1), 'exceeds64' unexpectedly found.
  • npm run format:check — "All matched files use the correct format" across 4126 files.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; a message string changes wording, not structure or meaning.
  • Real Hopper/Ghidra, browser, or OS coverage: none claimed; no real debugger session was run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; no target interaction, no new file or process access.

Author readiness

Human owner: @XiaoBinGan

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/5372 **Author:** [@XiaoBinGan](https://github.com/XiaoBinGan) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/pwndbg-output-limit-message` --- ### 📝 Commits (1) - [`0825cef`](https://github.com/morluto/rea/commit/0825cef9d295a45fbf37b686a0a118f74d7ff73c) fix(pwndbg): separate the words in the debugger-context limit message ### 📊 Changes **3 files changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `bridge/pwndbg/core_context.py` (+1 -1) 📝 `bridge/pwndbg/test_core_context.py` (+11 -2) 📝 `package.json` (+1 -1) </details> ### 📄 Description ## Summary When the complete recorded-crash debugger mapping context encodes above the 64 MiB reply budget, the pwndbg bridge refuses it with a message whose word and limit are joined: `Complete debugger context exceeds64 MiB reply budget.` This names the budget the same way the pwntools sibling already does, and adds the first producer regression for that refusal. Fixes #5329 ## Problem and expected behavior - Smallest trigger: `inspect-recorded-crash --debugger-context` (MCP `include_debugger_context: true`) where the encoded mapping reply exceeds `OUTPUT_BYTES` in `bridge/pwndbg/core_context.py`, so the reply is replaced by the output-limit refusal object. - Violated invariant: a refusal that states a limit must state it readably. The rendered message joins "exceeds" and "64", reported on `39275420e` and still present on `799e8265b` (the string is unchanged between `048d70755` and `799e8265b`). - Expected: `Complete debugger context exceeds the 64 MiB reply budget.`, which is how `bridge/pwntools/decoder_runtime.py` words the same budget. ## Change and scope - `bridge/pwndbg/core_context.py`: the refusal message only. The reason (`output-limit`), the 64 MiB limit, and the reply shape are untouched. - `bridge/pwndbg/test_core_context.py`: the existing `inspect()` fixture gains an `objfile` parameter, and a regression drives the real boundary by padding the mapping entry past `OUTPUT_BYTES` and asserting the reason, the exact message, and the absence of `exceeds64`. - `package.json`: the pwndbg suite was not part of `test:python`, so a producer regression there would never execute in CI. It is added to that command, which already runs the native and mitmproxy producer suites. - Not included: no change to the limit, the refusal contract, the pwntools bridge, or the documented output-limit behavior. ## Contract and boundary impact - Semantic owner and earliest changed stage: pwndbg bridge producer, reply projection in `bridge/pwndbg/core_context.py`. - Contribution scope fit and linked maintainer decision: not applicable — an ordinary fix inside an existing boundary, no new provider or capability. - CLI and MCP/tool-catalog contract: message text only. `reason: "output-limit"` and the tool result remain unchanged, so no tool-catalog or metadata regeneration is involved. - Provider, bridge, target-format, or platform compatibility: pwndbg bridge only; the pwntools and Ghidra bridges are untouched. - Evidence, artifact, provenance, or reconstruction contract: unchanged; the refusal still carries no partial context. - Target selection, authority, upstream behavior, and cleanup details: not applicable — this path inspects an existing recorded snapshot and only allocates the bounded reserve it already allocated. - Generated metadata, package, or installation impact: none. The authored change is a `package.json` script argument, and no ignored catalog or `skills/` output is touched. Expected effects (check known effects; use documentation-only on its own). - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `bridge/pwndbg/test_core_context.py::test_output_limit_message_separates_the_words_and_names_the_limit`. - Base reproduction or other evidence: with the pre-fix string restored in the same worktree, the suite fails on the new regression — `AssertionError: 'exceeds64' unexpectedly found in 'Complete debugger context exceeds64 MiB reply budget.'` (6 tests, `FAILED (failures=1)`). With the fix, 6 tests pass. The refusal is reached through the real 64 MiB comparison, not by patching the message. - User-visible CLI/MCP output (if applicable): `{"ok": false, "reason": "output-limit", "message": "Complete debugger context exceeds the 64 MiB reply budget."}` - Remaining proof gaps: no native GDB/pwndbg session was run here; like the report's reproduction, the producer test drives the real limit with the repository's own mocked GDB/pwndbg modules. The CI-visible effect is that `test:python` now executes this suite. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:python` — 41 tests OK, then 81 tests OK (exit 0) on Node 24.18.0 with python3.14; this now includes `bridge/pwndbg/test_core_context.py`. - `python3 -m unittest bridge/pwndbg/test_core_context.py` — 6 tests OK. - `python3 -m unittest bridge/pwndbg/test_core_context.py` with the pre-fix message restored — `FAILED (failures=1)`, `'exceeds64' unexpectedly found`. - `npm run format:check` — "All matched files use the correct format" across 4126 files. ## Compatibility, safety, and release - Breaking changes or migration steps: none; a message string changes wording, not structure or meaning. - Real Hopper/Ghidra, browser, or OS coverage: none claimed; no real debugger session was run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; no target interaction, no new file or process access. ## Author readiness Human owner: @XiaoBinGan - [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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <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:58 +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#6906
No description provided.