Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 26, 2026, 9:08 PM ET / July 27, 2026, 01:08 UTC. ClawSweeper reviewWhat this changesAdds a default Doctor lint warning when a positive compaction transcript-byte limit is configured without the required transcript-rotation setting, plus coverage for active, inactive, and zero-value configurations. Merge readinessThe patch is a focused diagnostic for a real inactive configuration state and the supplied terminal proof shows the warning and its suppression cases. No discrete correctness defect is evident, but enabling it in the default Doctor lint path changes the result and exit status for existing configurations, so a maintainer should explicitly accept that operator-facing compatibility choice before merge. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's compaction settings govern when a long session is summarized and whether its active transcript is rotated to a smaller successor. Doctor reads the effective configuration before runtime and reports unsafe or ineffective settings to operators and automation. flowchart LR
Config[Operator compaction config] --> Doctor[Doctor lint]
Doctor --> Parse[Parse byte-size limit]
Parse --> Decision{Positive limit and rotation disabled?}
Decision -->|Yes| Warning[Health warning and nonzero lint result]
Decision -->|No| Clean[No byte-guard finding]
Config --> Runtime[Compaction runtime]
Runtime --> Transcript[Active successor transcript]
Decision needed
Why: The source and docs establish that this setting combination leaves the guard inactive, but making Doctor flag it by default changes existing automation-visible lint results rather than only correcting runtime behavior. Before merge
Agent review detailsSecurityNone. PR surfaceSource +63, Tests +143. Total +206 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the diagnostic narrowly scoped to the documented inactive byte-guard configuration, and land it only after maintainers confirm that a default Doctor lint warning and nonzero result is the intended upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main disables the byte-size guard whenever transcript rotation is not enabled, even if the configured byte limit is positive. The PR body also supplies an after-fix built-CLI demonstration, but no failing current-main execution was run in this read-only review. Is this the best way to solve the issue? Unclear: the check accurately reflects the runtime and documented configuration dependency, but default Doctor lint behavior is an operator-facing policy choice because it changes existing lint results. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c91a37aeed65. 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 (9 earlier review cycles; latest 8 shown)
|
bc6db07 to
3d95a6b
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3d95a6b to
b2dc493
Compare
b2dc493 to
bf3cad4
Compare
bf3cad4 to
e65a30b
Compare
…teAfterCompaction Add a Doctor health check that warns when agents.defaults.compaction.maxActiveTranscriptBytes is configured but truncateAfterCompaction is not enabled, because resolveMaxActiveTranscriptBytes returns undefined in that case and the byte guard has no effect. Closes openclaw#100529
e65a30b to
bc505f2
Compare
|
Closing as obsolete — thanks for the contribution; the misconfiguration this PR warns about no longer exists. PR #115206 (landed as The deeper fix beat the warning: rather than diagnosing the trap, |
What Problem This Solves
Fixes #100529
resolveMaxActiveTranscriptBytes()atsrc/auto-reply/reply/memory-flush.ts:27-29returnsundefinedwhentruncateAfterCompactionis nottrue, even whenmaxActiveTranscriptBytesis configured with a positive value. The byte guard silently has no effect, and no diagnostic warns the operator.core/doctor/inactive-compaction-byte-guard) that runs in the defaultopenclaw doctor --lintpath. It warns whenmaxActiveTranscriptBytesresolves to a positive effective byte limit whiletruncateAfterCompactionis not enabled. UsesparseNonNegativeByteSizeto normalize values so zero-value forms ("0mb",0, etc.) do not produce false-positive warnings.What changed
src/flows/doctor-health-contributions.ts— addedcollectCompactionByteGuardFindings(usesparseNonNegativeByteSize),runCompactionByteGuardHealth, and thedoctor:compaction-byte-guardcontribution. Runs in the default Doctor lint path (nodefaultEnabled: falsegate).src/flows/doctor-health-contributions.test.ts— 4 test cases covering all config states plus zero-value forms.Evidence
All cases below run the built
openclaw doctor --lintagainst a minimalopenclaw.jsonconfig. The check runs in the default path (22 core checks, no--onlyfiltering). Output is JSON mode (stdout not a TTY).Case A: Warning —
maxActiveTranscriptBytes=100MB,truncateAfterCompaction=falseConfig:
{"agents":{"defaults":{"compaction":{"maxActiveTranscriptBytes":"100MB","truncateAfterCompaction":false}}}}→
inactive-compaction-byte-guardwarning present. Exit code 1 (findings exist).Case B: Silent —
maxActiveTranscriptBytes=0mb,truncateAfterCompaction=false(zero-value)Config:
{"agents":{"defaults":{"compaction":{"maxActiveTranscriptBytes":"0mb","truncateAfterCompaction":false}}}}→ No
inactive-compaction-byte-guardfinding. Zero-value forms ("0mb", "0", etc.) do not trigger false positives.Case C: Silent —
maxActiveTranscriptBytes=100MB,truncateAfterCompaction=true(guard active)Config:
{"agents":{"defaults":{"compaction":{"maxActiveTranscriptBytes":"100MB","truncateAfterCompaction":true}}}}→ No
inactive-compaction-byte-guardfinding. Truncation enabled → guard works → warning suppressed.Test Suite