Skip to content

perf(server): finish runtime messages without full thread reads - #10120

Merged
t3dotgg merged 3 commits into
mainfrom
t3code/debt-gzuf-4-runtime-finalization
Sep 6, 2026
Merged

perf(server): finish runtime messages without full thread reads#10120
t3dotgg merged 3 commits into
mainfrom
t3code/debt-gzuf-4-runtime-finalization

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 5, 2026

Copy link
Copy Markdown
Member

Finishing a message or plan could load every message and plan in its thread.

Use keyed message and plan reads, SQL existence checks, and the latest task activity with a usable title. Preserve late completion, buffered replies, implemented-plan metadata, and the existing 500-row compaction history limit. Buffered plan text stays available until its update commits.

Continues #8995 by @rcawston. The original commit was cherry-picked with Ross Cawston's Git authorship preserved. The original PR is unchanged. This continuation fixes its title-loss finding and keeps the newer runtime-context and question-handling behavior on main.

Stacks on #10115, after #10290 and #10123. The base PRs own summary and request lifecycle changes. This PR narrows runtime completion reads.

Verification: 113 focused tests across five server files, server-only typecheck, and changed-file lint and formatting pass on the stack. The saved-title regression fails with the imported query and passes with this fix. No browser or provider process was run.

The existing terminal-turn pending-question lifecycle read is unchanged. No wire schema, database migration, or UI change.

Created with GPT-6 Astra in Codex. Follow-up review and restack with Codex.

Note

Replace full thread-detail reads with targeted projection queries in ProviderRuntimeIngestion

  • Replaces thread-detail hydration in provider runtime event processing with exact repository lookups for messages, proposed plans, and task activities.
  • Adds ProjectionThreadProposedPlanRepository.getByPlanId, ProjectionThreadMessageRepository.hasAssistantMessageForTurn, and ProjectionThreadActivityRepository.getLatestTaskActivity; extends list activities with kind filters and limits.
  • Fixes blank buffered proposed-plan finalization to clear the buffer without creating a row, allowing a later nonblank completion to replace the plan while preserving creation and implementation metadata.
  • Compaction token history now queries task activities with kind filters and a 500-row bound instead of loading full thread detail.
  • Behavioral Change: task-title recovery now selects the latest persisted task activity with a nonblank title rather than relying on in-memory thread search; listProjectionThreadActivityRows applies newest-first limiting before returning ascending order.

Macroscope summarized d8f7c40.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.5 KiB −40 B (−0.3%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB +1 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −41 B (−0.6%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.0 KiB −88 B (−0.2%) 66.4 KiB
Codex Live turn messages 10 8 −2 (−20.0%) 21
Claude Total thread wire 13.5 KiB 13.6 KiB +76 B (+0.5%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +4 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.6 KiB +72 B (+1.1%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.9 KiB +88 B (+0.1%) 66.4 KiB
Claude Live turn messages 8 10 +2 (+25.0%) 21

Baseline: eb8ed80 · PR result: d8f7c40 · 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.

@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR is a substantial production-path refactor that replaces full thread hydration with multiple targeted persistence queries and changes runtime message, plan, task, and compaction handling. The unresolved high-severity request-response classification finding also requires human attention.

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 5, 2026
@t3dotgg
t3dotgg changed the base branch from main to t3code/debt-gzuf-4-shell-plans September 6, 2026 05:00
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-runtime-finalization branch from e51cfbc to 857ef05 Compare September 6, 2026 05:00
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 6, 2026 05:01

Dismissing prior approval to re-evaluate 857ef05

@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-shell-plans branch from 9c6a716 to 0384d91 Compare September 6, 2026 06:27
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-runtime-finalization branch from 857ef05 to 52299f6 Compare September 6, 2026 06:28
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-shell-plans branch from 0384d91 to df364f3 Compare September 6, 2026 06:41
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-runtime-finalization branch from 52299f6 to 07abeb6 Compare September 6, 2026 06:41
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-shell-plans branch 2 times, most recently from ae7290a to 5f255a1 Compare September 6, 2026 09:18
@t3dotgg
t3dotgg deleted the branch main September 6, 2026 09:21
@t3dotgg t3dotgg closed this Sep 6, 2026
@t3dotgg t3dotgg reopened this Sep 6, 2026
@t3dotgg
t3dotgg changed the base branch from t3code/debt-gzuf-4-shell-plans to main September 6, 2026 09:21
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Sep 6, 2026
rcawston and others added 3 commits September 6, 2026 02:22
Keep saved task titles, plan metadata, and late buffered replies while narrowing runtime reads.

Co-authored-by: Ross Cawston <rcawston@users.noreply.github.com>
Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts Outdated
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-runtime-finalization branch from 07abeb6 to d8f7c40 Compare September 6, 2026 09:24
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 6, 2026
@t3dotgg
t3dotgg merged commit e4e9fa9 into main Sep 6, 2026
25 checks passed
@t3dotgg
t3dotgg deleted the t3code/debt-gzuf-4-runtime-finalization branch September 6, 2026 09:56
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 6, 2026
## What's Changed
* feat(usage): pool subscription limits per provider across accounts and environments by @juliusmarminge in pingdotgg/t3code#10300
* chore(web): remove usage limits demo fixtures by @juliusmarminge in pingdotgg/t3code#10330
* fix(web): expose error disclosure state by @saphid in pingdotgg/t3code#10125
* fix(web): name the editor picker accurately by @saphid in pingdotgg/t3code#10124
* fix(web): make task row states readable by @saphid in pingdotgg/t3code#10128
* fix(web): explain hosted connection prerequisites by @saphid in pingdotgg/t3code#10129
* fix(web): name combobox chip removal targets by @saphid in pingdotgg/t3code#10127
* fix(marketing): present the Git workflow as an illustration by @saphid in pingdotgg/t3code#10130
* feat(mobile): pool usage limits across selected environments by @juliusmarminge in pingdotgg/t3code#10334
* fix(release): space automatic nightlies at least six hours apart by @t3dotgg in pingdotgg/t3code#10272
* refactor(web): share bulk thread deletion between sidebars by @t3dotgg in pingdotgg/t3code#10106
* refactor(client): share tool outcome rules by @t3dotgg in pingdotgg/t3code#10122
* refactor(server): share Claude result status and error mapping by @t3dotgg in pingdotgg/t3code#10296
* fix(server): settle inactive threads without a PR lookup by @t3dotgg in pingdotgg/t3code#10103
* fix(ssh): report remote stop failures without losing ownership by @t3dotgg in pingdotgg/t3code#10105
* perf(server): stop scanning old OpenCode parts by @t3dotgg in pingdotgg/t3code#10116
* perf(server): avoid full thread reads on turn start by @t3dotgg in pingdotgg/t3code#10108
* perf(web): skip checkpoint map rebuilds while streaming by @t3dotgg in pingdotgg/t3code#10118
* perf(server): skip plan bodies in thread summaries by @t3dotgg in pingdotgg/t3code#10341
* fix(server): skip disabled provider instances for text generation fallback by @t3dotgg in pingdotgg/t3code#10346
* fix(server): capture checkpoints before refreshing PR status by @t3dotgg in pingdotgg/t3code#10347
* fix(web): keep manual panel choices during a turn by @t3dotgg in pingdotgg/t3code#10113
* fix(threads): keep completed requests closed across clients by @t3dotgg in pingdotgg/t3code#10123
* perf(server): finish runtime messages without full thread reads by @t3dotgg in pingdotgg/t3code#10120
* refactor(server): let adapters declare context compaction by @t3dotgg in pingdotgg/t3code#10112
* fix(server): link thread PRs without an open client by @t3dotgg in pingdotgg/t3code#10101


**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1293...v0.0.39-nightly.20260906.1303

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260906.1303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). 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