Repository navigation
fix(server): shell snapshots no longer block other database reads while decoding - #17141
Conversation
The HTTP and WebSocket shell loaders kept the shared SQLite connection in a transaction while they decoded every thread row, so auth checks, thread subscribes and background sweeps queued behind the conversion. ProjectionStore.readShellSnapshot now runs the reads and returns a decode step. loadActiveShellSnapshot (used by both loaders) and the archived shell read threads, projects and sequence in one transaction, then decode after it commits. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d step Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… loader Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server-side concurrency fix that keeps shell snapshot reads consistent while releasing the shared SQLite connection before expensive decoding. The shared loader and targeted tests cover the active and archived snapshot paths without changing schemas, defaults, or deployment behavior. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
Loading the shell snapshot held the server's only SQLite connection while it decoded every thread row, not just while it read them. Auth checks, thread subscribes, and background sweeps all waited behind it. On real data, cheap queries waited from 100 ms to several seconds (#14701).
The shell reads still run in one transaction, so threads, projects, and the sequence agree. The decode now runs after the transaction commits.
ProjectionStore.readShellSnapshotdoes the SQL reads and returns the decode step. The active HTTP, active WebSocket, and archived shell loaders shareloadShellSnapshotParts.getShellSnapshotdecodes after its own transaction too.This continues #17044 by @SunkenInTime (Dara Adedeji), who wrote the fix, the tests, and the measurements. See that PR for the full write-up. Changes in this takeover:
main. The only conflict was an import inhttp.ts.Verification:
SELECT 1waited a median of 43 ms with decode inside the transaction and 0.11 ms with this change.apps/servertypecheck is clean, and the focused tests pass:ShellStream,ProjectionStore,ws,AgentAwarenessRelay,ProviderTurnControlService,ProjectionSettlement, andtransferBudgetV2.Original work by Dara Adedeji with Claude Opus 5.5 in Claude Code. Takeover by Claude Opus 5.5 in Claude Code, running inside T3 Code.
🤖 Generated with Claude Code