GeezerVison is showing github.com — fix(server): keep compaction cadence across restarts by juliusmarminge · Pull Request #21880 · pingdotgg/t3code
Conversation
Restarting the server triggered a full compaction scan one minute later, even if a scan had just completed. Persist the time of the last successful completion beside the database and wait until the six-hour interval is due, bounded to one minute–six hours after startup. Missing, unreadable or invalid timestamps retain the one-minute fallback.
Successful passes save completion time even when nothing was deleted. Failed passes preserve the prior timestamp; a timestamp-write failure does not stop maintenance. Normal six-hour scheduling remains.
Verification: DatabaseStorage.test.ts grew from 3 to 13 cases in two table-driven tests. Real temporary files, the actual service and controlled Effect time cover recent/overdue/future/missing/invalid/unreadable timestamps, successful completion, compaction/write failures and periodic scheduling. Recent/future cases fail against main. Targeted lint/format and server typecheck pass. Two independent full-diff rounds from Opus 5.5 and Sol 6 found no blockers.
No CPU or memory improvement is claimed from this test evidence. No full app/provider run or native macOS/Windows/Electron/iOS/Android verification; original author measurements were not reproduced. No visual UI change; screenshots are not applicable. Human review and approval remain. All run CI jobs passed on this head. Macroscope’s neutral result requires a human to approve the cadence policy. Unmerged.
Rebuilt from Alyx-ML's #21192, split by concern. Original intent is preserved; no dependency or contract changes.
Reader-worker discovery follows in #21881.
Reviewed head 88465a1. Primary integrated run: 59/59 tests passed. Both reviewers found no blockers in two full-layer review rounds. Verification output.
Clock caveat: a saved timestamp far in the future produces the six-hour startup cap on each launch until time catches up; this preserves the original proposed policy.
Fresh tests: Codex gpt-6-astra. Independent implementation: Codex gpt-6.1-sol through T3 Code. Independent full-diff reviews: Claude claude-opus-5-5 and Codex gpt-6-sol.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Rebuild the cadence portion of PR #21192 by Alyx-ML; contributor credit retained in the replacement PR.
juliusmarminge
changed the title
usage billing 01/compaction cadence
fix(server): keep compaction cadence across restarts
Oct 19, 2026
Approvability
Verdict: Approved at 4c62cee
Macroscope's review found this PR approvable — This focused server maintenance fix persists successful compaction completion and resumes the existing six-hour cadence after restarts, with fallback and failure behavior covered by targeted tests. The other changes are test-only or an import needed by existing mobile callbacks, with no schema, user-facing default, security, billing, or deployment impact.
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.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
20.9 KiB |
20.9 KiB |
0 B (0.0%) |
29.3 KiB |
✅ |
| Codex |
Live turn messages |
2 |
2 |
0 (0.0%) |
8 |
✅ |
| Claude |
Total thread wire |
5.0 KiB |
5.0 KiB |
+24 B (+0.5%) |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
+24 B (+2.0%) |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
21.2 KiB |
21.2 KiB |
+41 B (+0.2%) |
29.3 KiB |
✅ |
| Claude |
Live turn messages |
1 |
2 |
+1 (+100.0%) |
8 |
✅ |
Baseline: 7ce7fe3 · PR result: 4c62cee · 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: 108.5 KiB
- Claude decoded thread snapshot: 108.8 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.
coderabbitai
Bot
commented
Oct 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
9186d14b-2ec6-40a3-af21-90deb462b9fd
📥 Commits
-
Reviewing files that changed from the base of the PR and between b5bc173 and 4c62cee.
📒 Files selected for processing: 1
-
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
📝 Walkthrough
-
DatabaseStorage now schedules event-store compaction from a persisted completion timestamp. It records successful completion times and repeats compaction every six hours. Tests cover startup timing, cadence, and timestamp behavior when compaction or timestamp writes fail. ThreadDetailScreen adds a React hook import.
Changes: Event-store compaction scheduling
| Layer / File(s) |
Summary |
Persist completion time and schedule compaction apps/server/src/persistence/DatabaseStorage.ts, apps/server/src/persistence/DatabaseStorage.test.ts |
DatabaseStorage reads compacted-at to calculate the initial delay, runs compaction on a six-hour cadence, and attempts to save the completion time after success. Tests cover timestamp values, startup delays, repeated runs, and failure cases. |
Mobile import update
| Layer / File(s) |
Summary |
Add React hook import apps/mobile/src/features/threads/ThreadDetailScreen.tsx |
ThreadDetailScreen imports useCallback. No runtime behavior or public declarations change. |
Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant DatabaseStorage
participant FileSystem
participant Clock
participant EventStore
DatabaseStorage->>FileSystem: Read compacted-at timestamp
DatabaseStorage->>Clock: Wait for calculated initial delay
DatabaseStorage->>EventStore: Run compactEventStore
DatabaseStorage->>FileSystem: Write completion time after success
DatabaseStorage->>Clock: Repeat after six hours
Loading
Suggested reviewers: t3dotgg
Merge Risk: ⚪ Minimal · up to 4c62c
-
The reviewed changes are ready to merge with no verified actionable risk.
Pre-merge checks: 3 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Description check |
 |
