You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
revert(native-chat): remove blocking live history cleanup - #37873
Large chat histories can freeze Orca when the live-history cleanup added by #36053 runs. This release rollback removes that added compaction and vacuum work.
What Changed
Reverts #36053 (2a5ec2bd47919fc9b3c4194a541e35d5d981606e). The older retired-history cleanup remains. Saved formats, readers and writers are unchanged, including support for histories already compacted. A surviving test now cold-reopens sparse history, continues writing, and reopens again.
Why
The complete asynchronous repair in #37802 is still being finished. This is the requested temporary rollback for the release: redundant live history can grow again until that repair is ready. Older synchronous saves and retired-history cleanup remain, so this does not claim to fix every source of stalls.
Linked Issue
Tracked in STA-13374 and STA-13375. STA-13375 tracks cherry-picking this revert PR only and is assigned to Brennan.
Visual Proof
N/A — background database maintenance changes; no UI or interaction change.
Testing
Automated tests updated: six focused journal suites, 40 tests passed on macOS. They cover retired cleanup and retry/stop, frozen format-1 compatibility, sparse catch-up/cold reopen/continued writes, storage admission, scaling contracts and recorded Claude/Codex streams.
Local lint, static rules and formatting passed through the normal commit hook and again for the main merge.
Final-head CI passed on c9e64611f16ce65c7f0eb3dec53b8eb7fd1fde13, including cross-version compatibility, all unit shards, typecheck, packaging, persistence and WSL checks. One unit worker initially exited with SIGABRT without an assertion failure; a failed-job-only retry passed. The earlier historical setup blocker was cleared by main's test: remove 11 low-value declarations and batch historical checkout fetches #37894. No local app or build run was required.
Risk
Level: Medium. Live-history pruning and disk reclamation pause, so redundant history can grow again. Existing formats and client/SSH/mobile contracts are unchanged. Reverting this rollback restores the added cleanup and its known stall risk; neither direction recreates already-deleted intermediate revisions, which the unchanged readers do not require.
Review
Independent correctness, architecture and final comparison reviews passed without findings. The earlier main merge was also checked: the rollback diff is byte-identical to the reviewed patch, and test evidence carries across it. A second main sync brings in #37894 to address the inherited CI blocker; its narrow merge check passed with no findings, and final-head CI is green. No journal compatibility assertion failure was reported. All independent reviews and the final readiness check passed on the reviewed head.
Agent skill upstream boundary
Not applicable: no upstream skill-installer material copied or translated.
Notes
No dependency, schema, wire-format, platform path, provider parser, login, or UI change. Shared recorded Claude/Codex coverage passed; no running-app QA was required for this maintenance rollback. No measured runtime latency or whole-main release-readiness claim is made.
Checklist
Focused rollback; user-facing result, mechanism, temporary growth and follow-up explained.
Risk and back-out behavior stated.
Visual proof N/A with reason.
Self-review and independent correctness, security, compatibility and performance review complete.
Cross-platform, SSH/remote, mobile and saved-data impact considered.
Final-head CI complete.
Final readiness check passed on the reviewed head.
Reverts 2a5ec2b for the next release. Preserve a sparse-history cold-reopen and continued-write contract for already compacted chats. The asynchronous cleanup repair remains separate.
No actionable comments were generated in the recent review.
Walkthrough
The journal sweeper now performs retired-outcome cleanup without running outcome compaction or incremental vacuum. The compaction and vacuum implementations and their associated tests were removed. Other journal tests were changed to check state preservation across reopen and to remove several cleanup and projection assertions.
Merge Risk: Minimal · up to c9e64
No actionable issue was identified in the supplied change. Merge readiness remains subject to normal checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title names a revert of live-history cleanup in the native-chat journal, which matches the changeset. It removes the compaction and vacuum work added by #36053, and the summary confirms the delete…
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.
Description check
The pull request description includes all required sections and clearly explains the rollback, rationale, testing, risk, compatibility impact, visual proof, and back-out behavior. It links the tracked…
Full details: Title check
Explanation
The title names a revert of live-history cleanup in the native-chat journal, which matches the changeset. It removes the compaction and vacuum work added by #36053, and the summary confirms the deleted journal-compaction and incremental-vacuum modules. The title is short, specific, and uses the conventional revert prefix.
Full details: Description check
Explanation
The pull request description includes all required sections and clearly explains the rollback, rationale, testing, risk, compatibility impact, visual proof, and back-out behavior. It links the tracked issues and marks the non-UI visual proof as N/A with a reason.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
Retain the retired-cleanup state checks without restoring compaction assertions.
213-214: Trivial · Data Integrity & Integration · Quick win
Retain the retired-cleanup state checks without restoring compaction assertions.
The deleted test covered live-state preservation after JournalOutcomeSweeper.pass() and after a cold reopen. The surviving mixed-epoch test checks the live state before the sweep, then checks only retired rows after the sweep. Restore the focused cleanup, encoded-state, orphan-row, and final reopen assertions.
Suggested fix
import { restoreJournal } from './journal-open'
+import { JournalOutcomeSweeper } from './journal-outcome-cleanup'
import { applyJournalRow, renderJournalState } from './journal-reducer'
...
import type { JournalHostDatabase } from './journal-host-database'
import type { JournalRow } from './journal-row-schema'
+import { encodeJournalState } from './journal-state-codec'
...
expect(
restoreJournal(database.db, sessionId)?.state.appliedSettlementIds.has('stop-settlement')
).toBe(true)
+ await journal.replaceEpochItems('handle_forked', 1, [+ {+ identity: stoppedTurn,+ body: { kind: 'turn', turnId: 'stop-turn', state: 'interrupted', completedAt: at + 1 },+ ownerFence: 1+ }+ ])+ const rewound = journal.snapshot()+ const saved = encodeJournalState(restoreJournal(database.db, sessionId)!.state)+ const sweeper = new JournalOutcomeSweeper({ database: () => database, delay: async () => {} })+ disposals.push(() => sweeper.stop())+ await sweeper.pass()+ expect(encodeJournalState(restoreJournal(database.db, sessionId)!.state)).toEqual(saved)+ expect(+ database.db+ .prepare(`SELECT COUNT(*) AS n FROM journal_outcomes WHERE generation NOT IN+ (SELECT generation FROM journal_outcome_epochs)`)+ .get()?.n+ ).toBe(0)+ await journals.closeAll()+ expect(+ (await journals.open({ identity, stateDirectory: root, now: () => at })).snapshot()+ ).toEqual(rewound)
}
)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Large chat histories could freeze Orca during the live-history compaction and vacuum added by #36053. This PR removes that work for the release while preserving the older retired-history cleanup and existing saved-history readers and writers. Histories that were already compacted can still reopen and accept more writes.
Independent correctness, architecture and final reference comparisons passed with no findings. The production change is the exact inverse of #36053; the extra test covers sparse cold reopen, continued writing and a second reopen. Six focused journal suites passed all 40 tests, including recorded Claude/Codex streams, cleanup retry/stop, saved formats and scaling contracts. Final-head CI is green, including cross-version compatibility and WSL. One unit-test worker initially aborted with SIGABRT; the reviewed failed-job-only retry passed. Its underlying abort cause remains unknown.
Test/reference evidence was recorded on bdc4907. Main merges e400eac and c9e6461 preserve the reviewed rollback; narrow independent checks passed and CI ran on the current head. No app run or screenshots are required for this background-maintenance rollback under the tests QA row.
Temporary difference: redundant live history may grow until the asynchronous repair tracked in #37802 is ready. Older synchronous saves remain; this is not a claim that every source of stalls is fixed. No remaining review findings or additional scaling work were identified.
For Brennan's review: retained retired-history cleanup. Cherry-pick task STA-13375 covers this revert only. Whole-main release readiness has not been audited by this PR review.
…7873)
Revert the live-history compaction and incremental vacuum added by stablyai#36053 to remove their serving-thread stall risk for the release. Preserve retired-history cleanup, saved formats/readers/writers and already-compacted sparse histories; add sparse reopen/write/reopen coverage.
Temporary: redundant live history can grow until the separate repair tracked in stablyai#37802 is ready. Older synchronous saves remain.
Tracked in STA-13374 and STA-13375. Six focused suites / 40 tests, independent correctness/architecture/final comparison and final-head CI passed.
(cherry picked from commit 25c6757)
Restore the live-history cleanup that #37873 temporarily removed, now on the
off-thread native writer, and port main's retained-input, logical context,
queue and ownership changes onto the asynchronous journal boundary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
ELI5
Large chat histories can freeze Orca when the live-history cleanup added by #36053 runs. This release rollback removes that added compaction and vacuum work.
What Changed
Reverts #36053 (
2a5ec2bd47919fc9b3c4194a541e35d5d981606e). The older retired-history cleanup remains. Saved formats, readers and writers are unchanged, including support for histories already compacted. A surviving test now cold-reopens sparse history, continues writing, and reopens again.Why
The complete asynchronous repair in #37802 is still being finished. This is the requested temporary rollback for the release: redundant live history can grow again until that repair is ready. Older synchronous saves and retired-history cleanup remain, so this does not claim to fix every source of stalls.
Linked Issue
Tracked in STA-13374 and STA-13375. STA-13375 tracks cherry-picking this revert PR only and is assigned to Brennan.
Visual Proof
N/A — background database maintenance changes; no UI or interaction change.
Testing
c9e64611f16ce65c7f0eb3dec53b8eb7fd1fde13, including cross-version compatibility, all unit shards, typecheck, packaging, persistence and WSL checks. One unit worker initially exited with SIGABRT without an assertion failure; a failed-job-only retry passed. The earlier historical setup blocker was cleared by main's test: remove 11 low-value declarations and batch historical checkout fetches #37894. No local app or build run was required.Risk
Level: Medium. Live-history pruning and disk reclamation pause, so redundant history can grow again. Existing formats and client/SSH/mobile contracts are unchanged. Reverting this rollback restores the added cleanup and its known stall risk; neither direction recreates already-deleted intermediate revisions, which the unchanged readers do not require.
Review
Independent correctness, architecture and final comparison reviews passed without findings. The earlier main merge was also checked: the rollback diff is byte-identical to the reviewed patch, and test evidence carries across it. A second main sync brings in #37894 to address the inherited CI blocker; its narrow merge check passed with no findings, and final-head CI is green. No journal compatibility assertion failure was reported. All independent reviews and the final readiness check passed on the reviewed head.
Agent skill upstream boundary
Notes
No dependency, schema, wire-format, platform path, provider parser, login, or UI change. Shared recorded Claude/Codex coverage passed; no running-app QA was required for this maintenance rollback. No measured runtime latency or whole-main release-readiness claim is made.
Checklist