fix(agents): skip below-target CLI compaction failures#88319
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 31, 2026, 1:14 AM ET / 05:14 UTC. Summary PR surface: Source +42, Tests +240. Total +282 across 2 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. 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
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against 51dee73a5d3e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +42, Tests +240. Total +282 across 2 files. View PR surface stats
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a000d3a3ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review Addressed the proof/changelog feedback:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed the rank-up P2 stale-native-plus-below-target fallback gap in What changed:
Validation:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed the current review feedback in What changed:
Validation:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9320ab5 to
e3a63fa
Compare
|
@hxy91819 please review also |
e3a63fa to
4ca3773
Compare
|
Landed via rebase onto main.
Thanks @frankekn! |
Summary
What problem does this PR solve?
already under target/ below-threshold compaction as a no-op instead of a fatal post-turn compaction error.Why does this matter now?
What is the intended outcome?
What is intentionally out of scope?
What does success look like?
already under targetcompaction results resolve as no-ops.What should reviewers focus on?
below_thresholdis the right existing classifier to reuse for CLI no-op behavior.Linked context
Which issue does this close?
Closes #
Which issues, PRs, or discussions are related?
Related #
Was this requested by a maintainer or owner?
already under targetcompaction.c0a5f15dc8 fix(agents): clear unflushed cli bindings, which established the session-store path for clearing stale/unflushed CLI bindings. This PR extends that recovery to the compaction retry path.Real behavior proof
compacted:falsewithreason:"already under target"was treated as a fatal post-turn compaction failure.thread/compact/starton that below-target thread.{ "proof": "PR88319 Codex app-server below-target compact smoke", "source": "local OpenClaw source checkout", "codexCli": "0.135.0", "serverVersion": "0.134.0", "threadStarted": true, "compactReturned": true, "visibleTurnFailure": false, "redactions": [ "thread id", "temp path" ] }already under targetresults now return as no-ops without recording a compaction or throwing.already under targetreason.compacted:falseresults; the old tests had no below-target coverage.Tests and validation
Which commands did you run?
PNPM_CONFIG_FETCH_RETRIES=5 PNPM_CONFIG_FETCH_RETRY_MINTIMEOUT=60000 PNPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=180000 pnpm install --frozen-lockfilenode scripts/test-projects.mjs src/agents/command/cli-compaction.test.tsnode_modules/.bin/tsgo -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo --declaration false --pretty falsenode_modules/.bin/tsgo -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo --declaration false --pretty falsegit diff --checkpnpm check:changed(blocked at unrelated lint tooling issue after core typechecks passed)What regression coverage was added or updated?
{ ok: true, compacted: false, reason: "already under target" }.{ ok: true, compacted: false, reason: "already under target" }.What failed before this fix, if known?
compacted:falseas fatal, even when the reason was below-target/no-op.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Harmless below-target compaction no-ops no longer surface as failed CLI/Codex turns.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
How is that risk mitigated?
below_thresholdclassifier.Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?