fix(codex): persist automatic compaction history#110587
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 5:19 AM ET / 09:19 UTC. Summary PR surface: Source +29, Tests +350, Docs +23, Generated 0, Other +12. Total +414 across 11 files. Reproducibility: yes. from source and the linked report: a completed native compaction is projected under Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsDo we have a high-confidence way to reproduce the issue? Yes, from source and the linked report: a completed native compaction is projected under Is this the best way to solve the issue? Unclear pending the required direct Codex contract check. Moving the count to the top-level attempt result is the narrowest apparent repair because it matches the reported consumer, but that dependency-backed boundary must be confirmed before merge. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against e1d87e9a9db9. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +29, Tests +350, Docs +23, Generated 0, Other +12. Total +414 across 11 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
|
d9ca9d0 to
ddecd3b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf004b7b35
ℹ️ 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".
| const review = assertGuardianReviewCompleted({ | ||
| events: deniedResult.events, | ||
| label: "ask-back probe", | ||
| requireEvents: false, | ||
| }); |
There was a problem hiding this comment.
Restore Guardian event opt-out for ask-back probe
When this live harness is run through scripts/test-live-codex-harness-docker.sh, OPENCLAW_LIVE_CODEX_HARNESS_REQUIRE_GUARDIAN_EVENTS defaults to 1. This call no longer passes requireEvents: false, so if Codex blocks/refuses the risky ask-back prompt before emitting a completed Guardian review (a case the fallback below still handles), assertGuardianReviewCompleted throws before that fallback can validate the ask-back. This makes the Docker Guardian probe fail despite correct behavior; keep this probe tolerant by passing requireEvents: false.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
Commit f14947d (openclaw#110587) added a state.client.getInstanceId() call in startCodexAttemptRuntime but did not update the app-server test fake clients, which omit getInstanceId. Those tests only run under the changed-file test selector, so the breakage stayed dormant on main and surfaces on any PR that touches their import graph (here, a one-line change in attempt-context.ts). Add getInstanceId to the four fake-client method sets so the changed-graph Codex app-server shards run instead of throwing 'getInstanceId is not a function' (which also stalled the run-attempt shards to their no-output kill). Not related to the memory_recall fix in this PR; bundled only to unblock CI.
* fix(codex): persist automatic compaction counts * test(codex): stress compaction and restart recovery * test(codex): bind compaction waves to fresh counts * chore: keep Codex release note in PR
Closes #110586
What Problem This Solves
Fixes an issue where long-running Codex app-server sessions would omit completed automatic native compactions from OpenClaw session history, leaving
/statusand restart/resume diagnostics with an inaccurate count.Why This Change Was Made
The Codex projector now returns its completed native compaction count through the canonical top-level attempt field consumed by the embedded runner. The live harness also gains concurrent subagent fan-out, large-output compaction stress, explicit physical app-server identity, repeated cold Gateway restarts, same-thread resume checks, persistent count checks, and post-restart continuation.
The harness uses the stable pinned Codex CLI contract. No protocol, schema version, runtime config surface, or compatibility path changes.
User Impact
Codex sessions now retain truthful automatic-compaction history across Gateway restart and thread resume. Maintainers can run one bounded live scenario that stresses concurrent children, large outputs, compaction, cold restart, and continued work.
Evidence
0.144.5).resumed, and the app-server client identity changed each time./statuscompaction count and durable marker recall verified before and after restart; work continued with another fan-out and compaction wave.pnpm check:changed: all format, generated SDK baseline, five typecheck lanes, core/extensions/scripts lint, import-cycle, storage, runtime-sidecar, pairing, webhook, and live-Docker guards passed on Blacksmith Testbox.