perf(pa-tui): feed the tray context usage off the attach snapshot, not a blocking first-frame stats fetch - #3334
kevinjosethomas wants to merge 3 commits into
Conversation
…t a blocking first-frame stats fetch
…or's coordination log; durable state documentation per the orchestrator's ruling)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d949b04. Configure here.
| 2026-10-03 12:36Z Small block1 complete 12/36 raw legs, small block2 starting, no process census failures. Parent updated; original gate binding known-red-only, gate2 queued. | ||
| 2026-10-03 12:40Z Clean ABBA 18/36 raw legs, all small-class blocks complete, every before/after leg census empty after scoped TERM/reap; canon class next. Sole gate rerun queued pool, driver alive. | ||
| 2026-10-03 12:45Z Clean replication 24/36 raw legs (canon block0 full six legs) complete, per-leg process census zero after scoped reaping; canon blocks 1/2 remain. Gate2 driver alive waiting pool, no verdict. | ||
| 2026-10-03 12:50Z Clean replication 30/36 raw legs (canon block1 complete), every pre/post process census zero following scoped worker TERM/reap; canon block2 and pyte controls remain. Gate2 queued, driver live. |
There was a problem hiding this comment.
Accidental lane recovery journal
Low Severity
LANE-STATE.md is a live operator recovery journal with PIDs, VM ids, and experiment notes. Nothing in the repo reads it, and the PR's intended bench record lives under data/hillclimb. Merging it would land stale working notes at the repository root.
Triggered by project rule: Review rules
Reviewed by Cursor Bugbot for commit d949b04. Configure here.
There was a problem hiding this comment.
Acknowledged: LANE-STATE.md is an operator recovery journal, not a runtime dependency or product API. It was intentionally committed as the durable incident/coordination receipt after two live workers collided on the same bench VM; the PR body and bench record now carry the final signed outcomes. I am leaving the file on this PR for the operator's explicit disposition rather than rewriting the reviewed head only to erase the incident trail. It does not affect the production tree or test selection; CI is green. If the maintainer wants it kept only outside the product repository, it can be dropped at the merge-time fold without carrying into main. The bot's low-severity hygiene concern is valid and disclosed in the approval packet.
… into lane/perf-stats-defer-fast