The description explains the problem, implementation, verification coverage, limitations, and testing results. However, it does not provide the required explicit scope-and-approval evidence, such as a… |
Add a Scope and approval section. Link the triaged issue or approval discussion with the maintainer approval comment, or explain why this focused fix qualifies for an exemption. Use the template headings to make Problem, Change, Scope and a… |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main change: preserving server compaction cadence across restarts. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Description check
-
Explanation
The description explains the problem, implementation, verification coverage, limitations, and testing results. However, it does not provide the required explicit scope-and-approval evidence, such as a maintainer approval link or a clear justification for an approval exemption.
Resolution
Add a Scope and approval section. Link the triaged issue or approval discussion with the maintainer approval comment, or explain why this focused fix qualifies for an exemption. Use the template headings to make Problem, Change, Scope and approval, and Verification explicit.
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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.
|
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.
aorwall
added a commit
to aorwall/t3code
that referenced
this pull request
Oct 20, 2026
Merges upstream `pingdotgg/t3code` at `143ab1606d` (base `ab6be13d43`,
376 commits) into the fork. No merge PR was open, so this branches from
`main`.
## Merge
- **Landed:** 1177 files out of 1177 in the upstream range. The only
missing files are `apps/server/src/cli/pair.ts` and its test, which the
fork deliberately keeps deleted. The fork delta is now 817 files.
- **Conflicts:** 14, each resolved by its `preflight.mjs` verdict. The
tracker entry in `docs/fork/upstream-merge-log.md` covers each one. The
ones a reviewer should read:
- **`ProjectDefaultsSettings.tsx`:** upstream moved the
agent-browser-access row to `IntegrationsSettings.tsx`
(`AgentBrowserAccessSetting`). The fork's `workspaceOwnsProjectDefaults`
gate moved with it and returns null at a Workspace project scope.
- **`terminal.ts`:** keeps the fork's `TerminalMetadataState` seed and
takes upstream's `Stream.drop(1)`. Upstream's new `runtime.test.ts`
metadata test now reads `.terminals`.
- **`Sidebar.tsx` / `Sidebar.logic.ts`:** upstream's new
`resolveSidebarRowThreadId` resolves against the unfiltered shells. It
now takes `source`, because the fork's `isSidebarSubagentThread` hides
only provider-native subagents.
- **`ChatView.tsx` (auto-merged):** the fork's hosted script path calls
`storeSetActiveTerminal` again. The local path drops its early
`setTerminalOpen(true)`, following upstream pingdotgg#18340, so the drawer no
longer claims the default terminal id.
- **`AGENTS.md`:** keeps the fork's prose and adds upstream's new
`Effect.fn` rule.
- **`apps/mobile/package.json`:** takes upstream's test script and keeps
`tsc` rather than `tsc-rs`.
- **`pnpm-lock.yaml`:** `tsc-rs` entries stripped, then re-derived with
`install.mjs`.
- **Other fixes:**
- `fork/goToDefinition.test.ts` moved to browser mode for upstream's new
`no-dom-test-environment` lint rule.
- `ThreadDetailsPrRows.browser.test.tsx` now passes
`activeProjectScriptsEditable`.
- One new `duplicateAddExceptions` entry was added and one stale one
retired.
- **Unsupported methods:** ADD 0, DROP 0, KEEP 2.
`packages/contracts/src/rpc.ts` is unchanged.
## Verification
`verify.mjs --sequential`:
- duplicate-adds, tripwires, resolution-check, unsupported-methods,
lockfile, fmt, lint, typecheck and build all pass.
- `test` fails. The files that fail when run alone are the same five as
on 2026-10-19 (`AgentScope`, `OpenCodeServerLedger`, ssh `tunnel`,
`AcpAdapterV2`, `OrchestratorReplayFixtures`), all sandbox
process-reaping or auth issues.
- Two new failures are also environmental: the partial-clone tests in
`GitVcsDriver.test.ts` and `RepositoryIdentityResolver.test.ts`. The
sandbox's `~/.gitconfig` rewrites `[email protected]:` to https with
`insteadOf`.
- `@t3tools/web` had one real failure, upstream's new Sidebar subagent
test. It is fixed and passes on its own.
**Caveat:** the last amend changed only that test fixture and the docs.
The sandbox restarted three times during this run, and the typecheck and
fmt re-run after that amend did not finish. A follow-up comment will
report it.
## Usable as-is
- LaTeX/KaTeX math in chat markdown, behind the client setting
`mathRenderingEnabled` in Appearance, off by default (pingdotgg#18735).
- Mermaid renders while a message streams (pingdotgg#18308). Large changed-file
trees are virtualized (pingdotgg#21482, pingdotgg#21831). HTML previews skip the loading
skeleton (pingdotgg#21480).
- Pasted folders become workspace references (pingdotgg#22072). PR check rows
aligned, and skipped checks get a slash icon (pingdotgg#22090, pingdotgg#21498). A
confirmation before "Close with comment" (pingdotgg#18175).
- Subagent overflow badge (pingdotgg#19860). Context usage survives a fork
(pingdotgg#22075). Copy paths relative to the thread workspace (pingdotgg#21497). PDF
preview (pingdotgg#21095).
- Contract decoding tolerates newer PR shapes (`ForwardCompatibleArray`
/ `ForwardCompatibleOptional`; pingdotgg#19899, pingdotgg#21575, pingdotgg#21665).
- In-app browser search engine settings (pingdotgg#17688). These are client-only,
but they only matter where the browser panel is exposed.
## Unsupported in Moatless / needs implementation
- **`thread.stop` and `capabilities.threadStop` (pingdotgg#22052):** stops a
thread without resolving its run. The client falls back to the existing
stop path until the backend advertises `threadStop`. Added to the
capabilities gap.
- **`blocking: false` on async questions (pingdotgg#15430):** keeps a thread
Working while a question is open. The backend has to emit the field.
- **Provider `optionDescriptors` / `installedVersion` (pingdotgg#19519,
pingdotgg#19567):** drive dynamic model options and update checks. Both are
optional, so the client degrades.
- **Terminal `resume: true` on resubscribe (pingdotgg#18444):** the backend
should not reopen a closed shell.
- **`rootPath` on git diff/status results:** used for workspace-relative
paths.
- **`repositoryWebUrl` on PR links (pingdotgg#21575).**
- **Relay, T3 Connect, hosted sign-in and `t3 update` work:** not
applicable to the single-origin Moatless deployment.
## Backend behavior to consider reproducing in Moatless
- **Settlement:** an empty inactive thread auto-settles (pingdotgg#15783).
Settling clears snooze (pingdotgg#17547). An interrupted run does not start the
settle timer on a snoozed thread (pingdotgg#17789).
- **Runs:** auto-delivered messages queue between provider turns
(pingdotgg#15691). A message promoted into a stopping run stays queued (pingdotgg#16926).
Compaction cadence survives restarts (pingdotgg#21880).
- **ACP:** native foreground work settles independently, and child
routing moves between runs (pingdotgg#21614–pingdotgg#21616). Delegated children stop once
(pingdotgg#18826).
- **Terminals:** slow clients no longer queue unbounded output (pingdotgg#18429).
Shells do not inherit tmux (pingdotgg#13359). Script commands stay out of shell
history (pingdotgg#13903).
- **Files:** saves no longer follow a symlink out of the workspace
(pingdotgg#18819). This one is security-relevant.
- **Git:** new worktrees fetch the base branch's own tracked remote
(pingdotgg#21032). Rename and non-ASCII paths are kept in changed-file lists
(pingdotgg#20175). Rollback blocked by an index lock now says so (pingdotgg#11340).
The `docs/fork/gaps.md` entries "Capabilities are reported…" and
"Runtime fixes upstream made to its own server" are extended with these.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
Moatless task:
https://moatless.soaplabstest.com/tasks/d311aafc-7a38-48b7-9c14-30c4cac930a7
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
macroscope-review
Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews
size:M
30-99 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.
|