Skip to content

fix(server): bound live event buffers for slow clients - #293

Merged
rynfar merged 1 commit into
pylonfrom
upstream/2026-09-06-live-stream-budget
Sep 6, 2026
Merged

fix(server): bound live event buffers for slow clients#293
rynfar merged 1 commit into
pylonfrom
upstream/2026-09-06-live-stream-budget

Conversation

@rynfar

@rynfar rynfar commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

A slow or disconnected client could retain an unbounded queue of live events and exhaust the Pylon server’s memory. Bound each shell/thread subscription to 1,000 items and 8 MiB, including coalesced batches and the batch awaiting acknowledgement. Overflow detaches the producer immediately and returns the existing recoverable stream error so clients resume from their last applied sequence.

Adopts approved B2, upstream #9715, 108f295cc3672716c3cb8291ce487846df5ce098. Preserves Pylon’s startup subscription attachment, replay ordering, deletion recovery and rollback event routing. Authoritative snapshots stay outside the live-event budget. Applies to every provider and web, desktop and mobile, including remote/relay/tunnel connections.

Validation: 166 focused budget, coalescer and WebSocket server tests plus 18 shared client synchronization/error tests pass. Held-ACK tests verify producer cleanup before acknowledgement and exact replay/deletion recovery. Scoped server/client-runtime types, targeted lint and diff checks pass. No live environment state was used.

Model: GPT-6 Astra. Harness: Codex.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

(cherry picked from commit 108f295cc3672716c3cb8291ce487846df5ce098)
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB −1 B (−0.0%) 15.1 KiB
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +2 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −3 B (−0.0%) 7.8 KiB
Codex Live turn WebSocket decoded 56.5 KiB 56.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 8 8 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.7 KiB +10 B (+0.1%) 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.1 KiB +8 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.6 KiB +2 B (+0.0%) 7.8 KiB
Claude Live turn WebSocket decoded 57.3 KiB 57.3 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 8 8 0 (0.0%) 21

Baseline: c3fbc15 · PR result: ced82a3 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 111.2 KiB
  • Claude decoded thread snapshot: 111.9 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit 7262982 into pylon Sep 6, 2026
17 checks passed
@rynfar
rynfar deleted the upstream/2026-09-06-live-stream-budget branch September 6, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants