Repository navigation
[pull] main from getagentseal:main - #147
Merged
Merged
Conversation
…t a time Every dated command re-walks and re-stats every provider tree before it can decide what the cache already covers. That sweep was strictly serial at every level -- one readdir, one stat, one state.json read at a time, and one provider after another -- so on a 21k-file / 9-provider corpus it owned most of a warm run's wall clock with the machine idle waiting on the kernel. Measured per warm `today` pass on that corpus before this change: 859 ms in discoverAllSessions (kimicode 467, codex 143, claude 135, grok 77) and 727 ms in the Claude project walk + fingerprint pass. - fs-utils: mapWithConcurrency + FS_SCAN_CONCURRENCY, one bounded, order- preserving helper for the whole sweep. - providers/index: run provider discovery concurrently, concatenated in registry order. - claude/codex/grok/kimicode: walk each level with the level fanned out, re-concatenated in readdir order before anything reconciles. - parser: the Claude dir walk and both fingerprint passes (scanProjectDirs and parseProviderSources) fan out, then reconcile serially in discovery order, which is what changedFiles ordering and the seenMsgIds pre-seed depend on. - parser: collectJsonlFiles reads entries with their types, so a plain file no longer costs a wasted subagents/ probe. - codex-cache: share one in-flight load between concurrent readers. The memo is only populated after the read + parse resolves, so concurrent discovery had every caller re-reading and re-parsing the same (here 59 MB) file. No reconciliation logic changed: the same fingerprints reach the same cache comparison in the same order. Warm `today` 5.30s -> 2.99s, cold 34.7s -> 31.1s (medians of 5 / 2, isolated HOME + cache). today/report -p month/models/sessions JSON, warm and cold, per-provider and combined, are byte-identical apart from the run's own `generated` timestamp. Closes #1104
…lation loops
renderDashboard issued three parseAllSessions calls (scan range, plan window,
durable headline). They often share a START and differ only in where they end —
end-of-day vs each caller's own `new Date()` — which the exact-key memo cannot
match, so a warm render paid for the discovery sweep, the cache read and the
parse two or three times over.
withSinglePassParse lets a caller declare the widest range it will ask for. A
later request that is a PURE NARROWING of it is served by slicing that parse
instead of running the pipeline again. Pure narrowing is deliberately strict:
same start, an end that is inside, and the same month shard scope. Both extra
conditions are load-bearing, because a parse's file set is a function of its
range:
- a changed file with `mtimeMs < range.start` is skipped without being parsed,
so an earlier start reads files a later start never sees;
- loadCache reads only the shards monthScopeForRange selects;
- either way the extra files seed seenKeys/seenMsgIds BEFORE the range slice,
and a seeded key suppresses the matching in-range turn in a provider parsed
later — usage the narrower parse would have counted.
Holding start and month scope equal makes both parses see an identical file set,
leaving the range slice as the only difference — the same trade burstReuse
already makes for the mirror-image case (same start, later end).
Independently, correlateCrossProviderPrSessions ran two O(n*m) scans: a
`sessions.filter` per subagent child (now a one-shot agentId index) and a full
`launches.filter` per candidate (now a sorted array plus a windowed scan). Both
preserve the exact match set; launch order was never observable because the
matches collapse into a Map keyed by the sorted ref list.
Warm, 21k-file corpus, isolated cache, median of 5 interleaved:
today 5.12s -> 3.81s (1.34x) 3 parses -> 2
month 5.46s -> 3.41s (1.60x) 2 parses -> 1
today --format json 4.11s -> 3.49s (1.18x, correlation hoist only)
vitest.config gains an explicit exclude so a .claude worktree's stale tests/
copy stops being swept into the run.
Refs #1106
…behind it A cold start parsed the whole corpus before painting anything (~36s on a 21k corpus) even though the default view only shows the last 7 days. A session log is append-only, so its last event timestamp is <= its mtime: a file stamped before the start of the displayed range provably holds nothing that range can show. On a cold cache the interactive dashboard now parses only the files above that floor, paints, and indexes the rest from the mounted UI. - parser: `withColdFirstPaintFloor` scopes a parse to files that can hold in-range data (mtime >= rangeStart - 48h clock-skew margin), deferring only files with NO cache entry — nothing that has something to serve is held back, and network sources (synthetic now-stamped fingerprint) always load. - A run that deferred anything is a partial hydration: it does not stamp the session cache complete and reports hydrationComplete false, so the daily backfill cannot finalize history off it and the next launch resumes cold. A floored run that deferred NOTHING keeps the normal stamps. - The floor participates in the parse memo key, so a first-paint result can never be served to (or burst-reused by) an unfloored request. - dashboard: cold + TTY + standard dated view only. The background fill is an ordinary unscoped background reload, so its cache writes and its refreshed panels are exactly what a full cold parse produces. While it runs, an "indexing history N/M files" banner states that the totals cover only what is indexed so far. One-shot outputs (json/csv/markdown, report, sessions, models, serve/menubar/app payloads) are non-TTY and never enter this path. Fixes #1107
… when today is empty The unset default opened on 7 days everywhere. It now opens on today and only falls back to 7 days when today holds no sessions yet — the decision is made from the today-scoped slice of the parse the first paint already runs, so the probe costs a filter, not a second pass. Explicit selections are untouched: -p/--period, --day, --from/--to, the TUI period keys, the app's persisted default period, and every one-shot (--format json, report/sessions/status, the piped non-TTY render) keep the 7-day default they had. Fixes #1111
Extends the existing borrowed-credential quota module (claude/codex) with three providers, per-provider settings toggles, and a provider display map: - gemini: Code Assist loadCodeAssist/retrieveUserQuota via the Gemini CLI's on-disk OAuth creds; optional env-gated token refresh; retired-tier responses degrade to terminalFailure with migration guidance - copilot: copilot_internal/user with editor-plugin headers; token read-only from hosts.json/apps.json with one re-read on 401; marked as an internal API that may drift, failures degrade honestly - antigravity: loopback-only Connect-RPC probe of the local language server (ps/lsof discovery via execFile, csrf token for the app variant, agy CLI accepted tokenless); TLS relaxation scoped to 127.0.0.1; no OAuth fallback - settings: per-provider quota switches (default on) persisted renderer-side, honored in the main-process service so disabled fetchers never run; IPC disabled-list filtered against the provider allowlist - sanitizeError extended for Google (ya29.) and GitHub (gh*_) token shapes Kimi audited, not duplicated: the macOS menubar already fetches Kimi quota live (KimiSubscriptionService.swift); the electron app not surfacing it is a pre-existing gap, unchanged here.
perf: fan out the discovery sweep instead of walking it one syscall at a time
perf: single-pass parse for dashboard ranges + correlation scan hoists
perf: progressive cold start — paint the dated TUI first, index history in the background
feat: interactive dashboard opens on Today, falls back to 7 days when today is empty
feat: live quota for Gemini, Copilot, Antigravity + per-provider toggles
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )