[codex] Mark Codex compaction events completed#81593
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source inspection gives a high-confidence reproduction path: current main emits a Codex Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this emitter-side completion flag and protocol mirror sync, or an equivalent narrow emitter fix, after real compaction-run proof and maintainer review; then close #82470 as fixed. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence reproduction path: current main emits a Codex Is this the best way to solve the issue? Yes, the PR’s emitter-side What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b9921e21b93d. Re-review progress:
|
08ac0b6 to
7310cf9
Compare
7310cf9 to
6ce08b4
Compare
|
Verification before merge: Local proof on rebased head 6ce08b4:
CI proof on pushed PR head 6ce08b4:
Known proof gaps: full release validation not run locally; PR CI/build gates are green. |
Summary
Marks Codex app-server compaction end events as completed.
Also syncs the checked Codex app-server protocol mirror with the current upstream schema so the protocol drift check passes again.
Why
The run-level compaction bookkeeping treats a compaction end event as successful only when
evt.data.completed === true. The Codex app-server event projector increments its local completed-compaction count when acontextCompactionitem completes, but the emittedcompactionend event did not carry the completion flag.Adding the flag keeps the emitted event contract aligned with the runner's completion check.
Real behavior proof
Behavior addressed: Codex app-server contextCompaction item completion now emits a compaction end event with completed=true, preventing false incomplete-compaction bookkeeping and notices.
Real environment tested: Local OpenClaw checkout against ../codex protocol schema, plus focused OpenClaw test lanes. Upstream Codex checkout observed at 7fa0007ea8.
Exact steps or command run after this patch: pnpm codex-app-server:protocol:check; pnpm test extensions/codex/src/app-server/event-projector.test.ts; pnpm test src/auto-reply/reply/agent-runner-execution.test.ts -- -t compaction; pnpm oxfmt --check --threads=1 CHANGELOG.md scripts/check-codex-app-server-protocol.ts extensions/codex/src/app-server/event-projector.ts extensions/codex/src/app-server/event-projector.test.ts; git diff --check; /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branch.
Evidence after fix: protocol check reported the generated protocol matches OpenClaw bridge assumptions; event-projector test file passed 43 tests; agent-runner compaction-filtered test passed 7 tests; oxfmt and git diff checks passed; Codex review reported no accepted/actionable findings.
Observed result after fix: the projected compaction end event includes completed=true while preserving the existing contextCompaction item lifecycle and hook behavior.
What was not tested: Full release/build suite locally; PR CI is the broad proof gate on the pushed head.
Verification