Closed
Description
Problem
Follow-up to #429 and v0.6.1: the Cursor receive loop repeatedly concatenates each fragmented Connect frame, causing quadratic copying. An 8 MiB synthetic frame in 16 KiB chunks copies about 2 GiB. Cursor also constructs history in both rootPromptMessagesJson and turns; that local duplication does not establish duplicate model context, so protocol and Pi compaction boundaries need verification before any semantic change. Long child transcript rendering has an existing candidate in #327.
Scope
- Replace quadratic frame accumulation while preserving frame limits, end/truncation errors, tool handoff, and cancellation.
- Verify Cursor context/usage behavior using current Pi and protocol evidence; retain unknown usage as unknown rather than fabricating accounting.
- Inspect perf(tui): bound repeated-id transcript result lookup #327 and long transcript rendering, preserving native tool output and layout correctness; avoid an overlapping viewport rewrite without measured benefit.
- Reproduce defects, add regression coverage, and deliver a reviewable PR with an evidence record.
No user runtime or configuration change is part of this repair.
Metadata
Metadata
Assignees
Labels
No labels
Activity
tt-a1i commentedon Sep 7, 2026
Repair and regression coverage are in #432. Canonical investigation.
Confirmed repairs: linear Connect frame copying and cwd-sensitive transcript cache. Context audit found both protocol history representations are needed; existing Pi zero-usage estimation remains intact, with new compaction/rebuild coverage. Full viewport rewrite remains in #327 pending separate validation.
Local checks passed, complete discovered suite passed at Node file concurrency 2 (1455 passed, one platform skip; Vitest 30/30). The default test attempt was interrupted under host scheduling delay, not reported as passed. Two independent code reviews are clean. Final-head CI passed on
84cc307e9af5c8fac0824619ab00814c19d7af5c: Node 22.19.0, Node 24 and Windows, including standard repository checks/tests and package smoke coverage. User runtime unchanged; PR not merged.