fix(codex): rotate transcript after harness compaction#82856
fix(codex): rotate transcript after harness compaction#82856hansolo949 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I did a careful shell check against current Current main, shipped in v2026.6.6, already solves the central Codex transcript-bloat problem by keeping context-engine compaction primary, rotating the OpenClaw successor transcript there, and only then starting Codex native compaction as a bounded secondary request. This PR's synthetic-boundary branch is now conflicting and no longer the best landing path. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the shipped context-engine-first implementation from #91590 as the canonical fix and close this conflicting branch. Do we have a high-confidence way to reproduce the issue? Not applicable as a current-main reproduction: the source path that mattered for Codex now compacts and rotates through the context engine before starting native Codex compaction. The older failure was source-proven by the prior review and the PR body, but current main no longer follows that path for Codex budget compaction. Is this the best way to solve the issue? No, this PR is no longer the best way to solve the issue. The current shipped implementation fixes the user-visible Codex transcript growth at the owner boundary without adding a synthetic compaction-boundary policy to the generic harness rotation helper. Security review: Security review cleared: The diff only changes TypeScript compaction logic and tests, with no dependency, workflow, credential, package-resolution, or external-code-execution changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8; fix evidence: release v2026.6.6, commit a8d33f23a09d. |
|
Addressed ClawSweeper feedback in
Latest GitHub checks are green. @clawsweeper re-review |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Verification
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-pi-embedded.config.ts src/agents/pi-embedded-runner/compaction-successor-transcript.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.agents-pi-embedded.config.ts src/agents/pi-embedded-runner/compact.hooks.test.tspnpm tsgo:core:testpnpm exec oxfmt --check --threads=1 src/agents/pi-embedded-runner/compact.queued.ts src/agents/pi-embedded-runner/compaction-successor-transcript.ts src/agents/pi-embedded-runner/compact.hooks.harness.ts src/agents/pi-embedded-runner/compact.hooks.test.ts src/agents/pi-embedded-runner/compaction-successor-transcript.test.tsgit diff --checkReal behavior proof
Behavior addressed: Successful external agent-harness compaction, including Codex native app-server compaction, can compact the provider thread without writing an OpenClaw
type: "compaction"transcript boundary. Withagents.defaults.compaction.truncateAfterCompaction = true, OpenClaw should still rotate to a smaller active successor transcript instead of continuing to carry the bloated parent transcript.Real environment tested: Han's local OpenClaw setup on macOS, running installed OpenClaw
2026.5.16-beta.3with the equivalent local hot patch applied while investigating this regression. The source PR moves the same behavior into the core harness compaction wrapper.Exact steps or command run after this patch: Ran
openclaw --version,openclaw health --json, and a local Codex-native compaction smoke that copied the real main session transcript, simulated the Codex app-server compaction completion path, and inspected the rotated successor transcript written by OpenClaw.Evidence after fix: Terminal output from the real local OpenClaw setup:
Observed result after fix: The active successor transcript shrank from
958625bytes to106636bytes, retained the recent40message tail, wrote exactly one synthetic compaction entry for the Codex app-server backend, and preserved the original parent transcript path for rollback/history.What was not tested: A full live WebChat browser run from this source branch was not run in the PR worktree; the live setup proof above was run against the installed local OpenClaw bundle with the equivalent hot patch.