Repository navigation
fix(codex): preserve payload keys and current inventory diagnostics - #162032
Conversation
Preserve literal JSON fields in redacted bootstrap projections and fence obsolete inventory error publication with the existing refresh token. Retain rejection, logging, redaction and native lifecycle contracts. Remove three remaining private forwarding/dependency layers. Runtime regression controls and final validation remain pending before publication.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 2:41 PM ET / 18:41 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Codex plugin preserves literal JSON keys in redacted bootstrap context, prevents obsolete app-inventory failures from replacing current diagnostics, removes unused private forwarding, and adds regression tests and README guidance. Merge readiness✅ Ready for maintainer review Keep open. The two reported defects remain on current main, and the earlier merged Codex cleanup did not fix them. The pinned patch has no actionable review finding; this member-authored PR can proceed through the normal landing workflow. Priority: P2 Review scores
Verification
How this fits togetherThe bundled Codex plugin projects OpenClaw conversation history into prompt text for Codex App Server. It also caches Codex app listings and exposes their availability and refresh diagnostics. flowchart LR
A[Conversation history] --> B[Codex plugin]
C[Codex app listing] --> B
B --> D[Redacted payload projection]
D --> E[Bootstrap prompt]
B --> F[Inventory refresh cache]
F --> G[Availability and diagnostics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -8, Tests +42, Docs +4. Total +38 across 11 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep payload projection and inventory diagnostic publication with their existing plugin owners, preserving redaction and current-refresh precedence without adding persistent state. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main uses ordinary-object assignment for literal payload keys and publishes failed refresh diagnostics without a token check. The PR reports failing-before and passing-after boundary cases; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Own data properties preserve JSON keys while retaining the existing redaction traversal, and the failure path now uses the same publication fence as success. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 112df95f5ee6. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
…penclaw#162032) Preserve literal JSON payload keys during redacted Codex bootstrap projection and prevent superseded inventory refresh failures from replacing current diagnostics. Keep the original request rejection and warning behavior, and remove unused catalog forwarding exports and private dependencies. Regression controls fail on the original owners and pass on the candidate. Native protocol, auth routing, subagent lifecycle, redaction, and stored transcript contracts remain intact.
What Problem This Solves
Codex bootstrap projections drop literal
__proto__fields from tool payloads, and a superseded app-inventory request can overwrite newer cache diagnostics after it fails.User Impact
Redacted bootstrap context retains literal JSON field names in tool inputs and results. Inventory diagnostics keep the current refresh or invalidation result; an older request's failure remains logged and still rejects its caller.
Redaction, repeated-reference markers, native RPCs, auth routing, subagent lifecycle authority, and stored transcript/tool bytes retain their contracts. No configuration, schema, permission, retention, dependency, or installed-update behavior changes.
Why This Change Was Made
This follows #161966. Production removes 8 net lines; the existing test suites gain 43 lines of meaningful regression coverage, with no new test file, timer, polling loop, retry, or production seam. The README records the corrected behavior.
Evidence
Independent Codex autoreview is scoped-clean through P2 on the final 11-file candidate.
Blacksmith Testbox regression proof: lease
tbx_01m3sm720pdy71btxewqjfk873, run 36748438028, tested candidate61dab680599877cbec8177eb19a9286c5e667d48against original owners at649b19f8abab2d8cbd58678e00c87d167435c5ae.pnpm test <file> --maxWorkers=1: projection 60 tests, 32.00 s wall (29.62 s Vitest); inventory 37 tests, 43.49 s wall (40.27 s Vitest). The inventory races use deferred promises with no timers or sleeps; projection extends an existing context-boundary case.2fdd344a32b5e0f0a35e8adcbc4fb4916bcdbfc9; the shared test helper now imports the leaf owner too.Reviewed-head Blacksmith Testbox proof uses lease
tbx_01m3snsqbtf6jma6jva4na6cp3, run 36751699544, source treec1e5366d2d637723d7912deace6a018038ae226d.node scripts/check-changed.mjs --base origin/main --timed,pnpm build,pnpm plugin-sdk:check-exports, andpnpm plugin-sdk:api:diff --base origin/main --head HEADpassed. API comparison reports no Plugin SDK changes. The fullpnpm test:extensions:batch codexpassed: 420 files and 6,103 tests passed; one file and eleven tests retained their existing skips. The combined remote command exited 0 after 40m03s; the external runner portal sync timed out afterward. The lease is stopped.Inherited main failure and current-head follow-through
src/gateway/server-cron.ts:113importsreconcileCronExitWatcherswithout using it.check-lint-core-1reportseslint(no-unused-vars);check-prod-types,check-test-types, andcheck-test-types-core-2,-3,-4, and-5report TS6133. Every failed job's retained output has the same single diagnostic.Independent proof: PR #162033 CI run 36755697719, head
f89c45ce4fc2e12a545499dad31718a2fdc9eb07, reports the identical error in production types, test types, and core lint. That PR changes only two session-publication files. This PR changes onlyextensions/codex/**; its changed modules do not participate in the failing Gateway import's local unused-binding check. Our CI tested the merge into maine9b94010ee446c28d1628eff2de46b559c80e594.The coordinator fixed the import on main in
d5e602f0bcf8d6d1c5cbfc502a4ae6c35e36f70a. While this lane was verifying the failure, the branch received merge commit3e04dd6e740139cb0ad0087092b179c15a777979. Its tree exactly matches Git's conflict-free merge of the reviewed head and that main commit; all eleven PR files remain byte-identical. Current-head hosted CI run 36757867414 passed, including the previously failing core lint/type jobs. Prior-head Testbox proof and the failed historical CI run remain explicitly prior-head evidence; the ordinary current-head gate passed and squash auto-merge completed at8f3aa224b6705936ce69e5079a7778ad200e2e8eon 2026-09-30 at 18:49:39 UTC. Both this merge and the preceding ninth-pass merge are verified ancestors of fetched main.No live provider behavior change or live provider proof is claimed.
Personally inspected Codex source contracts
Sibling revision:
8f38d5a877da8c5c2c0b5158e72bb5f2290a3157.codex-rs/protocol/src/dynamic_tools.rs:47-55.codex-rs/app-server-protocol/src/protocol/v2/apps.rs:27-64,172-227.codex-rs/app-server-protocol/src/protocol/v2/shared.rs:244-259;codex-rs/protocol/src/config_types.rs:183-189.codex-rs/app-server-protocol/src/protocol/v2/item.rs:370-399.codex-rs/app-server-protocol/src/protocol/v2/thread.rs:1378-1449,1705-1735.