Skip to content

fix: make local CLI sessions responsive and inspectable - #993

Open
borick wants to merge 1 commit into
builderz-labs:mainfrom
borick:fix/local-session-observability
Open

borick wants to merge 1 commit into
builderz-labs:mainfrom
borick:fix/local-session-observability

Conversation

@borick

@borick borick commented Oct 4, 2026

Copy link
Copy Markdown

Summary

Make local CLI sessions responsive and inspectable. Cache unchanged Claude/Codex transcript summaries, share concurrent Claude refreshes, and serve the cached snapshot during refresh. Honor Codex completion/abort events and show readable conversation names, last prompts, working directories, and actual activity timestamps. Sidebar session rows now open their conversation. Transcript lookup reads the requested session rather than unrelated full logs and excludes developer/system instructions from chat messages.

Risk Level

Medium: filesystem-derived session summaries can become stale if files change without a size or mtime change. The optional read-only Codex SQLite title index falls back to JSONL metadata if unavailable or incompatible. Session history, authentication, command execution, and persisted schemas are unchanged.

Evidence

  • pnpm lint and pnpm typecheck: pass.
  • Nine new regression tests pass, covering cache reuse/invalidation, activity lifecycle, concurrent refresh, optional title-index fallback, targeted transcript reads, older sessions, and clickable sidebar navigation.
  • Full unit suite: 1,552 pass / 34 fail. Unchanged upstream checkout on this Windows host: 1,543 pass / the same 34 failures, in the same 13 files.
  • Production build and standalone artifact checks: pass.
  • On the same transcript-heavy installation, optimized production-preview session requests took approximately 2.4 seconds cold and 220–250 ms warm; opening the requested transcript took 193 ms. Previous development-server logs showed approximately 50 seconds and 3 seconds respectively. This comparison includes the switch from development to production and is not an isolated cache benchmark.

Contribution Checklist

  • This PR has one reviewable purpose and no unrelated cleanup
  • Tests cover behavior changes and failure paths
  • pnpm lint, pnpm typecheck, and relevant tests pass
  • Auth, data scope, command execution, and secret handling were reviewed when touched
  • Schema changes include forward migration and upgrade-path tests (no schema changes)
  • Public text, logs, fixtures, screenshots, and commits contain no secrets or private data

Notes

The first Claude snapshot refreshes asynchronously; an initially empty snapshot fills on the next poll. The cache retains parsed summaries rather than full transcript contents. Legacy arbitrarily named transcript files use bounded header inspection. Existing age-based scan optimization work such as #979 remains complementary.

End-to-end suite with Chromium installed: 513 pass / 1 fail. The remaining test is OpenCode continuation returning HTTP 500 on this Windows host; that handler is unchanged. No public screenshot is included because the available installation contains private conversations; sidebar interaction is covered by a synthetic-fixture regression test.

Closes #992

@borick
borick requested a review from 0xNyk as a code owner October 4, 2026 16:41
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.

Local CLI sessions: slow scans, misleading activity, and no sidebar detail navigation

1 participant