Repository navigation
fix(acp): backport oversize-frame request failure to release/0.8.0 - #15575
Conversation
A reply over the ACP reader's 10 MB stdout frame limit is dropped to keep the demux alive, and the request it answered then timed out much later under an unrelated name: a session/new reply listing 50 agents with 113 KB welcomeMessage each surfaced as a "session/new timed out ... MCP server(s) reported" error. The drain keeps the line's first 4 KB. When that head is a reply envelope (no "method") whose numeric id is a pending awaited request, the request fails at once with AcpFrameTooLarge, naming the frame size, the limit and the usual cause. It is not transient, and a session/new or session/load failure keeps its session_start_failed tag so a self-driving caller still backs off. Other dropped frames keep the timeout path and the in-flight ids in the warning. Backport adaptation for release/0.8.0: the drain change is applied to _drain_oversize_line in acp/client.py, where release keeps it (main moved it to acp/transport_framing.py in #15153, which is not backported), and the session/new arm and its test use release's _record_session_start in acp/runtime.py (main: acp/runtime_start.py). (cherry picked from commit 27619cb)
Local test evidence on the release/0.8.0 tree (head
|
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the cherry-pick is line-identical to 27619cb on main as claimed — this review cannot diff against main, and the whole provenance rests on that fidelity. What this change shipsInventory (7 items) — 7 justifiedIntent: FIX — backport #15278 so a 0.8.0 request whose oversize reply was dropped fails at once naming the real cause, not a later "MCP servers" timeout.
[FIRST-PRINCIPLES-REVIEWED] c747de0 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Confirm the PR comment carries the claimed 1976-passed local run — backend CI skips release-branch PRs, so that comment is the only test evidence. [DESIGN-REVIEWED] c747de0 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Byte-identity and combined-tree checks (the review lanes asked for these; they have no shell)
Combined check across all eight 0.8.0 backports (#15574 to #15581). They octopus-merge cleanly onto release/0.8.0 @ 556bf8e (merge
|
Problem / Motivation
Goal: On a 0.8.0.x build, when kiro-cli's reply to a request is too large to read, the request fails at once with an error naming the reply's size and the limit, instead of timing out later with a misleading "MCP servers" message.
This backports #15278 to
release/0.8.0; it is already merged onmain(27619cb). On 0.8.0, a reply over the ACP reader's 10 MB stdout frame limit is dropped to keep the shared process alive. The request it answered then waits out its whole budget. Asession/newreply that lists 50 agents with 113 KBwelcomeMessageeach (about 11.7 MB with skill-view aliases) surfaces assession/new timed out after 90s (0/N MCP server(s) reported). Root cause and evidence are in #15278.Why it matters
0.8.0.x is on the stable channel, and this field report is on a 0.8.0.x build. Every session start on such a host fails the same way. Nothing the error points at (MCP servers, restarts,
setup --clean) helps, while the frame size, the limit and the usual cause are enough to fix it in one step.Not a goal
main.acp/transport_framing.pyandacp/runtime_start.py). It is not backported; see the adaptation below.CHANGELOG.md.What changed (motivation → approach → change)
One commit,
git cherry-pick -x 27619cb232(authorship kept), in the #11339 / #11645 / #15314 backport shape:acp/client.py_drain_oversize_line: keeps the dropped line's first 4 KB (head=,_OVERSIZE_HEAD_BYTES).acp/runtime.py: when that head is a reply envelope (no"method") whose numeric id is a pending awaited request, that request fails at once withAcpFrameTooLarge, naming the size, the limit and the usual cause. Thesession/newandsession/loadarms tag itsession_start_failed(andsession/newreleases its start permit), so a self-driving caller still backs off. Other dropped frames keep the timeout path.acp/session_handle.py:AcpFrameTooLarge(not transient).acp-client.mddocuments it.Backport adaptation. Two conflicts, both from #15153 not being on this branch. No behaviour differs from
main:mainthe drain lives inacp/transport_framing.py, which does not exist here. On this branch_drain_oversize_lineis still inacp/client.py, andruntime.pyimports it from there. The source's threetransport_framing.pyhunks are applied to that function unchanged; the added and removed lines are identical.main,_record_session_startlives inacp/runtime_start.py; on this branch it is inacp/runtime.py. The newsession/newarm calls the release name.test_an_oversize_session_new_reply_releases_its_start_permitpatches it onruntimerather thanruntime_start, with the same assertion. That test's import and patch target are the only test lines that differ from the source.Dependencies: none beyond the adaptation. This PR and the skill-view backport (#15140/#15132/#15202/#15177) commute: either order, or a merge of both, gives the same tree.
Backwards compatibility
Compatible: only a request whose reply was already being dropped changes, from a late timeout to an immediate
AcpFrameTooLarge. Other oversize frames are handled as before.Tests
The five tests from #15278 in
test/test_acp_runtime.py: the awaited request fails with the size and limit; a host request never fails one of ours; a start failure is tagged for bothcreateandload;session/newreleases its start permit; the id is read only from a reply envelope. Run on this branch (output in the PR comment):test_acp_runtime*.py,test_acp_client*.py,test_acp_session_handle_*.py).src/reverted torelease/0.8.0and the tests kept: all 5 oversize tests fail.Backend CI (
ci.yml) does not run on release-branch PRs, so these local runs are the backend evidence.Manual verification
N/A beyond #15278, whose field case was root-caused on the affected host. The reproduction here is the failing-then-passing unit contract on the release branch itself.
Related Issues
Backport of #15278 to
release/0.8.0.Pattern harvest
Rule candidate: review-prompt
Pattern: when a transport drops data to stay alive, fail the request the data answered with the real cause, rather than letting an unrelated timeout name it. (Harvested in #15278.)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement