Skip to content

fix(codex): preserve payload keys and current inventory diagnostics - #162032

Merged
steipete merged 3 commits into
mainfrom
deslop/l237-codex9-followup
Sep 30, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l237-codex9-followup

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Construct projected objects with own data properties so JavaScript's legacy prototype setter cannot discard a valid JSON field. Preserve metadata-first ordering and the existing traversal/redaction behavior.
  • Give successful and failed inventory refresh publication the same existing refresh-token fence. Clear, invalidation, and forced-successor races have deterministic public-owner regressions.
  • Finish three small cleanups found during the ninth pass: import session CLI constants from their leaf owner and delete the unused forwarding exports, remove the recovery callback whose consumers were retired with Tasks in refactor: remove Tasks and TaskFlow runtime #159179, and use the closed reviewer union directly. The completion-delivery retirement callback and the native legacy reviewer alias remain supported.

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 candidate 61dab680599877cbec8177eb19a9286c5e667d48 against original owners at 649b19f8abab2d8cbd58678e00c87d167435c5ae.

  • The original projection fails the literal-field assertion; all three original inventory races fail the diagnostic assertions. Restored candidate owner bytes were hash-verified, then both full owner suites passed.
  • Hosted CI case cost: projection regression 0.034 s; the three inventory race cases 0.003, 0.003, and 0.002 s.
  • Measured cost with 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.
  • Policy, CLI, and native monitor suites passed: 4 files, 84 tests. Plugin contracts passed: 48 files, 1,153 tests; four import-boundary selections passed.
  • Both import-cycle checks reported zero. Changed checks passed production/test types and guards, then correctly rejected two unused constant re-exports introduced by the CLI import cleanup. Those exports are removed in final head 2fdd344a32b5e0f0a35e8adcbc4fb4916bcdbfc9; the shared test helper now imports the leaf owner too.

Reviewed-head Blacksmith Testbox proof uses lease tbx_01m3snsqbtf6jma6jva4na6cp3, run 36751699544, source tree c1e5366d2d637723d7912deace6a018038ae226d.

  • Both cycle checks report zero on the reviewed tree.
  • Affected Codex and catalog suites: 56 files, 617 tests passed in 170.13 s. Plugin contracts: 48 files, 1,153 tests passed; all four import-boundary selections passed.
  • The repository wrapper's repeated local sync preparation exceeded ten minutes. After cancelling that owned invocation, the installed Crabbox CLI resumed the same lease. The payload asserted the prepared workspace, exact carrier/tree, and unchanged tracked source before tests. All tests ran remotely; source and lease ownership checks remained enabled.
  • Final node scripts/check-changed.mjs --base origin/main --timed, pnpm build, pnpm plugin-sdk:check-exports, and pnpm plugin-sdk:api:diff --base origin/main --head HEAD passed. API comparison reports no Plugin SDK changes. The full pnpm test:extensions:batch codex passed: 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.
  • Exact-head hosted CI run 36755679759 completed. All tests, extension lint, dependency checks, architecture/import boundaries, docs, and security-fast passed. Seven core lint/type jobs failed solely on the inherited Gateway import below; the aggregate CI gate also failed.

Inherited main failure and current-head follow-through

src/gateway/server-cron.ts:113 imports reconcileCronExitWatchers without using it. check-lint-core-1 reports eslint(no-unused-vars); check-prod-types, check-test-types, and check-test-types-core-2, -3, -4, and -5 report 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 only extensions/codex/**; its changed modules do not participate in the failing Gateway import's local unused-binding check. Our CI tested the merge into main e9b94010ee446c28d1628eff2de46b559c80e594.

The coordinator fixed the import on main in d5e602f0bcf8d6d1c5cbfc502a4ae6c35e36f70a. While this lane was verifying the failure, the branch received merge commit 3e04dd6e740139cb0ad0087092b179c15a777979. 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 at 8f3aa224b6705936ce69e5079a7778ad200e2e8e on 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.

  • JSON tool arguments: codex-rs/protocol/src/dynamic_tools.rs:47-55.
  • Committed installed-app snapshots and metadata: codex-rs/app-server-protocol/src/protocol/v2/apps.rs:27-64,172-227.
  • Reviewer values and legacy alias: codex-rs/app-server-protocol/src/protocol/v2/shared.rs:244-259; codex-rs/protocol/src/config_types.rs:183-189.
  • Native collaboration identities and activity: codex-rs/app-server-protocol/src/protocol/v2/item.rs:370-399.
  • Catalog listing filters and cursors: codex-rs/app-server-protocol/src/protocol/v2/thread.rs:1378-1449,1705-1735.

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.
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 2:41 PM ET / 18:41 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 3e04dd6e740139cb0ad0087092b179c15a777979

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch has meaningful boundary regressions and substantial reported validation, with no introduced blocker found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The member-authored PR is exempt from contributor real-setup proof. Its reported Testbox cases exercise the production projection and cache owners with synthetic responses, while no live provider behavior is claimed; no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from contributor real-setup proof. Its reported Testbox cases exercise the production projection and cache owners with synthetic responses, while no live provider behavior is claimed; no stored-data contract changes.
Evidence reviewed 9 items Current main still drops literal keys: The fetched main revision assigns projected object entries onto ordinary objects, so a literal proto key is not retained as an own JSON data field.
Current main still publishes obsolete failures: The fetched main revision writes diagnostics in the failure path without checking the refresh token, unlike its successful publication path.
Pinned implementation: The introduced patch creates own data properties for projected payloads and applies the existing refresh-token fence before publishing failure diagnostics. Logging and caller rejection remain outside that fence.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -8, Tests +42, Docs +4. Total +38 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 26 34 -8
Tests 3 44 2 +42
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 74 36 +38

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded Codex plugin correctness fix with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR is exempt from contributor real-setup proof. Its reported Testbox cases exercise the production projection and cache owners with synthetic responses, while no live provider behavior is claimed; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-30T18:06:29.343Z sha 2fdd344 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-30T18:33:31.644Z sha 3e04dd6 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 30, 2026
@steipete
steipete merged commit 8f3aa22 into main Sep 30, 2026
151 checks passed
@steipete
steipete deleted the deslop/l237-codex9-followup branch September 30, 2026 18:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant