fix(codex): guard against stale codex app snapshots leading to plugin invocation failure#83807
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source/proof level, but I did not run a fresh local or live repro in this read-only review. Current main wires static PR rating Rank-up moves:
What the crustacean ranks mean
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. PR egg Rarity: 🥚 common. What is this egg doing here?
Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the patch after Codex app-policy/auth owner review accepts the account-scoped inventory recovery behavior; request one destructive allow/deny proof only if maintainers need stronger security-boundary confidence. Do we have a high-confidence way to reproduce the issue? Yes at source/proof level, but I did not run a fresh local or live repro in this read-only review. Current main wires static Is this the best way to solve the issue? Yes, with owner acceptance: resolving live config at attempt time and forcing target app inventory refresh during thread-config build is a narrow fix for the stale snapshot path. The patch keeps missing inventory fail-closed, which is the safer default for plugin app exposure. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6f18decb7a2c. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7edc32f21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| accessible: true, | ||
| enabled: true, | ||
| needsAuth: app.needsAuth, |
There was a problem hiding this comment.
Do not enable auth-required apps without inventory
When app/list is unavailable, this fallback fabricates accessible: true and enabled: true for every plugin/read app, including apps whose detail has needsAuth: true. The build loop below only rejects !app.accessible || !app.enabled, so an already-installed plugin with an auth-required app will get an enabled Codex app config solely because the inventory refresh failed; previously this path failed closed until app readiness could be verified.
Useful? React with 👍 / 👎.
d7edc32 to
81c9863
Compare
| return false; | ||
| } | ||
| return ( | ||
| coerceLegacyOAuthEncryptedPayload(raw.encrypted) !== null || |
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Summary
codexPluginssettingsapp/listrefreshes when plugin-owned apps are missing or not ready, and sanitize HTML challenge failures in inventory diagnosticsVerification
pnpm changed:lanes --jsonpnpm check:changedpnpm buildnode scripts/run-vitest.mjs extensions/codex/index.test.ts extensions/codex/src/app-server/plugin-thread-config.test.ts extensions/codex/src/app-server/app-inventory-cache.test.ts extensions/codex/src/app-server/plugin-inventory.test.ts extensions/codex/src/app-server/plugin-activation.test.ts extensions/codex/src/app-server/thread-lifecycle.test.tsnode scripts/run-vitest.mjs extensions/codex/src/app-server/app-inventory-cache.test.ts extensions/codex/src/app-server/plugin-thread-config.test.tsReal behavior proof
Behavior addressed: Regular-profile Codex Google Calendar plugin calls failed because the Codex harness could miss live
codexPluginsconfig and the app inventory recovery path was opaque. This patch makes the live config path authoritative, refreshes and logs app inventory recovery, and keeps the thread app binding fail-closed when inventory cannot verify readiness.Real environment tested: Isolated OpenClaw gateway workspace
regular-google-calendar-plugin-token3using auth profileopenai-codex:default, gatewayws://127.0.0.1:19992, and the managed Codex app-server Google Calendar plugin path.Exact steps or command run after this patch:
OPENCLAW_INTEG_GATEWAY_FORCE=1 ./.mem/integ/scripts/run_integ_gateway.mjs regular-google-calendar-plugin-token3 19992, then a liveagentrequest in sessionclaw-integ-regular-google-calendar-fixed-4using the saved prompt in.mem/main/proofs/demo-11-regular-google-calendar-plugin/raw/live-calendar-profile.command.md, thenUV_CACHE_DIR=/private/tmp/openclaw-uv-cache UV_TOOL_DIR=/private/tmp/openclaw-uv-tools uvx showboat verify .mem/main/proofs/demo-11-regular-google-calendar-plugin/raw/showboat-summary.md.Evidence after fix: Terminal output captured in the Showboat summary artifact:
Observed result after fix: The live gateway run refreshed inventory, bound the Google Calendar connector app into plugin app policy context, and returned
GOOGLE_CALENDAR_PLUGIN_OKfrom the Google Calendar app/plugin tool path.What was not tested: No event mutation flow was exercised; this proof covers read/query availability only. The broad
pnpm test:changedlane previously showed unrelated local failures around approval-policy defaults andapprovalsReviewerexpectations.