GeezerVison is showing github.com — perf(server): count pending questions without loading history by t3dotgg · Pull Request #10290 · pingdotgg/t3code
Conversation
t3dotgg
commented
Sep 6, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Thread summary refreshes loaded every saved question payload to count pending questions. Failed approval replies loaded the whole activity history to recover one request.
Count pending questions in SQLite and read only the matching approval lifecycle. Keep the shared request rules, including final closure, typed stale outcomes, legacy error text, and rewind behavior.
Stacks on #10108, after #10123. Those PRs own turn-start reads and request lifecycle semantics. This PR changes question and approval reads.
Verification: 37 focused repository and projection tests, server-only typecheck, and changed-file lint and formatting pass on the updated dependency. The rebase preserves the original query patch.
The disposable SQLite fixture returned one count instead of 10,002 question lifecycle rows and 22.84 MB of JSON. Approval recovery returned two matching rows instead of 20,002 rows. Both queries still scan one thread's history. No new projection, migration, wire contract, or UI change.
Created with GPT-6 Astra in Codex. Follow-up review and rebase with Codex.
Note
Count pending questions via SQL aggregate instead of decoding activity history
- Replaces in-memory traversal of decoded user-input activity rows with a SQLite aggregate (
countPendingUserInputRows) that groups by textual request ID and excludes resolved or stale-failed groups.
- Scopes approval lifecycle reads to a single thread and request ID via
listApprovalLifecycleRows, so malformed or unrelated activity rows are never decoded during failed-approval recovery.
- Adds
ListProjectionApprovalLifecycleInput schema and two new repository methods on ProjectionThreadActivityRepositoryShape.
- Expands tests in ProjectionPipeline.test.ts and ProjectionRepositories.test.ts to cover large payloads, invalid tones, cross-thread rows, stale-outcome classification, and revert recompute.
- Behavioral Change:
refreshThreadShellSummary and the thread activity projection handler now rely on repository-level SQL filtering; any out-of-tree consumer expecting full activity rows to be loaded and decoded during these operations will no longer see that behavior.
Macroscope summarized a465772.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
— |
13.6 KiB |
— |
15.1 KiB |
✅ |
| Codex |
Thread snapshot wire |
— |
7.0 KiB |
— |
7.3 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
— |
6.6 KiB |
— |
7.8 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
— |
57.1 KiB |
— |
66.4 KiB |
✅ |
| Codex |
Live turn messages |
— |
10 |
— |
21 |
✅ |
| Claude |
Total thread wire |
— |
13.6 KiB |
— |
15.1 KiB |
✅ |
| Claude |
Thread snapshot wire |
— |
7.0 KiB |
— |
7.3 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
— |
6.5 KiB |
— |
7.8 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
— |
57.8 KiB |
— |
66.4 KiB |
✅ |
| Claude |
Live turn messages |
— |
9 |
— |
21 |
✅ |
Baseline: unavailable · PR result: a465772 · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 113.8 KiB
- Claude decoded thread snapshot: 114.5 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
macroscopeapp
Bot
commented
Sep 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at a465772
Macroscope's review found this PR approvable — This is a focused server-side performance refactor that replaces retained activity decoding with scoped SQLite aggregation and request filtering. It adds no schema, product default, security-sensitive behavior, or new capability, and the changed paths are covered by repository and orchestration tests.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 6, 2026
Note 🤖 Claude Fable 5.1 responding on behalf of Theo
Closing. listUserInputLifecycleByThreadId already filters to the three question kinds in SQL, so the per-refresh decode is the handful of questions a thread has asked, not history. The 10,002-row fixture is synthetic. The SQL COUNT also copies the stale-request classification rules (the typed reason plus four legacy detail substrings) into a HAVING clause, which is a second copy of what #10123 centralizes in packages/shared and would drift by hand. It also hard-depends on #10123. #10115 is being retargeted onto #10108.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:L
100-499 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|