Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughNative chat transcript cache misses now deduplicate concurrent reads for the same resolved file snapshot using an in-flight promise mechanism. Cache generation tracking prevents results from invalidated reads from being stored after cache resets. Tests cover shared object results for concurrent identical reads and separate reads for distinct files, while a benchmark measures concurrent miss cost. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded: main already coalesces concurrent transcript reads in |
Description
Coalesce concurrent cache misses for the same native-chat transcript snapshot. The cache now keys in-flight work by agent, resolved transcript path, mtime, byte size, and cache generation, so simultaneous desktop panes and paired web/mobile clients share one parse while changed files and different worktrees remain isolated.
This also adds:
Performance evidence
Command:
ORCA_NATIVE_CHAT_PERF_BENCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/native-chat/transcript-read-cache-inflight-cost.bench.test.ts --reporter=verboseThe isolated benchmark sends 8 simultaneous
readNativeChatTranscriptCachedcalls through the real resolver/stat/cache/file-stream/Claude-decoder boundary for one uncached 16 MiB JSONL transcript (5 rounds, median):The before-state regression test independently confirmed 8 underlying parses; after the fix it confirms exactly 1. This is an isolated concurrent cache-miss benchmark, not end-to-end UI latency.
ELI5
If eight Orca views asked for the same large chat at once, Orca used to photocopy and read the whole book eight separate times. Now the first request reads it and the other seven wait for that same copy, so the work happens once.
End-user trade-offs / regressions
Validation
oxlint,oxfmt --check, reliability gates, and max-lines ratchet passed.pnpm lintreaches a pre-existingja.jsoninterpolation mismatch forcomponents.native-chat.composer.uploadingAttachments; this PR does not touch localization files.