[PR #3267] [CLOSED] fix(rea): bound oversized SDK validation errors #5686

Closed
opened 2026-10-31 01:08:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3267
Author: @CRYPTONIKAV
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/3221-validation-budget


📝 Commits (2)

  • 8ac3286 fix(rea): bound oversized SDK validation errors
  • 4983770 test(rea): pin default budget in validation-budget test

📊 Changes

2 files changed (+94 additions, -2 deletions)

View changed files

📝 src/server/EvidenceMcpServer.ts (+36 -2)
📝 tests/process-global/mcpDeliveryEnvironment.test.ts (+58 -0)

📄 Description

Fixes #3221

What I changed

  • src/server/EvidenceMcpServer.ts (recoverError): SDK-built errors (input validation) carry no structured carrier, so they previously went out raw. Now, when such an error exceeds the response budget, it is replaced with a bounded resource_constraint diagnostic stating retention is unavailable (raw request arguments are excluded from retained Evidence by policy) with remediation to raise REA_MCP_MAX_RESPONSE_BYTES. Small validation errors pass through untouched.
  • tests/process-global/mcpDeliveryEnvironment.test.ts: oversized unknown key → bounded resource_constraint under budget; small unknown key → SDK text intact.

Verification

  • New test fails without the fix (10 MB echo), passes with it.
  • Delivery suite: 3 passed; tsc --noEmit clean; oxfmt --check clean.

Honest limits

  • Byte comparison is over the full JSON-RPC message (envelope overhead included): fail-safe direction, may replace a message a few dozen bytes under the raw budget.

Author readiness

Human owner:

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

🔄 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/3267 **Author:** [@CRYPTONIKAV](https://github.com/CRYPTONIKAV) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/3221-validation-budget` --- ### 📝 Commits (2) - [`8ac3286`](https://github.com/morluto/rea/commit/8ac3286860e7482006a283e247e39065d6b6fa85) fix(rea): bound oversized SDK validation errors - [`4983770`](https://github.com/morluto/rea/commit/498377035022accaccd1269483da3db1d94de645) test(rea): pin default budget in validation-budget test ### 📊 Changes **2 files changed** (+94 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/server/EvidenceMcpServer.ts` (+36 -2) 📝 `tests/process-global/mcpDeliveryEnvironment.test.ts` (+58 -0) </details> ### 📄 Description Fixes #3221 ## What I changed - `src/server/EvidenceMcpServer.ts` (`recoverError`): SDK-built errors (input validation) carry no structured carrier, so they previously went out raw. Now, when such an error exceeds the response budget, it is replaced with a bounded `resource_constraint` diagnostic stating retention is unavailable (raw request arguments are excluded from retained Evidence by policy) with remediation to raise `REA_MCP_MAX_RESPONSE_BYTES`. Small validation errors pass through untouched. - `tests/process-global/mcpDeliveryEnvironment.test.ts`: oversized unknown key → bounded `resource_constraint` under budget; small unknown key → SDK text intact. ## Verification - New test fails without the fix (10 MB echo), passes with it. - Delivery suite: 3 passed; `tsc --noEmit` clean; `oxfmt --check` clean. ## Honest limits - Byte comparison is over the full JSON-RPC message (envelope overhead included): fail-safe direction, may replace a message a few dozen bytes under the raw budget. ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:38 +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#5686
No description provided.