Skip to content

Merge Dev - streaming rate-limit, lineage cost reporting, v0.3.39#162

Merged
aliroberts merged 2 commits into
mainfrom
dev
Jun 24, 2026
Merged

Merge Dev - streaming rate-limit, lineage cost reporting, v0.3.39#162
aliroberts merged 2 commits into
mainfrom
dev

Conversation

@aliroberts

Copy link
Copy Markdown
Collaborator

CLI: streaming rate-limit, lineage cost reporting, v0.3.39

Relay broadcast batching (per-session Realtime rate cap)

The weco start claude relay now coalesces transcript broadcasts and rate-limits them so a single streaming session can never exceed a fixed messages/sec ceiling on Supabase Realtime — independent of how fast the SDK emits.

  • Lines that arrive within a flush window are batched into one transcript_batch event (array of lines) — coalesced, never dropped. Sparse output still sends immediately (no added latency); throttling only kicks in under load.
  • Hard guarantee: 1000 / WECO_RELAY_FLUSH_MS msgs/sec per session (default 100ms → ≤10/s), env-tunable.
  • Scrollback replay is batched the same way, so reconnect/takeover bursts also respect the cap. Oversized (>2.5MB) lines still fall back to transcript_chunk.
  • ⚠️ Deploy ordering: the dashboard must understand transcript_batch before this CLI ships (the dashboard handler is backward-compatible — handles both old transcript and new transcript_batch). Ship dashboard first, then this.

Lineage-wide cost reporting

Run cost now reflects the entire lineage (parent + derived runs), not just the single run — check_run_cost queries the new /billing/run/{id}/lineage-cost endpoint (a superset of the per-run cost).

Version

Bump to 0.3.39.

@aliroberts
aliroberts merged commit b2703e0 into main Jun 24, 2026
2 checks passed
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