Repository navigation
fix(sessions): protected conversations stop shrinking session capacity - #123014
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 13, 2026, 2:07 AM ET / 06:07 UTC. ClawSweeper reviewWhat this changesThe PR changes session maintenance so Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the branch coherently repairs the protected-session quota defect across file, cleanup-preview, and SQLite maintenance, but it still lacks the documentation required for the changed Priority: P1 Review scores
Verification
How this fits togetherSession maintenance runs after file-backed and SQLite session writes, using preservation rules to decide which stored conversations can be pruned or capped. Its output determines retained session rows and the associated transcript cleanup plan. flowchart LR
A[Session writes] --> B[Session storage]
B --> C[Preservation rules]
C --> D[Eligible session count]
D --> E[Prune and cap decisions]
E --> F[Retained rows and transcripts]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +210. Total +219 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Document that Do we have a high-confidence way to reproduce the issue? Yes, from source: with 499 protected rows, three ordinary rows, and Is this the best way to solve the issue? No, not yet: the shared runtime repair is the best owner-boundary fix, but the PR must update the public retention contract before it is complete. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7c8f08a88ccc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
29f7740 to
8042c39
Compare
8042c39 to
1e3d979
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Fixes an issue where archived, active, locked, and channel sessions consumed the ordinary-session
maxEntriesallowance even though maintenance could not evict them. A store near the default 500-entry cap could therefore delete recent dashboard and subagent sessions on the next write.Why This Change Was Made
Maintenance now builds one eviction-eligible set, triggers on that set's size, and keeps the newest
maxEntrieseligible sessions. Protected sessions remain outside the quota. The active-session warning, file-backed path, cleanup preview, and SQLite write-triggered path all use the same accounting rule.SQLite maintenance reads and parses
session_nodesonce per enforcement check. It derives the complete protected-key set, eligible count, and stale-candidate decision from that snapshot, then reuses the same snapshot if maintenance runs. There is no additional count query and no new Plugin SDK export.Pinned-session immunity is independently provided by merged #122990. This branch is rebased over that fix and covers the combined preservation and quota behavior.
AI-assisted; the implementation and tests were reviewed against the full maintenance path.
User Impact
Large archived or otherwise protected histories no longer crowd recent ordinary sessions out of the maintenance allowance. When the eligible population itself exceeds the cap, only its oldest entries are removed.
Regression Window
The general accounting defect began in commit
1263d427on April 23, 2026, when active-session preservation was added by subtracting preserved rows frommaxEntries. The first affected tagged build isv2026.4.23-beta.1; the first affected stable release is v2026.4.23.Commit
de0d4842expanded the protected set to durable channel/thread conversations on May 2; that expansion first shipped stably in v2026.5.2.The archived-row saturation from this incident specifically began with #112554 on July 22, when archived sessions became maintenance-protected while retaining the old subtraction model. It is present in the
v2026.7.2-beta.4tag (not promoted) and first published in v2026.7.2-beta.5. As of August 13, 2026, no stable release tag contains that archived-row regression.Evidence
tbx_01kzws04xf1mcw11737zbn4bf1andtbx_01kzwtvvazw3dyce1rf286pk0j: targeted formatting and 178/178 focused session-maintenance and caller tests passed.gpt-5.6-sol/ high reasoning reported no accepted or actionable findings for the complete branch diff.