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): run windowed snapshots on the SQLite reader by ScottN-PV · Pull Request #21869 · pingdotgg/t3code

Conversation

@ScottN-PV

@ScottN-PV ScottN-PV commented Oct 19, 2026 •
edited by juliusmarminge
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Problem

Opening a thread reads its bounded snapshot inside a writer transaction, so a long snapshot blocks thread creation, message dispatch, and other database writes. A file-backed WAL reproduction fails on main when another connection holds the writer.

Change

Route the entire bounded snapshot transaction through the existing SQLite reader helper. Anchor lookup, fork-parent projections, and snapshot sequence stay in one consistent transaction. Preserve the contributor’s implementation and regression test from this PR; the updated branch also includes current main.

Scope and approval

Fixes #21840
GitCafe: https://git.cafe/pingdotgg/t3code/issues/21840
Triaged bug via the automated issue flow. Accepted bug. Scope is bounded snapshot reader routing; query indexing and other projection reads are separate work.

Verification

  • Red at 9f597f2058: windowed snapshots return committed data while the writer is held fails with “snapshot must return while another connection holds the writer”; the cause is SQLite writer lock contention.
  • Green at 247703a96b: server vp test run src/orchestration-v2/ProjectionStore.test.ts src/orchestration-v2/ThreadSearch.test.ts passes 37 tests; shared vp test run src/nodeSqliteClient.test.ts passes 16 tests.
  • Both focused commands rerun after merging the contributor commit and main at b16843cb8d: 53 tests pass. Its tree equals the green-tested tree.
  • Scoped format, lint, and server typecheck pass. Two independent reviewers report no findings.
  • Before/after runtime transcript: isolated Linux dev server, real browser, same seeded stopped threads; authenticated bounded snapshot returns HTTP 200 on both revisions. The snapshot transaction changes from writer on main to reader with the fix.

Runtime excerpt (both enclosing bounded requests succeeded):

before 8d3b061121: sql.transaction db.connection=writer durationMs=13.297433 exit=Success
after  b16843cb8d: sql.transaction db.connection=reader durationMs=32.628450 exit=Success

This server-only change has an empty visual fixture matrix. No render paths or wire contracts changed. The reporter’s 10 GB cold-cache latency was not reproduced; no latency improvement is claimed.

Model: GPT-6.1-Sol and Claude Opus 5.5. Harness: Codex and Claude Code.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 19, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b0493ba

Macroscope's review found this PR approvable — This is a small, self-contained SQLite concurrency bug fix that reuses the existing reader transaction mechanism and adds a regression test for writer contention. Its runtime impact is limited to routing existing windowed snapshots to the reader when available, with the established writer fallback preserved.

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.

macroscopeapp[bot]
macroscopeapp Bot approved these changes Oct 19, 2026
View reviewed changes
@coderabbitai

coderabbitai Bot commented Oct 19, 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: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abc3c733-8f87-4463-96be-d5734ccd51bf
📥 Commits

Reviewing files that changed from the base of the PR and between b0493ba0411c0f8600be4dbb352dab49b639d812 and 135b85c.

📒 Files selected for processing: 2
  • apps/server/src/orchestration-v2/ProjectionStore.test.ts
  • apps/server/src/orchestration-v2/ProjectionStore.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

getThreadSnapshotWindow now uses Node SQLite’s read-only operator. A live SQLite test verifies that the snapshot succeeds during a writer transaction and uses the reader connection.

Changes: Snapshot reader connection

Layer / File(s) Summary
Read snapshots through a reader connection
apps/server/src/orchestration-v2/ProjectionStore.ts, apps/server/src/orchestration-v2/ProjectionStore.test.ts
getThreadSnapshotWindow applies NodeSqliteClient.readOnly. A live test holds a writer lock, reads the 76-row snapshot, checks the thread identity and title, and verifies the "reader" connection trace.

Priority: ⬆️ High

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 135b8

The snapshot change is mergeable after normal checks; no actionable issue remains in the supplied evidence.

Security architecture risk: ⚪ Minimal · up to b0493

