Skip to content

feat(core): P3 first cut — patch bodies off the wire; the flood dies at the source (#1814) - #1817

Merged
aarontrowbridge merged 1 commit into
live-test/stack-e2efrom
opencode/issue-1814-patch-bodies
Oct 17, 2026
Merged

aarontrowbridge merged 1 commit into
live-test/stack-e2efrom
opencode/issue-1814-patch-bodies

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #1814. Part of #1803 (P3's first cut).

Main's 06eac85, ported — with the lane adaptation that makes it real: the lane serves TWO wire shapes off the shared replay buffer (the global route's frame.data AND the instance /event route's payload projection — the app's actual stream). A tap-only port would have left patch bodies flowing to the app; the strip is applied at both (wirePayload in global-replay.ts + event.ts's payloadOf). Sync copies are never stripped (the workspace replica keeps full records); in-process subscribers and storage keep everything.

The numbers (the '#1814 flood byte report' lines, greppable per #1802's discipline): a 22-event file-heavy turn (88 files × 30KB patches) went from 22 frames / 5,513,795 bytes (largest 2,688.5 KiB) to 22 frames / 25,803 bytes (largest 8.9 KiB) — 99.5% of the flood bytes cut at the source, the largest frame 28× under #1803's 256 KiB ceiling, and every summary's full 88-file list still rides the wire.

The expand-time fetch: no new route — GET /session/:id/message/:messageID serves the stored message with every patch; the app's per-turn diff view fetches on expand (one shared loader per directory, retry + fresh-on-summary-change pinned).

Suites: RED recorded (15/7 → 22/0 across the new batteries); engine lane zero NEW failures vs the environmental baseline; the app suite's failure set byte-identical at base; drift PASS (990 files). Post-deploy AC (the live flood rate dropping from the ~60fps baseline on the frontdoor cadence lines) runs at the next idle window — HITL.

…r-turn diff view fetches a patch on expand (#1778, #1814 P3)

Ports main's 06eac85 onto the lane's engine, adapted to its two wire shapes:

- bus/global-replay.ts: wirePayload/wireEvent strip each summary diff's
  patch body at serialization (the global route's frame data), while the
  frame's event object stays whole for in-process subscribers and storage;
  a sync copy is never stripped (its subscriber replays it into a store
  of its own that must keep the full record).
- handlers/event.ts: the instance /event route (the app's stream) projects
  its payload view from the frame's live event, so the strip is applied
  there too — the lane adaptation main does not need.
- session-ui: the per-turn diff view keeps the file list and counts from
  the live summary and fetches a patch on expand (summary-patch.ts loader,
  one fetch per turn shared across concurrent expands, retry on failure);
  the data provider takes onLoadSummaryDiffs; directory-layout supplies it
  from GET /session/:id/message/:messageID (the stored message is the
  patch source and keeps every body).
- app utils/diffs: a patch-less diff (file, status, counts) is the live
  wire form — valid, not dropped.

Flood byte report (test/server/httpapi-global-event.test.ts): a file-heavy
turn (20 edit completions + two 88-file summaries, 30 KB per patch) went
5.26 MiB -> 0.02 MiB total (99.5% cut); largest frame 2,688.5 KiB ->
8.9 KiB, under the 256 KB #1803 P3 ceiling. Main's shell-output throttling
(6fdcbb7) and its combined fixture-turn report (7252573) ride separate
commits and stay follow-up slices.

Verification (fresh materialized tree, env scrubbed): scoped new tests
22/0 (engine), 8/0 (session-ui summary-patch), 9/0 (app diffs); engine
lane 4064 pass / zero NEW failures vs the measured environmental
baseline; test/server 733/2 (the corpse pair), test/session 599 pass
(the Instruction.system pair red, in-baseline); engine typecheck OK
(#1229 base drift only); overlay typecheck: session-ui/ui/schema/sdk/llm
clean, app/core errors proven pre-existing at base (6/4, byte-identical
at HEAD without this change); session-ui suite 441/1 and app suite
failure set byte-identical at base (the CM-theme and 22 known families);
drift gate PASS (990 files).
@aarontrowbridge
aarontrowbridge merged commit 0e7bce8 into live-test/stack-e2e Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8782f79c-e4df-42f2-a8de-4276f4236e7c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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