Repository navigation
fix: clear compaction metadata on session reset - #81367
moeedahmed wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 12:55 AM ET / 04:55 UTC. Summary PR surface: Source -2, Tests +61. Total +59 across 2 files. Reproducibility: yes. A high-confidence source reproduction is to seed a session entry with Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this compaction-metadata clearing behavior with the focused regression test after refreshing it against current main or folding it into the canonical reset-cleanup landing path. Do we have a high-confidence way to reproduce the issue? Yes. A high-confidence source reproduction is to seed a session entry with Is this the best way to solve the issue? Yes. Removing those two preserved fields is the narrow maintainable fix for ordinary reset; the remaining question is only how maintainers want to refresh or combine it with the overlapping reset-cleanup work. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 59cec74d89ff. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -2, Tests +61. Total +59 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
After-fix proof from a real setupApplied an equivalent hot-patch on a production OpenClaw install while waiting for this PR to land. Same effective edit as this diff, applied directly to the compiled bundle of the running install (couldn't deploy from source due to a separate Setup
Patch appliedFile: compactionCount: currentEntry?.compactionCount,
compactionCheckpoints: currentEntry?.compactionCheckpoints,Verifications:
Symptom evidence — beforeThe Operator topic watchdog (runs every 10 min) was finding stale sessions repeatedly through the morning: Gateway stderr during this window showed the corresponding stuck pattern repeating per topic: Plus the eventual 1,830,000 ms ( Symptom evidence — afterContinuous clean watchdog readings since the hot-patch restart at 10:23:
Observation window so far: ~40 minutes of clean uptime. Happy to extend monitoring and follow up if a longer window would be valuable, or share raw watchdog log excerpts and individual session traces on request. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg: ✨ hatched 🌱 uncommon Frosted Review Wisp. Rarity: 🌱 uncommon. Trait: sparkles near resolved comments. DetailsShare on X: post this hatch
About:
|
Problem
performGatewaySessionResetwas preservingcompactionCountandcompactionCheckpointsfrom the previous session entry when handling/newand/reset. Fresh sessions inherited stale compaction state from the prior conversation, causing the model to receive bloated context after every reset cycle.Symptom
Long-running Operator topics on Telegram (General, System, Ledger) progressively degenerate into acknowledgement-only replies after several reset cycles. The transcript fills with "I'll post the result in …" placeholders with no actual model output following.
Fix
Drop the two preserved fields. Reset now truly clears compaction state.
Test
Added
server.sessions.reset-models.test.tscovering 7 reset paths. Targeted run passes (1 file, 7 tests).Real behavior proof
/newand/resetshould start a fresh session instead of preserving stale compaction metadata from the previous session entry.2026.5.10-beta.1on127.0.0.1:18789after the local source patch was built/restarted./newhad been used.compactionCount/compactionCheckpointsfrom the prior entry, and the affected live Telegram topic sessions are no longer carrying stale checkpoint metadata after reset.Discovery
Found while debugging stuck-after-ack symptoms on Operator topics on 2026-05-13 BST. Investigation summary lives in workspace memory.