The change preserves the snapshot transaction and response contract while avoiding writer contention when a reader is available. No introduced security weakness was identified. Slow snapshots can still delay other work sharing the reader.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed execution path remains within the configured SQLite database and the same thread and fork-parent projection queries. It changes connection selection, not the requested data scope; the comparison shows no added credentials, service access or caller-controlled routing authority.

Resilience and Maintainability Implications

  • observed — Transaction acquisition makes permit waiting interruptible and registers release under an uninterruptible cleanup boundary. Existing shared-client tests cover reader failure/restart and interrupted startup recovery; the new projection test itself covers successful reading under writer contention, not those recovery cases.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title follows conventional commit form and names the main change: windowed thread snapshot reads now run on the SQLite reader connection instead of the writer. It matches the raw summary, which sh…
Linked Issues check Passed Directly linked issue #21840 requires snapshot reads to avoid holding the SQLite writer. The supplied PR evidence states that getThreadSnapshotWindow runs anchor lookup, projection reads, fork-paren…
Out of Scope Changes check Passed The whole-PR summary identifies one production change in ProjectionStore.ts and one focused regression test in ProjectionStore.test.ts. The production change implements the reader routing for #218…
Description check Passed The description includes all required sections: Problem, Change, Scope and approval, and Verification. It links the triaged issue and approval, explains the implementation, documents focused test resu…
Full details: Title check

Explanation

The title follows conventional commit form and names the main change: windowed thread snapshot reads now run on the SQLite reader connection instead of the writer. It matches the raw summary, which shows the ProjectionStore.ts read path switched to NodeSqliteClient.readOnly, and the PR objectives, which describe the same change.

Full details: Linked Issues check

Explanation

Directly linked issue #21840 requires snapshot reads to avoid holding the SQLite writer. The supplied PR evidence states that getThreadSnapshotWindow runs anchor lookup, projection reads, fork-parent reads, and MAX(sequence) through NodeSqliteClient.readOnly. The reviewed test holds BEGIN IMMEDIATE on another connection and verifies committed snapshot data and db.connection: reader. Calls inside a write transaction and reader fallback remain supported. The separate index-only cold-open suggestion is assigned to #21193 and is not required by #21840 for this PR.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary identifies one production change in ProjectionStore.ts and one focused regression test in ProjectionStore.test.ts. The production change implements the reader routing for #21840. The test verifies WAL concurrency and reader selection for that behavior. No unrelated production behavior or unrelated test scope is shown.

Full details: Description check

Explanation

The description includes all required sections: Problem, Change, Scope and approval, and Verification. It links the triaged issue and approval, explains the implementation, documents focused test results and limitations, and identifies the models and harness used.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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.

@ImSynem ImSynem mentioned this pull request Oct 20, 2026
Opening a long thread blocks the database writer for 7–10 s #21840
Closed
@mikeohuo mikeohuo mentioned this pull request Oct 21, 2026
[Bug]: Windows, large repo: run finalization forces a full fff rescan every turn, blocking the backend event loop 15-52 s on the picker lock #22586
Closed
2 tasks done
@ScottN-PV
fix(server): run windowed snapshots on the SQLite reader
135b85c
@ScottN-PV
ScottN-PV force-pushed the fix/21840-snapshot-reader branch from b0493ba to 135b85c Compare October 21, 2026 12:28
t3dotgg and others added 21 commits October 21, 2026 05:31
@t3dotgg @claude
fix(server): t3 pair in a worktree no longer falls back to the live i…
448b8a9
…nstall (pingdotgg#22855)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@voltcrash @claude
fix(server): avoid expensive diff minimization in status refreshes (p…
370b9ae
…ingdotgg#21872)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@only21mil @claude @codex
fix(codex): keep every path of a multi-file patch (pingdotgg#22541)
aacd1ee
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: GPT-6.1 Sol <[email protected]>
@Mnigos
fix(gitlab): merge request diffs page 30 files at a time so GitLab 15…
588150e
….7 to 17.10 answer (pingdotgg#21909)
@fixfon
fix(server): keep Antigravity question options and no-custom-answer f…
2d40894
…lag in V2 (pingdotgg#22019)
@t3dotgg @claude
fix(server): commit prompts no longer repeat CLAUDE.md when it matche…
1d9060b
…s AGENTS.md (pingdotgg#22848)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@fixfon
fix(mcp): point a bare thread uuid at its mcp: thread in thread_not_f…
b260a7c
…ound (pingdotgg#22452)
@fixfon
fix(opencode): out-of-funds failures show OpenCode's message instead …
2f021ee
…of a usage limit (pingdotgg#22596)
@Project516
fix(shared): accept a pasted ChatGPT callback URL that is missing htt…
35e5d62
…p:// (pingdotgg#21750)
@t3dotgg @claude
fix(server): the background service picks up JAVA_HOME from the login…
a7c22f1
… shell (pingdotgg#22856)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@t3dotgg @claude
fix(server): answered questions say "already answered" instead of "no…
e822ba7
…t found" (pingdotgg#22850)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@t3dotgg @steve-cooks @claude
fix(desktop): an abandoned browser sign-in no longer blocks T3 Connec…
810e8f6
…t for 3 minutes (pingdotgg#22903)

On desktop, an abandoned browser sign-in blocked every T3 Connect sign-in for 3 minutes. A new attempt now replaces the stale Clerk flow, and a Cancel bar resets the sheet. Takeover of pingdotgg#22708.

Co-authored-by: steve-ai-vibe <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@t3dotgg @claude
fix(server): agents get a short, current model list instead of a 55k-…
680152e
…character catalog dump (pingdotgg#22889)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
docs(agents): proof for a bug fix depends on the bug (pingdotgg#23008)
9179178
Co-authored-by: Claude Fable 5.1 <[email protected]>
@SunkenInTime @sheehanmunim
@claude @juliusmarminge
fix(server): removing a worktree on Windows no longer deletes what it…
fa42465
…s junctions point to (pingdotgg#21099)

Co-authored-by: sheehanmunim <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
@juliusmarminge @claude
perf(web): a streaming thread re-renders only its own sidebar row (pi…
5a0d159
…ngdotgg#22730)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
refactor(web): the add environment dialog owns its form state (pingdo…
0bdf33a
…tgg#22686)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@wobsoriano
fix(desktop): use Clerk's upstream fix for abandoned browser sign-ins (…
4196708
…pingdotgg#23038)
@juliusmarminge @claude
feat: show automation messages as compact timeline rows (pingdotgg#22638
d27c606
)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
feat(server,web,mobile): approvals in full access say why Claude asked (
e749245
pingdotgg#22546)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
feat(claude): idle compaction has a global default and per-instance o…
d13fc84
…verrides (pingdotgg#23037)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Yash-Singh1 and others added 20 commits October 21, 2026 22:22
@Yash-Singh1
fix(client-runtime): refresh Git refs when the RPC session changes (p…
a98ebde
…ingdotgg#23314)
@Yash-Singh1
fix(web): cap list layout passes to prevent React error 185 (pingdotg…
05b697f
…g#23315)
@juliusmarminge
fix(mobile): align iPad composer without shifting on keyboard focus (p…
e075957
…ingdotgg#23355)
@juliusmarminge @claude
feat(gitcafe): request reviewers and apply labels on GitCafe pull req…
6e3c5e6
…uests (pingdotgg#23034)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
fix(source-control): clones retry over HTTPS when the SSH key is refu…
a49d18c
…sed (pingdotgg#23170)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@shivamhwp @vdoshi96
@claude PR Batch Tester
fix(mobile): the iOS composer reopens where you left a long draft (pi…
efa5381
…ngdotgg#23096)

Co-authored-by: Vishal <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: PR Batch Tester <[email protected]>
Co-authored-by: Vishal Doshi <[email protected]>
@juliusmarminge
fix(mobile): preserve new-thread drafts and native header layout (pin…
002e941
…gdotgg#23366)
@juliusmarminge @claude
feat: ChatGPT Business usage limits offer a copyable admin request (p…
6f75bcb
…ingdotgg#23361)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@shivamhwp PR Batch Tester
@NikitaMGrimm @claude
fix(web): paused sidebar videos stop reloading after every command (p…
3b95e78
…ingdotgg#23106)

Co-authored-by: PR Batch Tester <[email protected]>
Co-authored-by: Nikita Maximilian Grimm <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@t3dotgg @claude
chore(typecheck): typescript is the tsc-rs drop-in, no effect-tsgo pa…
4040867
…tch (pingdotgg#23023)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@t3dotgg @onlydole @claude
fix(mobile): Dynamic Island status no longer wraps next to other Live…
96bae54
… Activities (pingdotgg#23327)

Fixes pingdotgg#15682. Takes over pingdotgg#23035.

Co-authored-by: Taylor Dolezal <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
perf(web): streamed reply text no longer re-renders ChatView (pingdot…
83f118a
…gg#23117)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
perf(web): visit marks during a reply no longer re-render ChatView (p…
ee33c4c
…ingdotgg#23124)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@shivamhwp PR Batch Tester @claude
fix(server): a Claude agent stops when the server that started it dies (
5ffe045
pingdotgg#23389)

Co-authored-by: PR Batch Tester <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@shivamhwp PR Batch Tester @claude
fix(server): SSH hosts no longer keep every old 300 MB runtime after …
ff52547
…desktop updates (pingdotgg#23113)

Co-authored-by: PR Batch Tester <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
fix(settings): older clients connect again after idle compaction modes (
43879d9
pingdotgg#23454)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@juliusmarminge
fix(mobile): unify draft and thread navigation and composer behavior (p…
8d3b061
…ingdotgg#23467)
@juliusmarminge @ScottN-PV @claude
test(server): windowed snapshots must not wait on the SQLite writer
9f597f2
Failing regression test for pingdotgg#21840. getThreadSnapshotWindow runs in a
writer transaction, so a held writer makes the snapshot fail with
"database is locked" instead of reading the committed thread.

Test taken unchanged from pingdotgg#21869 by ScottN-PV.

Co-Authored-By: ScottN-PV <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @ScottN-PV @claude
fix(server): windowed thread snapshots no longer wait on the SQLite w…
247703a
…riter

getThreadSnapshotWindow ran its reads in a writer transaction, so a held
writer made opening a thread fail with "database is locked". Run the
transaction on the reader with NodeSqliteClient.readOnly, as ShellStream
and ThreadSearch already do. The snapshot only reads, and inside an open
write transaction the reads still use the writer.

Fixes pingdotgg#21840. Implementation from pingdotgg#21869 by ScottN-PV.

Co-Authored-By: ScottN-PV <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge
Merge contributor snapshot reader fix and current main validation
b16843c
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Oct 22, 2026
@juliusmarminge juliusmarminge added the bugfix Fix PR opened by an issue lead; enters the PR loop label Oct 22, 2026 — with GitCafe Production
@juliusmarminge juliusmarminge added the pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked label Oct 22, 2026
This was referenced Oct 22, 2026
perf(server): the projection read path takes the lock on the reader connection #23689
Closed
[Bug]: the other ProjectionStore reads take the write lock instead of the reader connection #23687
Closed
@matthias-scale matthias-scale mentioned this pull request Oct 25, 2026
[Bug]: All read-only queries share one SQLite reader with one permit, so one slow read blocks every other read; ensureTranscript also re-queries native V2 threads on every call #24660
Closed
@juliusmarminge GitCafe Production

juliusmarminge commented Oct 30, 2026

Copy link
Copy Markdown
Member

Closing: current main already covers this as of 6ed47b538c. If you still see it on a build that includes that commit, reply and we'll reopen.

All reactions

Sorry, something went wrong.

Uh oh!

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

@juliusmarminge juliusmarminge closed this Oct 30, 2026
@juliusmarminge juliusmarminge removed the pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop size:XXL 1,000+ 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.

Opening a long thread blocks the database writer for 7–10 s

Uh oh!

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

20 participants

@ScottN-PV @juliusmarminge @t3dotgg @voltcrash @only21mil @Mnigos @fixfon @Project516 @SunkenInTime @wobsoriano @koushikxd @tlconde @Gourav224 @nabettu @MarcoDotIO @tris203 @EtanHey @macodev00 @M4NU5 @lgollut
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.