Skip to content

fix(mcp): bound unfinished request lines during assembly - #2067

Closed
rudycelekli wants to merge 3 commits into
ruvnet:mainfrom
rudycelekli:fix/ruview-mcp-framing-20261001
Closed

rudycelekli wants to merge 3 commits into
ruvnet:mainfrom
rudycelekli:fix/ruview-mcp-framing-20261001

Conversation

@rudycelekli

Copy link
Copy Markdown

What this fixes

The MCP request limit is checked only after readline assembles the complete line.

Reproduction

A real MCP child receives an unfinished 384 KiB line. Main does not discard it when the stated 256 KiB limit is crossed; it waits for newline and keeps buffering.

Change

Bound raw bytes during line assembly, discard only the oversized line until newline, and resume normal parsing. Preserve multibyte UTF-8 across chunks, FIFO tool execution, immediate health responses, and EOF draining.

Validation

  • Regression failed against upstream b90b592d4f08c5c47d47f8c5d4d822b9fb3cbe0a before the source fix.
  • npm ci --ignore-scripts passed using Node 22.19.0.
  • npm test: 94 passed, 0 failed.
  • npm run test:security: 24 passed.
  • Brain verification, Flywheel plan/replay self-test, provenance manifest verification, and npm pack --dry-run passed.
  • npm audit --omit=optional: 0 vulnerabilities.
  • Signed commit with DCO; git diff --check passed.

Limits

This verifies native stdio behavior. No hardware action, external service, or full Rust workspace run was required.

Hosted checks are not asserted here; these are local results for db310037c32e0095f8f5f84436b495b0eb7662f2.

rudycelekli and others added 2 commits October 1, 2026 01:16
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
@rudycelekli

Copy link
Copy Markdown
Author

Integrated current main 03a8979 with signed merge 569307c1 and regenerated the exact packaged-file provenance manifests. Reconciled the bounded stdio line reader onto the current shared dispatcher, preserving the HTTP/MCP Apps/umbrella transport contract; the independent transport replay passed15 tests.

Local current-main validation: ruview: pass 194, fail 0, skipped 1; homecore: pass 27, fail 0, skipped 0. Required security suites, brain verification, flywheel plan/replay, manifest verification, npm audit and pack dry-run all passed. The existing pinned generic kernel0.1.2 was loaded read-only for local validation; no hardware/device or sensing-accuracy proof is claimed.

Upstream workflows on this new head are pending/approval-gated; previous-head results are not evidence for the new head.

@rudycelekli

Copy link
Copy Markdown
Author

I've merged current main into this branch and regenerated both provenance manifests, preserving bounded stdio request-line assembly and the current shared dispatcher. The new head is 1bc863592aae2452124b44f70a9f1c02a063aee2.

Local checks passed: complete RuView suite (287 passed, 5 skipped), complete Homecore suite (27 passed), both security suites, brain and manifest verification, audit and package dry-runs, plus RuView flywheel plan/replay. GitHub currently reports no hosted check results.

@rudycelekli

Copy link
Copy Markdown
Author

Superseded by #2509. That branch rebases this patch onto current main together with the other harness fixes. They all rewrote the provenance manifests, so they could not merge separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant