Skip to content

perf(server): summary reactors stop loading activities they never read - #234

Merged
tusharbhardwaj-bk merged 1 commit into
expbkmainfrom
t3code/perf-21-summary-no-activities
Sep 27, 2026
Merged

tusharbhardwaj-bk merged 1 commit into
expbkmainfrom
t3code/perf-21-summary-no-activities

Conversation

@tusharbhardwaj-bk

Copy link
Copy Markdown
Collaborator

Problem

CatchupSummaryReactor and WorkSummaryReactor (both fork-owned) call projectionSnapshotQuery.getThreadDetailById(threadId) with no query, which loads the thread's activity payloads. They only read messages and turns: buildTurnTranscript, lastAssistantMessageForTurn and buildSessionContext never touch activities. Found by the background-load analysis subagent.

Fix

Both call sites pass { activityKinds: [] }. ProjectionThreadDetailQuery documents that an empty list skips the activity query.

Evidence

The largest active thread on a prod copy (19,356 activities), 3 loads each:

ms
full detail (before) 206, 64, 58
activityKinds: [] (after) 40, 33, 33

The feature (experimental.sessionSummary) is off in prod, so this removes a stall for whoever turns it on rather than a current one.

Tests: CatchupSummaryReactor.test.ts + WorkSummaryReactor.test.ts, 14 pass, and summaries are still produced. vp run typecheck in apps/server is clean.

Model/harness: Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

CatchupSummaryReactor and WorkSummaryReactor (both fork) called
getThreadDetailById without a query, which loads activity payloads, and
then only read messages and turns. They now pass activityKinds: [], which
the detail query already short-circuits. On the largest active thread of a
prod copy (19,356 activities): 58-206 ms -> 33-40 ms per load. The feature
is off in prod today, so this removes a stall for whoever turns it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 27, 2026
@tusharbhardwaj-bk
tusharbhardwaj-bk merged commit ed3c051 into expbkmain Sep 27, 2026
9 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants