Keep Codex compaction on native threads#82027
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Current main has a high-confidence source-level reproduction path: an owning context engine can compact before native Codex compaction, and the linked issue plus PR proof show the OAuth Real behavior proof Next step before merge Security Review detailsBest possible solution: Land or revise this native Codex compaction fix after maintainers decide whether to fold the lifecycle/accounting observations into this PR or track them as explicit follow-ups. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a high-confidence source-level reproduction path: an owning context engine can compact before native Codex compaction, and the linked issue plus PR proof show the OAuth Is this the best way to solve the issue? Yes for the central bug. Making Codex app-server native compaction the single owner matches the documented runtime contract; the observed lifecycle/accounting gaps need maintainer scoping rather than an automated cleanup close. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1e31bd2ac29d. |
38ed398 to
6af12ba
Compare
6af12ba to
20b4a9a
Compare
|
I tested I did find a few follow-on lifecycle/accounting issues around the different compaction paths. WebChat
|
20b4a9a to
6760999
Compare
3827a6a to
292d601
Compare
292d601 to
8374148
Compare
|
Landing proof for rebase merge (not squash): Behavior addressed: Codex app-server compaction now stays on native Codex thread compaction; OpenClaw context-engine compaction is not used as fallback/primary summarizer for Codex-runtime sessions. Lossless remains supported through the context-engine slot and legacy config is migrated by doctor when safe. Real environment tested:
Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix:
What was not tested:
|
Summary
plugins.slots.contextEngine, with agent/plugin runtime context passed into its maintenance LLM policy.openclaw doctor --fixmigration/warnings for stale Codex compaction overrides, legacy Losslesscompaction.provider, and legacycodex-app-serverruntime aliases.Verification
Behavior addressed: Fixes #82008 OAuth compaction auth mismatch. Codex OAuth compaction no longer calls the OpenClaw/Public OpenAI Responses summarizer path, while Lossless remains supported through the context-engine slot.
Real environment tested:
tbx_01krn641yf4ppdtbb0kappkjbx, Actions https://github.com/openclaw/openclaw/actions/runs/25904490545 (failed as expected: contextEngine.compact called for Codex compaction and warning absent).tbx_01krnafa4hbkrdpz35b8f5sx6w, Actions https://github.com/openclaw/openclaw/actions/runs/25907207989 (passed).tbx_01krnf6zh784p07gzpejccwwn2, Actions https://github.com/openclaw/openclaw/actions/runs/25910432813 (passed).tbx_01krng2knqeyv0nb9g0x5e01tr, Actions https://github.com/openclaw/openclaw/actions/runs/25911067410 (passed).../codexonmainat6a225e4005, clean worktree.Exact steps or command run after this patch:
OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/commands/doctor/shared/codex-route-warnings.test.ts extensions/codex/src/app-server/compact.test.ts extensions/codex/src/app-server/run-attempt.context-engine.test.ts -- --reporter=verbosenode scripts/run-vitest.mjs src/commands/doctor/shared/codex-route-warnings.test.ts extensions/codex/src/app-server/compact.test.tspnpm plugin-sdk:api:checkgit diff --check/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branch(cd ../codex/codex-rs && cargo test -p codex-app-server thread_compact_start_triggers_compaction_and_returns_empty_response)Evidence after fix:
thread/compact/starttakesthreadId, submitsOp::Compact, returns{}, and emitscontextCompactionitem started/completed notifications; the targeted sibling Codex test passed.Observed result after fix:
contextEngine.compact()as fallback/primary summarizer.contextCompactionitem completion, with deprecatedthread/compactedstill tolerated.codex-app-serverruntime alias configs.plugins.slots.contextEngine = "lossless-claw"with boundedsummaryModelpolicy; unsafe mixed/conflicting configs stay intact with manual warnings.openai-codex/*Lossless summary models keep Codex runtime policy after canonicalizing toopenai/*, including inherited default summary models and per-agent local compaction-only refs.What was not tested: