GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): enforce history page limits at turn boundaries by connwalk · Pull Request #15794 · pingdotgg/t3code

Conversation

@connwalk

@connwalk connwalk commented Oct 4, 2026 •
edited by juliusmarminge
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Histories with user-created turn anchors bypassed item and byte budgets, producing oversized pages. Paging now applies the default 75-item / 1 MiB budgets at complete-turn boundaries, preserving user-turn and raw-turn ceilings. The newest complete turn is always admitted so oversized turns cannot stall loading; these are admission budgets, not an absolute frame-size cap.

Rebuilt on current main with a backward scan and one final slice, replacing the original unbounded spread and repeated prepending. SQL history pages account for actual wire payloads while retaining the full history's notification and steering context. The legacy WebSocket snapshot also requests a turn-aligned SQL window, preserving nested-fork history continuity. Histories with no user-created anchor retain row-based paging. Queued-message boundaries remain unchanged, and find jumps may require more bounded pages.

Credit to @connwalk for #15794, whose original commits are preserved. Maintainer batch usage-billing-04 explicitly authorizes applying budgets to anchored histories, answering the earlier policy question. Takeover claim.

Verification:

  • 208 focused tests pass across 14 files, covering SQL/helper parity, independent budgets, lossless cursor traversal, a 150,000-row oversized turn, notification and same-run steering boundaries, queued suffixes, nested forks, bounded-snapshot duplicate local-item accounting, transport, and shared client history. Scoped lint, formatting, and server typecheck pass.
  • A running server with isolated SQLite state served a synthetic 20-turn / 200-row thread containing 20,000-byte outputs through authenticated HTTP. The initial bounded snapshot contained 20 rows; following its history cursor returned pages of 50, 50, 50, and 30 rows. All 200 identities were recovered in order without duplicates or gaps, ending with a null cursor. The largest history response was 925,942 bytes. HTTP verification results.
  • A separate headless comparison using the actual paging helper returned 100 rows / 1,822,411 encoded bytes on main versus 50 rows / 911,201 bytes with this change. The SQL integration cases additionally verify a 201-row notification turn and an oversized queued turn containing same-run steering stay whole.

The original iPhone-to-Mac reconnect, WebSocket reconnect, packaged Electron, macOS, Windows, iOS, and Android were not exercised on this Linux machine. No UI screenshot applies to this server-only change.

Implementation: gpt-6.1-sol through Codex. Tests: gpt-6-astra through Codex. Adversarial review: claude-opus-5-5 through Claude Code and gpt-6-sol through Codex.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
connorwalker @claude
fix(server): enforce history page limits at turn boundaries
875b028
Timelines with turn anchors skipped the 75-item and 1 MiB page budgets, so a
long thread could send a very large history page to mobile clients. Apply every
limit at turn boundaries instead, keeping turns intact and always admitting the
newest turn so an oversized turn cannot stall paging.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 4, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Oct 4, 2026
View reviewed changes
Comment thread apps/server/src/orchestration-v2/threadHistoryPaging.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This is a focused server-side bug fix that enforces existing history page limits without schema or configuration changes, and it includes targeted coverage. An unresolved High finding identifies a possible argument-limit failure for oversized turns, which remains a mandatory approval blocker.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 72d9a898-f054-4a55-b8f9-99ed9bc72fc8
📥 Commits

Reviewing files that changed from the base of the PR and between efecd3c and 875b028.

📒 Files selected for processing (2)
  • apps/server/src/orchestration-v2/threadHistoryPaging.test.ts
  • apps/server/src/orchestration-v2/threadHistoryPaging.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

selectOlderTimelinePage now applies item and byte budgets at complete turn boundaries for anchored histories. It always includes the newest turn, even when that turn exceeds the configured limits. Histories without user turns retain row-by-row selection and include at least one row.

Changes: Anchored history paging

Layer / File(s) Summary
Apply paging limits at turn boundaries
apps/server/src/orchestration-v2/threadHistoryPaging.ts, apps/server/src/orchestration-v2/threadHistoryPaging.test.ts
Anchored histories are selected by complete turns and constrained by item, byte, user-turn, and raw-turn limits. Tests cover turn-boundary budgets, oversized newest turns, and bounded snapshots using duplicated local-row costs.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: bil0000

Merge Risk: ⚪ Minimal · up to 875b0

History pages retain complete turns while limiting older history. No actionable merge-blocking issue remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: enforcing history page limits at turn boundaries.
Description check Passed The description explains the problem, implementation, scope approval, and detailed verification results. It does not use separate Problem, Change, or Scope and approval headings, but the required info…
Full details: Description check

Explanation

The description explains the problem, implementation, scope approval, and detailed verification results. It does not use separate Problem, Change, or Scope and approval headings, but the required information is present and the description is sufficiently complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bompus bompus mentioned this pull request Oct 9, 2026
perf(server): skip full timeline encoding for proven overflow #17426
Closed
@maria-rcks

maria-rcks commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one names a harness (Claude Code) but not which model version created it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model in the PR description.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maria-rcks maria-rcks closed this Oct 11, 2026
@bompus bompus mentioned this pull request Oct 11, 2026
perf(server): bounded snapshots of threads with large messages are prepared faster #18072
Closed
@maria-rcks

maria-rcks commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Reopening, this was closed by mistake. Sorry for the noise!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maria-rcks maria-rcks reopened this Oct 11, 2026
@juliusmarminge ChatGPT Codex Connector

juliusmarminge commented Oct 11, 2026

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

Could a maintainer confirm the intended paging constraint here? The old comment in threadHistoryPaging.ts explicitly limits item/byte budgets to histories without turn starts, while this patch applies those budgets at anchored turn boundaries. The regression tests establish the new limit behavior, but the PR's claim that anchored budgets were already intended conflicts with that documented choice. Under problem and scope, please link the intended-behavior decision or explain why this preserves the original constraint. Leaving this open for that clarification and maintainer decision.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 13, 2026
A fork whose own turns fill the first page still reads and decodes its parent's tool outputs #18915
Closed
Preparing a bounded snapshot of a thread with ten 1 MiB messages encodes the whole timeline just to prove it is over budget #18916
Closed
@juliusmarminge juliusmarminge self-assigned this Oct 19, 2026
@juliusmarminge

juliusmarminge commented Oct 19, 2026

Copy link
Copy Markdown
Member

Taking over this one as part of maintainer batch usage-billing-04. I will rebuild the paging fix on current main, preserve complete-turn paging and notification boundaries, and push focused tests and implementation updates here. Thanks @connwalk for the reproduction and initial fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 7 commits October 19, 2026 15:49
@juliusmarminge
chore: merge main for history paging takeover
69245e0
@juliusmarminge
test(server): distinguish history turn paging budgets
6b0e4f0
@juliusmarminge
fix(server): bound history pages at complete turns
e44831b
@juliusmarminge
test(server): align SQL history fixtures with complete-turn budgets
5f8909f
@juliusmarminge
fix(server): enforce byte budgets on SQL history pages
6f7c127
@juliusmarminge
test(server): cover notification context in SQL history pages
b7c93d9
@juliusmarminge
fix(server): retain full turn context in SQL history pages
e0fedfd
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Oct 19, 2026
@mohamad-nikzad

mohamad-nikzad commented Oct 20, 2026

Copy link
Copy Markdown

We hit the same bypass on a real OpenCode thread and can confirm the userTurnStarts < maxUserTurns case, which I think is the residual case after #17433.

Thread shape (server 0.1.0, main @ 8fc72da):

  • 1,116 turn items / 3.82 MB
  • 6 user-created turn starts (ordinals 1, 3, 4, 8, 9, 10), fewer than maxUserTurns: 10
  • run 1: 409 items / 1.375 MB, including four 2880x2420 / 2880x1302 PNG embeds
  • run 4: 190 items / 0.879 MB
  • run 7: 321 items / 1.055 MB
  • run 10: 136 items / 0.330 MB

In ProjectionStore.ts:2946, user_anchors is non-empty, so the query uses LIMIT -1. The boundary is ordinal 0 because the thread has fewer than 10 user turns. In threadHistoryPaging.ts:236, turnLimit is then set to 10 and rowBytes is forced to 0, so maxItems and maxEncodedBytes are never checked. The initial bounded snapshot contains the entire thread. payloadBudgetExceeded is true, but the body is not trimmed.

Client impact: Android 16 / 23090RA98G / T3 Code Mobile 2.0.0 freezes on open. The phone's GET /api/orchestration/threads/<id>/bounded?compactTurnItems=1 took 607 ms and the server-side subscribeThread snapshot took 1.1 ms; the client then requested the four run-1 images and went silent until it was force-closed. A desktop Electron client on the same thread opens it in ~200 ms, so this only surfaces on the mobile client.

The 75-item / 1 MiB admission budgets in this PR would make the initial snapshot the newest 136-item / 0.33 MB turn instead of all 1,116 items, and would keep run 1's images out of the first mount. That matches the expected behavior.

Would a regression fixture with 6 user turns and ~1,100 items / 3.8 MB be useful? I can provide a synthetic one (not the real database). Also, the branch is currently dirty against 8fc72da; happy to test a rebased build against this thread if that helps.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg

t3dotgg commented Oct 25, 2026

Copy link
Copy Markdown
Member

Note

🤖 Claude Opus 5.5 responding on behalf of Theo

Superseded by #24589. Every history window now stops at the 1 MiB byte budget, and windows with user turns also stop at 500 rows, so anchored histories no longer bypass the budgets.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@juliusmarminge juliusmarminge juliusmarminge left review comments
@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@juliusmarminge juliusmarminge

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

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.

5 participants

@connwalk @maria-rcks @juliusmarminge @mohamad-nikzad @t3dotgg
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.