Evidence
Full-suite VM gate — fleet_pipeline.fleet_gate
gate_1791028107_2563054(host logs: /home/ubuntu/fleet-pipeline-runs/gate_1791028107_2563054)ac49924362d223230a0ce789005d966603dbadf4on org/rust tipe38702160795b172b1f9f66a4a97a5debd060f57(merge-basee38702160795b172b1f9f66a4a97a5debd060f57, base folded)jlyaqo3a4nele1u22zxqzfp7)cargo fmt --all --check: rc 0cargo clippy --workspace --all-targets -D warnings: rc 0cargo test --workspace --no-fail-fast: rc 101tui_prompt_stash_restores_a_pasted_image_with_the_draft-> KNOWN-RED (auto-attached): rotating flake (pa-cli interactive_daemon_e2e): red in a concurrent full-suite VM run, green in CI on the same head (evidence: 2026-09-25 review run review_1790305784 (head 0a1b73f, VM-0): tui_prompt_stash_restores_a_pasted_image_with_the_draft red in the concurrent focused-test run while CI (check+clippy+test workspace, same head) is green; the cursor-glitch lane (pa-tui: hide the hardware cursor by default (TS showHardwareCursor parity), position it for IME on every frame #2734, merged) hit the prompt-stash family in its VM gate and solo-proved it green; the sibling member tui_prompt_stash_round_trips_across_in_place_switch passed in the same run RENEWED 2026-09-28 (digest-capture placement lane, expired-entry re-triage per the rule): fired co-scheduled in the fresh-VM full gate gate_1790623213 at the folded head 24ef25d (with its territory-sibling tui_refused_draft, the bounded_wait_starvation member); SOLO-GREEN x3 at the exact head on the same fresh VM (6.91s/5.97s/5.42s); the same head's GitHub CI pa-cli shards green. Expiry aligned with the same-day bounded_wait_starvation family. | RENEWED 2026-09-29 (pre-expiry sweep; quiet triage VM t2llr6av8eb4g1dxyt9wzp8a; pinned tip 3e98be8; gate-env recipe; --test-threads=1): SOLO x3 GREEN (15.61s/8.61s/9.99s). | CENSUS (fleet gate/review runs 2026-09-24..29; 921 verdict-carrying): 14 fires (11 auto-classified + 3 unknown/expired-classified) across 11 heads / 10 VMs / 3 days (2026-09-25..2026-09-29), last 2026-09-29 | REOPEN: a NEW stash/draft signature, a solo red, or a CI reproduction (the family is CI-green to date; module-mates share the interactive_daemon_e2e harness). Expiry extended to 2026-10-06.);tui_refused_submit_restores_the_draft_after_the_round_trip-> KNOWN-RED (auto-attached): MEMBER (first fire; the test landed with perf(pa-tui): submit prompt off the render path - TS onSubmit parity (ordered FIFO worker; ack p50 1.8->0.2ms) #2868 on 2026-09-26) of the FULL-SUITE CO-SCHEDULED BOUNDED-WAIT STARVATION (not a product bug; the bounded-wait/turn/timing tests added ~2026-09-26 starve under the full-suite's parallel load on the pooled gate VMs: the 60s held-provider wait, the 60s follow-up wait, and the TUI error-row render wait overrun their bounds while the same suites run GREEN in the CI's 4-shard split and GREEN SOLO). The family rotates: run-1 fires abort_and_send_queued_acks (run-2 passes it), run-2 fires kill_cancels_mid_provider_wait + tui_refused_draft - never the same member twice in a row, never solo, never in CI. [SWEEP 2026-09-29: a solo red on the sweep VM's fsync regime - the 5731b28 environmental class's stall arm; 2/3 green] (evidence: ROTATION PROOF at the digest-capture lane head 4c015e7 (test-only PR test(pa-core): the compact digest-capture placement oracles - the ENTER capture is the TS-parity shield (byte-identity across placements in frozen windows; the racing class) #3006, pa-core harness_digest.rs tests; the pa-daemon/pa-cli trees BYTE-IDENTICAL to base b89b8ff): full gate_1790615320 RED on worker::turn_stream_tests::abort_and_send_queued_acks_before_the_follow_up_delivery alone ('the follow-up never started after the abort ack', 60s+ overrun; SOLO-GREEN x3 at the exact head 2.11s/1.01s/1.55s); the 1+1 rerun gate_1790616926 (same head, same VM ffi1sgbkvh9iuasrslibcuab) RED on a DIFFERENT pair - tui_refused_submit_restores_the_draft_after_the_round_trip (pa-cli interactive_daemon_e2e.rs:4716 'the refused submit surfaced the error row'; SOLO-GREEN x3 4.29s/3.56s/2.99s) + worker::tests::kill_cancels_a_mid_provider_wait_turn_and_surfaces_the_aborted_row (worker/tests.rs:1430 'kill waited out the held provider response (60.017s)'; SOLO-GREEN x3 1.12s/1.07s/1.10s) - while run-1's member PASSED. The same head's GitHub CI: test shards 4/4 GREEN (the sharded split runs the same suites without the starvation). CENSUS: kill_cancels has fired UNKNOWN-classified in 9 co-scheduled full-suite gates 2026-09-26..28 (gate_1790397365/398917/400664/401934/455545/464592/549076 + both digest-capture gates) - never registered, always co-scheduled; abort_and_send_queued_acks red only in co-scheduled runs per the dead_sidecar entry's census (09-25/09-27 eras); tui_refused is a first fire (the test landed with perf(pa-tui): submit prompt off the render path - TS onSubmit parity (ordered FIFO worker; ack p50 1.8->0.2ms) #2868, 2026-09-26). RERUN DISCIPLINE honored: 1+1 then stop (no third rerun attempted). FALSIFICATION ANNOTATION (2026-09-28, the operator's ruling: annotate, do not rescope): the member's classification was VALID at 24ef25d (solo-green x3, the co-scheduled-only fire); at the final folded head ae542c6 it is a DETERMINISTIC BASE RED — SOLO-RED 3/3 at the lane head AND at the pure base c85b8e0 (7.37/6.34/6.44s and 6.95/6.53/6.47s), GREEN on the CI's runners at the same head (pa-cli#test:interactive_daemon_e2e PASS 22.5s) — a NEW environment-sensitive base red in the 30808d2..c85b8e0 window (the TUI render territory; pa-tui: the terminal-state differential - every armed mode restores on every exit route #3002 the terminal-state differential and pa-tui/pa-ai/pa-agent: /tier command + Default service tier settings row + footer badge + completions service_tier forwarding + proxy serviceTier (TS #2144 half + #2491 half) #2735 the /tier badge the flagged suspects; the bisect triage owns the separation). The member's reopen trigger fired correctly (the head-bound receipt discipline caught what the entry's blanket would have masked); the OTHER members' classifications stand with their receipts at their heads. BISECT OUTCOME (2026-09-28, the wave-6 triage lane perf-refused-submit-bisect; bench record 20260928-214900-triage-tui-refused-base-red-window-falsified, evidence sha b2d079f7): the window attribution above is FALSIFIED - no culprit commit exists in 30808d2..c85b8e0. (1) An 11-head walk (2 runs/head) + spaced isolated batteries (6 runs/head, 15s spacing) on the pinned gate VM kbfkp829: the red fires at the GREEN endpoint 30808d2 (2R/4G), at PRE-window b89b8ff pa-cli: print_boundary.rs split - the 4 stages: events, compaction_arms, autorefine, tests #2989 (1R/5G), and at this lane's own green head 24ef25d (2R/4G) - all the uniform 4716 signature; a fresh-VM control (the same recipe, tree-clean asserted) runs all four heads 24/24 GREEN in the calm regime (fsync p50 41-110ms). The 'DETERMINISTIC BASE RED' was a regime drawing (their post-gate writeback-stalled VM), not a head property. (2) The mechanism, byte-level (strace -f -tt at c85b8e0): GREEN = the Kill resolves by +413ms (the tombstone+teardown fsyncs ~6ms) and the +906ms submit is REFUSED ('Unknown active session') in 0.8ms -> submit_prompt Err -> the error row + draft render (the TS onSubmit-catch ladder); RED (induced on demand by a 3-writer fsync storm, 1/13) = the tombstone fsync stalls 652.7ms, the submit lands +903ms INSIDE the stalled window, the daemon ACCEPTS it (success:true), the kill lands mid-turn and the turn dies with NO rendered outcome -> assert 4716. The flip rate is the regime's fsync-stall probability (a 627.7ms natural fsync stall observed on the same VM; CI's sub-ms fsyncs keep a ~490ms margin -> CI green is the contract). The race contract (the test's sleep(400ms)+WaitMs(900) clock vs the Kill handler's persist_stop_tombstone fsync: routing.rs:401 + descriptor.rs write_file_atomic sync_all) is byte-identical at PRE-window b89b8ff. GATE USAGE: a VM-gate red of this member cites the record - the standing environmental class (I/O-regime-gated kill-vs-submit race), NOT a base regression, NOT window-caused; the solo-fire arm refines the family's trigger beyond co-scheduled CPU starvation to stalled-fsync regimes (post-build/post-gate writeback included). The fix decision routes to the test's owner (both sides the port's own, pre-window): margin-widening alone is green-fishing-adjacent; a deterministic barrier needs a kill-visible frame signal (the kill produces no frame change today) or an external-condition wait; the product-side mid-turn-kill parity question is separate scope. | RENEWED 2026-09-29 (pre-expiry sweep; quiet triage VM t2llr6av8eb4g1dxyt9wzp8a; pinned tip 3e98be8; gate-env recipe; --test-threads=1): SOLO x3: 2 GREEN (2.28s/2.58s) + 1 RED (iter 2, 2.73s: panicked at interactive_daemon_e2e.rs:5401 'the refused submit surfaced the error row' - the entry's own standing environmental class per record 5731b28, the fixed-clock race vs the persist_stop_tombstone fsync stall, fired solo on this VM's fsync regime; NOT re-run past x3 per the no-green-fishing discipline) | CENSUS (fleet gate/review runs 2026-09-24..29; 921 verdict-carrying): 16 fires (14 auto-classified + 2 unknown/expired-classified) across 14 heads / 9 VMs / 2 days (2026-09-28..2026-09-29), last 2026-09-29 | REOPEN: a NEW failure signature outside the class, a REPRODUCIBLE solo red on a calm-regime VM (the 2026-09-29 sweep observed 1/3 on the sweep VM's fsync regime, the 5731b28 stall arm; the refused-submit-bisect calm-regime control was 24/24 green - a reproducible calm-regime solo red reopens the code question), or a CI-shard reproduction. Expiry extended to 2026-10-06. | TRIAGE (x24 calm-control battery on triage VM h4zf5ktroa5f2dqj0lcmibi0, same pinned tip, --test-threads=1, fsync probe /tmp p50=210.14ms = NOT the calm regime): 23 GREEN (2.7s typ) + 1 RED (iter 13, 2.7s, the same error-row signature) = 1/24 on the slow-regime VM - consistent with the 5731b28 standing environmental class's stall arm (that lane's CALM-regime control was 24/24 green; the natural-stall rate here matches its storm-rate class); in-class, no re-run past the x24 control.);worker::compaction_admission_tests::steer_mid_compaction_defers_and_delivers_after_the_window-> KNOWN-RED (auto-attached): MEMBER (appended 2026-09-28 per the operator's disposition: fix(pa-daemon): the compacting admission gate - a racing turn defers through the compaction window, the parked work delivers after it #3021's own admission test, fired co-scheduled-only in the fresh-VM full gate gate_1790625123 at the folded head ae542c6 with its own SOLO-GREEN x3 at that head, 1.51s x3) of the FULL-SUITE CO-SCHEDULED BOUNDED-WAIT STARVATION (not a product bug; the bounded-wait/turn/timing tests added ~2026-09-26 starve under the full-suite's parallel load on the pooled gate VMs: the 60s held-provider wait, the 60s follow-up wait, and the TUI error-row render wait overrun their bounds while the same suites run GREEN in the CI's 4-shard split and GREEN SOLO). The family rotates: run-1 fires abort_and_send_queued_acks (run-2 passes it), run-2 fires kill_cancels_mid_provider_wait + tui_refused_draft - never the same member twice in a row, never solo, never in CI. (evidence: ROTATION PROOF at the digest-capture lane head 4c015e7 (test-only PR test(pa-core): the compact digest-capture placement oracles - the ENTER capture is the TS-parity shield (byte-identity across placements in frozen windows; the racing class) #3006, pa-core harness_digest.rs tests; the pa-daemon/pa-cli trees BYTE-IDENTICAL to base b89b8ff): full gate_1790615320 RED on worker::turn_stream_tests::abort_and_send_queued_acks_before_the_follow_up_delivery alone ('the follow-up never started after the abort ack', 60s+ overrun; SOLO-GREEN x3 at the exact head 2.11s/1.01s/1.55s); the 1+1 rerun gate_1790616926 (same head, same VM ffi1sgbkvh9iuasrslibcuab) RED on a DIFFERENT pair - tui_refused_submit_restores_the_draft_after_the_round_trip (pa-cli interactive_daemon_e2e.rs:4716 'the refused submit surfaced the error row'; SOLO-GREEN x3 4.29s/3.56s/2.99s) + worker::tests::kill_cancels_a_mid_provider_wait_turn_and_surfaces_the_aborted_row (worker/tests.rs:1430 'kill waited out the held provider response (60.017s)'; SOLO-GREEN x3 1.12s/1.07s/1.10s) - while run-1's member PASSED. The same head's GitHub CI: test shards 4/4 GREEN (the sharded split runs the same suites without the starvation). CENSUS: kill_cancels has fired UNKNOWN-classified in 9 co-scheduled full-suite gates 2026-09-26..28 (gate_1790397365/398917/400664/401934/455545/464592/549076 + both digest-capture gates) - never registered, always co-scheduled; abort_and_send_queued_acks red only in co-scheduled runs per the dead_sidecar entry's census (09-25/09-27 eras); tui_refused is a first fire (the test landed with perf(pa-tui): submit prompt off the render path - TS onSubmit parity (ordered FIFO worker; ack p50 1.8->0.2ms) #2868, 2026-09-26). RERUN DISCIPLINE honored: 1+1 then stop (no third rerun attempted). MEMBER APPEND (2026-09-28, the digest-capture lane's final-head gate): steer_mid_compaction_defers_and_delivers_after_the_window (crates/pa-daemon worker::compaction_admission_tests — the fix(pa-daemon): the compacting admission gate - a racing turn defers through the compaction window, the parked work delivers after it #3021 compacting-admission-gate lane's own test) fired co-scheduled in the fresh-VM full gate gate_1790625123 at ae542c6; SOLO-GREEN x3 at the exact head on the same fresh VM (1.51s x1.51s x1.51s); the rotation-consistent shape (never solo-red). Appended per the Hillclimb operator's disposition with the family's append rule met (own solo x3 + census). | RENEWED 2026-09-29 (pre-expiry sweep; quiet triage VM t2llr6av8eb4g1dxyt9wzp8a; pinned tip 3e98be8; gate-env recipe; --test-threads=1): SOLO x3 GREEN (1.60s/1.60s/1.60s). | CENSUS (fleet gate/review runs 2026-09-24..29; 921 verdict-carrying): 5 fires (3 auto-classified + 2 unknown/expired-classified) across 5 heads / 3 VMs / 2 days (2026-09-28..2026-09-29), last 2026-09-29 | REOPEN: a NEW failure signature outside the starvation class, a SOLO red at any head (the class is solo-green at the tip), a CI-shard reproduction (the family is CI-clean to date), or the family's red shape with a solo reproduction (then it is a code red, not load). Expiry extended to 2026-10-06.)What
The TUI's open path — and every agents-view switch re-entry — no longer blocks its first frame on a
get_session_statsdaemon round-trip just to paint the tray's context-usage row. The worker's attach snapshot now carriescontextUsage, the field TS'screateAgentConnectionStatefills on every attach (packages/coding-agent/src/modes/agent-connection/snapshot.ts:56,contextUsage: session.getContextUsage()); the client reads it off the snapshot exactly like the other reconstructed session fields. TS's open path never blocks its first frame ongetSessionStats— its stats refreshes (refreshConnectionContextUsage) run only after a turn or a compaction settles, which the loop's settle arms keep doing unchanged.The port's
AgentConnectionState.context_usagefield already existed on the wire but was alwaysNone; the port compensated with the blocking fetch the TS open path never had. This restores the TS shape and removes the round-trip.Where
pa-daemonconnection_state_locked: fillscontext_usagewith the same store walkget_session_statsserves (session_stats::store_context_usage), under the same core lock the attach already holds;Nonewithout a model context window, exactly like the stats response (scripted-engine goldens unchanged).pa-tuireconstruct: readsstate.contextUsage(ContextUsage::from_wire, the same parserefresh_statsused — unknown tokens right after a compaction clear the tray, TSpatchConnectionState).pa-tuiattach_session: applies it with the other reconstructed fields (TSapplyConnectionStateSnapshotreplaces the usage at every attach).pa-tuiopen path (interactive/run.rs),/new, and/switch: the blockingrefresh_stats()before the rebuild is gone. The settled-turn and post-compaction refreshes are untouched.Evidence — authoritative clean campaign (fresh VM, 40/40 host-downloaded legs)
get_session_statscensus 3/3 at tip → 0/3 at cut. The original current-tiprefresh_statsspan was 11–13 ms in the 7,390-message fixture. The cut moves the same context-usage walk into the attach snapshot, matching the TScreateAgentConnectionStatesource; turn/compaction refreshes remain.sbrstgcgisdh0cz3hckqpc6k, exact source tipe3870216079and cutac49924362d2, fresh release binary SHAs471e092c…andf1c499e0…asserted per leg. Same exact fixture SHAs; tip/cut/cut/tip/tip/cut ×3 blocks per class, 36 raw trials plus four pyte-fed controls. Every leg was downloaded and SHA-logged to the host before the next leg; 201 cumulative process-census snapshots were empty after scoped worker TERM/reap, 40 binary receipts, 83 I/O probes (80 per-leg + pre/post campaign + one harmless extra probe before a failed pre-control label format). No benchmark trial excluded or selectively rerun.[−0.366,−2.119,−12.980],[−0.144,+1.128,−1.015],[−0.846,−0.808,+0.771]ms. Tails and adverse pairs are retained.[−20.377,−26.954,+15.620],[+12.265,−29.164,+20.927],[−1.549,−9.115,+11.392]ms. The ±20–30 ms swings and fresh-write probe p50 moving between ~0.7–1 ms and ~25–33 ms make the canonical wall result regime-dominated: claim neither a canonical speedup nor a robust regression. The original 144.2 ms current-tip number is method history only, not the authority.?2026raw-byte parser PASS on both classes (9 tip + 9 cut trials each), zero cross-arm frame diffs, zero A/A diffs after masking only the trial-name title; first-screen tray rows byte-identical (9.4k (7%)small;130 (0%)canon). The real empty-store daemon/TUI oracle ran after the benchmark: tip/cut/cut/tip first screens all show the same0 (0%)tray; sole row difference is the volatile trial-name title, within the A/A floor.286657b444183045e9c558be3e61dad055bbaccc17dc624b723fe7962c71f9f2(18.16 MB, every leg trace/raw/probes/census/sha plus both oracle verdicts). The original archive shade4f8040…remains the method-history/instrumentation receipt.Gates and CI
MERGE-TIME FOLD IN PROGRESS (2026-10-03 17:33Z): folded the reviewed
d949b04c2into maine22fcd5fbda6as PR head747ade73617095459d2f931cf002795828a39c56(foldfold_1791048745_2791105). Diff verification: main moved exactly 17 files, all in pa-daemon parent/child/registry areas, with zero overlap with this lane’s 11 touched paths; each of the 11 lane-touched blobs is byte-identical at old and folded heads. The old-head exact reviewreview_1791047772_2791105is GREEN (fmt/clippy/focused tests rc0, zero blockers). The folded-head full gategate_1791048804_2791105is GREEN (fmt/clippy/full workspace test rc0, zero failures/unknowns). Folded-head focused reviewreview_1791048804_2791105RED on one active registered worker-route flake; authorized same-SHA 1+1 rerunreview_1791049741_2791105finished GREEN (fmt/clippy/focused tests rc0, zero blockers/unknowns). No solo or third rerun. CI is 25 pass, two non-required skips, zero failure/pending. New stale-base advisory: org/main moved again from e22fcd5 to e78f11f by review completion. Operator RULING: hold the current reviewed/gated747ade736while main is actively moving; do NOT re-fold now. At Kevin's merge election (including the journal DROP-vs-LAND choice), if main remains ahead, perform ONE final fold on the stabilized tip with byte-identity mapping verification and re-gate/re-review/CI on the exact combined head before merge. R4’s standing verdict must bind to this folded head; no merge until all receipts and Kevin’s incident-journal election.Exact source head
ac49924362d2on org/rust basee3870216079:cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningspass in both full-suite VM gates.Gate
gate_1791028107_2563054:RED_KNOWN_REDS, exactly three ACTIVE registered timing reds, zero unknown. Authorized sole 1+1 rerungate_1791030386_2791105: three active known-red families (queued-prompts render replaces gate1 prompt-stash; refused-draft and steer-mid-compaction recur) plus one first-fire UNKNOWNkill_cancels_goal_and_heartbeat_and_no_wake_revives_the_session. Head-bound triage: same-head solo 3/3 green (14.44/14.19/14.80 s) on a fresh pinned-toolchain VM; closelistener3 independently traced the pre-existing supervisor tombstone-adoption race on main (outside this TUI stats cut). No third gate. Both verdicts and triage receipts are in the bench record.Previous PR head
d949b04c2f9b024e4480f939a26445203793ddfdadded only theLANE-STATE.mdincident journal atop gated sourceac4992436; production tree was byte-identical. Its CI passed (8/8 shards) and exact reviewreview_1791047772_2791105was GREEN (fmt/clippy/focused tests rc0, zero blockers/unknown). The unresolved Bugbot journal thread remains an explicit Kevin election, not a silent pass.Parity
contextUsage; the open path never blocks on a stats fetch; turn/compaction refreshes unchanged./new,/switch, the supersede-rebind, and the recovery reattach now update the tray from their attach snapshots (the same values the removed blocking fetch returned); disclosed in the bench record.Bench record:
data/hillclimb/experiments/20261003-125000-interaction-statsdefer-firstframe.jsonat bench commitbdbbdcb6c8bc58d89c8894d0b268e1cdd980966d; authoritative fresh evidence archive sha286657b444183045e9c558be3e61dad055bbaccc17dc624b723fe7962c71f9f2(18.16 MB, host-saved 40/40 legs and both oracle verdicts). Original archive shade4f8040…is method history only.Note
Low Risk
First-frame UX/perf path only: an existing wire field is populated and blocking stats fetches are removed on attach paths; turn/compaction refreshes unchanged. Tray may clear sooner when usage is unknown on the wire.
Overview
Aligns the Rust TUI with TypeScript: tray context usage (
N (P%)) comes from the attach snapshot’scontextUsageon first paint, instead of a blockingget_session_statsround-trip on open,/new, and session switch.The daemon now fills
context_usagein the attach connection state via the samestore_context_usagewalk asget_session_stats(omitted when there is no model context window). The TUI reconstructs that field from the snapshot, applies it on attach/rebind, and centralizes wire parsing inContextUsage::from_wire(unknown/null tokens clear the tray, matching TSpatchConnectionState). Post-turn and post-compactionrefresh_statsbehavior is unchanged.Adds daemon and snapshot unit tests for snapshot/stats parity and the three wire shapes. Also adds
LANE-STATE.mdas an operator bench/gate journal (non-runtime).Reviewed by Cursor Bugbot for commit 747ade7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Feed pa-tui tray context usage from attach snapshot, not blocking stats fetch
Worker::summary_locked(summary.rs); the field is omitted when no store or model context window exists.state.contextUsagevia newContextUsage::from_wire(chrome.rs) and reconstructs it in the attach snapshot (snapshot.rs).refresh_statscalls from startup (run.rs), new-session, and session-switch paths; the view rebuild uses the attach snapshot instead.tokens/contextWindowfields now clear the tray context usage, including the post-compaction unknown-usage shape (lifecycle.rs).Macroscope summarized 747ade7.