Feat/repl long session perf#186
Merged
Merged
Conversation
…on true reset
The shrink-detector bumped the <Static> remount key whenever the
transcript array got shorter, but a cap-spill (front-slice at 500
blocks) shrinks it too — so every spill in a long session remounted
<Static> and synchronously repainted the whole sealed region.
Carry the cause explicitly instead of inferring it from shape:
- nextStaticEpoch(epoch, cause) pure fn — only cause='reset' advances
- epoch bump moved into the single clearBlocks reset funnel
(/clear, /clean, session reset all dispatch {type:'clear'} → here)
- <Static> key derives solely from clearEpoch; spill/append never touch it
Verified Ink's <Static> is append-only (renders items past its internal
index), so a front-slice spill needs no remount at all.
6-engine agon review: 0 blockers (review-1781036961532-9bg0c3).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
~/.agon/runs grew unbounded (once to 40k files) and the dashboard counted it with readdirSync inside the Ink render path. - signals/runs-store.kern: RunsStore singleton — async hydrate via node:fs/promises, sync zero-fs snapshot()/runCount() for render, debounced scheduleRefresh after recordRun, chunked auto-prune (keep <7d; beyond that newest 2000; hard cap 5000; never active-id exact-match or mtime<10min; 1h .prune-stamp cooldown doubling as the cross-process lock claim; in-process guard at entry) - app-blocks.kern dashboard reads the cached snapshot only - app.kern boot effect (1.5s, post-first-paint): hydrate → patch the already-rendered dashboard block in place → prune, strictly sequential - prune diagnostic gated behind AGON_DEBUG (never writes into the TUI) Run *directories* stay with core's existing pruneRuns; this bounds the run-record .json files the dashboard counts. Two 6-engine agon reviews: all important findings fixed or rejected with verification (review-1781038273655-uq8su5 + follow-up). Tests: runs-store 11/11; full suite 2249 green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… cache, calmer spinner Measured on a fat-block probe session (450 x 40-line tool blocks, 8 min): terminal stdout 101.4MB → 43.9MB (-57%), keystroke samples >100ms 14 → 4, >50ms 16 → 6, typing p50 ~10ms unchanged at every depth. - nativeArchiveBlockCount: maxLiveBlocks 80 → 40 — Ink rewrites the whole live tail every render (~15-30/s during runs), so the live window is the dominant stdout cost; sealed blocks render identically - per-block row cache in buildTranscriptRows (the commit-spike killer: every commit re-parsed ALL ≤500 blocks): explicit ALLOWLIST of neighbor-independent types only — tool-call/tool-call-group stay uncached (coalesced groups depend on neighbors + live status); key = block.id + fingerprint(type, engineId, tool, status, foldedSteps, color, critique, position, content length+head+tail, widths, mode, expand flags); true LRU (hits re-insert; evict oldest 20% at 1500); defensive copy on return; cache cleared in the clearBlocks reset funnel - liveSpinner/liveProgress throttle 50ms → 120ms (streamingText untouched) Property-style tests prove cached output deep-equals a cold rebuild across collapsed tool groups; 22 cache tests total. 6-engine agon review (review-1781041064100-187ta0): fingerprint gaps (color/critique/position/tail), FIFO→LRU, clear-on-reset, and by-reference return all fixed; spinner-stutter and seal-UX concerns addressed with rationale comments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.