Repository navigation
fix(mcp): bound unfinished request lines during assembly - #2067
rudycelekli wants to merge 3 commits into
Conversation
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
|
Integrated current main 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. |
|
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 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. |
|
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. |
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
b90b592d4f08c5c47d47f8c5d4d822b9fb3cbe0abefore the source fix.npm ci --ignore-scriptspassed using Node 22.19.0.npm test: 94 passed, 0 failed.npm run test:security: 24 passed.npm pack --dry-runpassed.npm audit --omit=optional: 0 vulnerabilities.git diff --checkpassed.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.