Repository navigation
perf(daemon): make droppable stream tracking constant-time - #10121
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe change centralizes daemon stream droppability evaluation in shared helpers and tracks droppable sessions with per-batch sets. Queue append operations now return updated session totals, while enqueue, flush, and session flush paths synchronize membership. The daemon refreshes droppability during session attachment, background-state changes, and subprocess exits. New tests cover membership evaluation, trimming, draining, control entries, and lifecycle ordering. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Description
recounting every queued session on every hidden-output chunk.
pending client batch on background changes, attach completion, and exit.
transformed empty spans, gap/query salvage ordering, and the legacy last-evaluated-count timing.
discard all state.
cross-client held batches, and exit output held behind socket backpressure.
ELI5
Orca used to ask every waiting hidden terminal, “Are you hidden?” whenever one hidden terminal
produced another piece of output. Now each delivery batch keeps a small attendance list and updates it
only when a terminal joins, leaves, hides, reveals, attaches, or exits. The existing rules for which
old output is kept are unchanged.
Proof of zero regression
remaining findings after tracing every membership mutation and lifecycle boundary.
git diff --checkpassed.pnpm run lintpasses oxlint, switch exhaustiveness, styled-scrollbar, reliability,max-lines, and bundled-guide stages before the pre-existing released
orca-clirevision-9manifest blocker. This diff changes no skill or manifest files.
delayed count updates after shrink/regrow, foreground/background marker order, attach routing,
partial/final drain, targeted flush, cross-client refresh, and exit-held tails.
same batcher. Direct SSH/relay PTY delivery uses its separate existing batching path and is
unchanged.
Proof of performance improvement
chunks to one already-queued hidden producer.
visits: exactly 101,000
isSessionDroppablecalls and 100,000 Map-entry visits.entries,values, orforEachcalls. It performs exactly 1,000 keyed Map reads, 1,000 keyed Mapwrites, and 1,000 Set membership checks while preserving exactly 1,400 total queued characters.
chunks. A newly queued session and a cross-client lifecycle refresh each make exactly one
droppability predicate call.
aggregate keep-tail budget and reveal-latency protection are unchanged.