Skip to content

fix(cursor): bound fragmented transport cost and audit context accounting #431

Closed

Description

@tt-a1i

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.

Activity

  1. tt-a1i commented on Sep 7, 2026

    @tt-a1i
    CollaboratorAuthor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions