Skip to content

perf(sessions): bound Git stats to visible rows - #214

Merged
tt-a1i merged 1 commit into
mainfrom
codex/issue-187-bounded-session-stats
Aug 28, 2026
Merged

tt-a1i merged 1 commit into
mainfrom
codex/issue-187-bounded-session-stats

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • load Session Git statistics only for the rows the picker can actually render, while using the full Session universe to identify the true latest Session per canonical workspace
  • reconcile viewport changes incrementally, share identical queries, cancel work that leaves the viewport, and keep the cache bounded to one picker
  • distinguish pending and unavailable statistics from a verified clean result instead of caching Git failures as zero
  • canonicalize workspace aliases with bounded, reusable discovery and stop scheduling both Git and canonicalization work when the picker closes
  • add deterministic 10/120/1,000-Session coverage plus a real-Git benchmark

Compatibility impact

  • User-visible: statistics now appear progressively as rows enter the viewport; pending rows show …, and unavailable Git evidence shows ?
  • Existing calculated values and Session selection/preview behavior are unchanged
  • Cache semantics are picker-scoped and per-query first observation; reopening the picker refreshes repository state without background polling
  • Tool schemas, configuration, persisted Session data, Provider behavior, permissions, and Session lifecycle are unchanged

Benchmark

bun benchmarks/session-git-stats.ts

  • 1,000 Sessions, multi-workspace: 24 cold Git calls, 0 warm calls
  • 1,000 Sessions, one workspace: 13 cold Git calls, 0 warm calls
  • Git cancellation: 4 calls started, about 0.9 ms to settle, no cached result
  • 1,000 canonical workspaces: maximum canonicalization concurrency 8, 0 repeated-universe calls
  • canonicalization cancellation: 4 operations started, about 0.3 ms to settle, no cached result

Validation

  • node --test --experimental-strip-types tests/extensions/sessions/*.test.ts — 35 passed
  • bun run check — passed; only the existing file-search Effect diagnostics remain warnings
  • bun run test — 915 Node tests and 30 Vitest tests passed
  • git diff --check
  • three independent review rounds across repository design and adversarial performance/lifecycle analysis; final round: no findings

Manual Pi TUI smoke was not counted because pi list currently loads /Users/tushaokun/work/openpi-main-runtime, not this worktree. No installed package source was changed.

Closes #187

@tt-a1i
tt-a1i merged commit cd9ef39 into main Aug 28, 2026
2 checks passed
@tt-a1i
tt-a1i deleted the codex/issue-187-bounded-session-stats branch August 28, 2026 04:00
agnitum2009 pushed a commit to agnitum2009/openpi that referenced this pull request Aug 28, 2026
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.

perf(sessions): Git diff stats 对全部 Session 做聚合无界的 subprocess fan-out

1 participant