No actionable comments were generated in the recent review.
Walkthrough
The pull-request service now obtains thread metadata and the maximum thread-event sequence through a projection-store snapshot API. The API supports global and thread-targeted reads, with filters for archived and settled threads.
Changes: Pull-request snapshot flow
Layer / File(s) Summary Projection-store snapshot
apps/server/src/orchestration-v2/ProjectionStore.ts,apps/server/src/orchestration-v2/ProjectionStore.test.tsThe store adds a snapshot query that reads selected thread data and the maximum event sequence in one transaction. It applies thread and unsettled filters, and tests check query scope, transaction grouping, and returned metadata. Orchestrator and service integration
apps/server/src/orchestration-v2/Orchestrator.ts,apps/server/src/orchestration-v2/ThreadPullRequestService.ts,apps/server/src/orchestration-v2/ThreadPullRequestService.test.ts,apps/server/src/orchestration-v2/ProviderTurnControlService.test.tsThe orchestrator exposes the snapshot query, and the pull-request service uses it for global and thread-targeted reads. Tests cover snapshot filtering and the sequence guard in the sync command. Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant ThreadPullRequestService 3 participant OrchestratorV2 4 participant ProjectionStoreV2 5 participant ReadOnlySQLiteClient 6 ThreadPullRequestService->>OrchestratorV2: Request pull-request snapshot 7 OrchestratorV2->>ProjectionStoreV2: Delegate snapshot options 8 ProjectionStoreV2->>ReadOnlySQLiteClient: Read selected threads and event sequence in one transaction 9 ReadOnlySQLiteClient-->>ProjectionStoreV2: Return rows and sequence 10 ProjectionStoreV2-->>OrchestratorV2: Return decoded snapshot 11 OrchestratorV2-->>ThreadPullRequestService: Return snapshot and sequence Possibly related issues
- pingdotgg/t3code#18618: The issue describes full-shell reads for PR discovery; this change uses a filtered metadata snapshot and sequence read.
- pingdotgg/t3code#24895: The issue identifies a slow
ThreadPullRequestServiceV2.synchronizeshell read; this change replaces the PR-service read with a metadata snapshot.
Possibly related PRs
- pingdotgg/t3code#25728: Adds a related PR-sync snapshot read path that this change extends with a PR-specific API and filters.
- pingdotgg/t3code#25443: Moves PR discovery to thread metadata; this change implements a snapshot API with sequence and thread filters.
- pingdotgg/t3code#13691: Replaces full thread-list reads with targeted snapshot reads for per-thread pull-request checks.
Suggested reviewers:
juliusmarminge,macroscopeapp
Merge Risk: External image Minimal · up to 98818
No actionable issue is established from the supplied evidence; the change is mergeable after normal checks.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title "perf(server): read pull request metadata from a lightweight snapshot" matches the main change. The PR adds a PR-specific snapshot (getPullRequestSnapshot) that reads only thread metadata an… Description check Passed The description follows the template's main sections: Problem, Change, Scope and approval, and Verification. The Problem section explains the slow startup backfill. The Change section describes the ne… Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Full details: Title check
Explanation
The title "perf(server): read pull request metadata from a lightweight snapshot" matches the main change. The PR adds a PR-specific snapshot (getPullRequestSnapshot) that reads only thread metadata and event sequence, and the PR service uses it for backfill and per-thread refresh. It uses a conventional commit prefix and plain language.
Full details: Description check
Explanation
The description follows the template's main sections: Problem, Change, Scope and approval, and Verification. The Problem section explains the slow startup backfill. The Change section describes the new snapshot and the service updates. The Verification section reports benchmark numbers (1,168 ms to 111 ms), sync command and branch lookup parity, focused test results, and the limits of the measurements. The Scope section explains why this is a focused performance fix. Two gaps remain: it does not link a triaged issue or maintainer approval, and the template asks for approval of direction and scope for changes like this. It also does not clearly state the reason for the performance fix's qualification under the approval rule beyond stating it is focused. The model line (GPT-6 Codex) is present as the template requests.
Resolution
Consider linking the triaged issue or maintainer discussion that approves this performance direction. If none exists, state why this small, focused performance fix qualifies without prior approval.
Finishing Touches
Generate docstrings
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/lightweight-pr-startup-snapshot
- File: .coderabbit.config.ts
- Commit: 988187f
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
eca5da34-1df8-4225-99ca-bad8b6d8ee55
External image Commits
Reviewing files that changed from the base of the PR and between 260297b55fc97c5b10ff55511967f6d20c622e54 and 988187fdb93f9d0d55b86be5c91147710106a185.
External image Files selected for processing: 6
apps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ProjectionStore.test.tsapps/server/src/orchestration-v2/ProjectionStore.tsapps/server/src/orchestration-v2/ProviderTurnControlService.test.tsapps/server/src/orchestration-v2/ThreadPullRequestService.test.tsapps/server/src/orchestration-v2/ThreadPullRequestService.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/lightweight-pr-startup-snapshot
- File: .coderabbit.config.ts
- Commit: 988187f
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
eca5da34-1df8-4225-99ca-bad8b6d8ee55
External image Commits
Reviewing files that changed from the base of the PR and between 260297b55fc97c5b10ff55511967f6d20c622e54 and 988187fdb93f9d0d55b86be5c91147710106a185.
External image Files selected for processing: 6
apps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ProjectionStore.test.tsapps/server/src/orchestration-v2/ProjectionStore.tsapps/server/src/orchestration-v2/ProviderTurnControlService.test.tsapps/server/src/orchestration-v2/ThreadPullRequestService.test.tsapps/server/src/orchestration-v2/ThreadPullRequestService.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.