Repository navigation
fix(performance): count one transcript read per history load and measure the conversations catalog - #1352
Merged
Conversation
…the main thread (#769) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ure the conversations catalog #769 asks to move transcript work off the main thread, but the recordings cannot attribute main stalls to it: each initial load was sampled twice (half timing only path resolution), and catalog discovery, search and prompt extraction had no monitor boundary. Measure first. Refs #769 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iscovery spans, pin the catalog thresholds Round-1 review of #1352: 26 operations x 4 outcomes outgrew three hard-coded 100-pair caps; a rejected discovery left its span pending until the sweep called it a timeout; the new thresholds were untested, and discovery's sat above the main-stall band. Refs #769 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…talog thresholds #1352 verification b: restoring the store's 100-entry persistence slice and raising each catalog threshold by 1 ms both survived. The store now has an all-pairs operations.json test, and the threshold cases sample exactly at the threshold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Review disposition (head Fixed
Declined
🤖 Generated with Claude Code |
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.
Refs #769. This is the measure-first step. Moving work to a worker waits until the data says which path stalls main (see the re-check comment on #769).
Plan:
docs/plans/2026-09-26-monitor-transcript-operations.md(first commit).Problem
Every transcript read and parse still runs on the main thread, but the owner's recordings can't say whether that is what stalls main:
transcript.readsamples and only 3 slow-operation incidents.main-stallincidents, none within 10 s of a slow read. Main-stall incidents carry no operation attribution.transcript.readtwice. The outer span ended after path resolution, and the read opened a second span with the same name, so half the samples timed only the path lookup.What merges
historyLoader: the path-resolution span is nowhistoryLoader.resolveInitialPath. It stays in the perf journal and is not a monitor operation, so each load records onetranscript.read.conversations.discover, from the existing span;conversations.extract, fromsessionIndex.extractPrompts;conversations.search, a new span around search's prompt gathering.MAX_MONITOR_OPERATION_PAIRS(operations × outcomes, now 104) sizes the aggregator, the snapshot parser and the history store, which each hard-coded 100.fail(error), instead of turning into a timeout at the sweep.Tests
historyLoader.monitor.test.ts: one initial load throughloadInitialHistoryChunk, on a recorded Claude transcript fixture, records exactly onetranscript.read. Red on main (two).service.system.test.ts: on the recorded conversations corpus, listing, a Codex row's prompts and a search recordconversations.discover,conversations.extractandconversations.search. Red on main.IncidentEngine.test.ts: each catalog threshold raises a named slow-operation incident exactly at the threshold, and none just below.MonitorAggregator.test.ts/MonitorHistoryStore.test.ts: every legal (operation, outcome) pair is aggregated, parsed, and persisted tooperations.json.cf977d45(main merged),npx tsc -bis clean and the focused suites (history loader, conversations service,src/main/performance,src/shared/performance) pass: 22 files, 126 tests. The corpus system tests can time out in their pre-existing install hook under heavy local load; CI runs them.🤖 Generated with Claude Code