Repository navigation
fix: pair successful no-op compaction hooks - #118094
Conversation
|
Codex review: blocked before merge. Reviewed September 6, 2026, 12:47 PM ET / 16:47 UTC. ClawSweeper reviewWhat this changesThe PR completes plugin notifications after successful engine-owned compaction attempts that leave history unchanged, documents the zero-count result, and adds queued and recovery regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused fix: current main still suppresses successful no-op completion hooks in both affected paths. No introduced correctness defect was found, and the captured production-path evidence supports the narrowed repair. Priority: P2 Review scores
Verification
How this fits togetherContext engines manage conversation compaction for OpenClaw agents. Manual requests and overflow or timeout recovery invoke the engine, then notify plugin observers and perform history-related follow-up when compaction actually occurred. flowchart TD
A[Manual compaction request] --> C[Context engine attempt]
B[Overflow or timeout recovery] --> C
C --> D{Successful and still active?}
D -->|No| E[No completion hook]
D -->|Yes| F[Notify plugin observers]
F --> G{History compacted?}
G -->|Yes| H[Compaction accounting and follow-up]
G -->|No| I[Zero-count completion]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +30, Docs +4. Total +32 across 5 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete successful engine-owned attempts through the existing zero-count hook contract while keeping transcript mutation, accounting, and native follow-up conditional on actual compaction. Do we have a high-confidence way to reproduce the issue? Yes, from source: an engine returning {ok:true, compacted:false} reaches the current-main completion gates and is excluded in both paths. This review did not execute the runtime; the captured baseline/candidate report independently describes that failure and recovery. Is this the best way to solve the issue? Yes. Removing only the completion predicate and using the existing zero-count payload repairs the lifecycle owner without adding API fields or enabling mutation-only follow-up. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6b7db226a9a8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (21 earlier review cycles; latest 8 shown)
|
5c0aba0 to
aa708d1
Compare
|
Addressed all ClawSweeper rank-up moves and refreshed the branch onto current
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
92dabbf to
251956d
Compare
|
Exact-head refresh is complete at @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
251956d to
699bce2
Compare
|
Addressed the remaining P1 on exact head
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Emit the existing zero-count completion after successful engine-owned no-ops in queued and recovery paths. Keep failure, cancellation, ownership and mutation-only follow-up gates intact, and reuse current regression fixtures. Related: openclaw#81925 Co-authored-by: peterolkhov <peter@useprox.com>
Bring in the landed CI output-limit repair so required checks can admit the no-op compaction candidate. Preserve the proven hook changes and contributor ancestry through an ordinary merge. Co-authored-by: peterolkhov <peter@useprox.com>
|
Merged via squash.
|
Co-authored-by: peterolkhov <peter@useprox.com>
What Problem This Solves
Related: #81925.
A context engine can successfully decide that no compaction is needed. OpenClaw sent
before_compactionfor that attempt but omittedafter_compaction, leaving plugin observers waiting for a completion that never arrived.Why This Change Was Made
The queued/manual and overflow/timeout recovery emitters now complete successful engine-owned no-ops using the existing
compactedCount: 0payload. Actual compactions retain their existing metrics. Attempts that fail, abort or lose their owner remain excluded. Transcript adoption, checkpoints, maintenance, memory synchronization and native follow-up still require an actual compaction.The patch is refreshed against the current emitter locations. The original subscriber correction is already on main and is omitted from this change. Existing fixtures cover the current queued and recovery paths without adding a production test seam.
User Impact
Plugins observing a successful no-op receive its completion and can distinguish it from changed history using the existing zero count. This addresses the engine-owned lifecycle part of the linked issue; it does not change native/Copilot hook semantics or validator error wording.
The review’s observer-compatibility concern is accepted for this repair: successful engine-owned no-ops are an existing documented result, and
compactedCount: 0is the existing signal for unchanged history. This follows the maintainer direction on the predecessor. Consumers that need changed history can use the count; the completion remains available to observers waiting for the attempt to finish.Evidence
Current head:
20158ac193a0878bb92d0be2f465abfacfcad0a9.Production +2/-4, net −2; tests +34/-4, net +30; reference documentation +4/-0.
Hosted baseline/candidate proof runs the actual Gateway
sessions.compactcall through a registered external context-engine plugin. Both repeated successful no-ops omit completion on baseline and emit exactly oneafter_compactionwith count zero on the candidate. Returned and thrown failures produce no completion hook on either side. Session accounting and the full transcript remain unchanged, and the provider endpoint receives zero calls.The queued, overflow and timeout regressions fail on baseline for the intended missing callback; their real-compaction and failed-result controls pass. All six focused cases pass on the candidate, followed by 225 passing current owner/subscriber tests, both private-QA builds and the full
check:changedgate. The test includes real plugin loading, hook dispatch and SQLite state access, with a deterministic no-op engine; it does not claim authenticated external-provider testing.The experiment is pinned to main
954d47a99a6b814da0bb31eb92adeb8603368f20plus this exact production/test patch. All four emitted source hashes match the composed candidate. Pinned formatting and diff checks pass. Fresh isolated Codex source review through P2 and independent source and proof verification found no actionable findings. The branch now includes the landed CI preflight output-limit repair from main. The previous run stopped before tests at GitHub’s job-output limit; final independent review of the new committed head is also clean. Required CI is green on this exact head.The ordinary merge preserves the original contributor commits and credit to @peterolkhov. No public hook fields, options, schemas, dependencies or runtime defaults are added.