fix(codex): gate migration on app readiness#80815
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a2cbc174f
ℹ️ 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".
| config: ctx.config, | ||
| agentDir: targets.agentDir, |
There was a problem hiding this comment.
Keep source readiness on the source account
When the source Codex home is logged in as one account but the target OpenClaw agent config selects a different Codex auth profile, passing ctx.config and the target agentDir into source discovery causes the source app-server requests to apply the target auth profile before plugin/list/plugin/read/app/list. The readiness gate then evaluates the target account's app access instead of the migrated Codex home's source account, so ready source plugins can be skipped (or the opposite) based solely on the destination agent auth. Source discovery should let the app-server use the source CODEX_HOME credentials rather than the target agent auth profile.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source-reproducible: current main discovers source-installed Codex plugins through Real behavior proof Next step before merge Security Review detailsBest possible solution: Land through maintainer review after refreshing current-head live dry-run proof for both default and Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main discovers source-installed Codex plugins through Is this the best way to solve the issue? Yes for the code direction: source-auth-isolated probes plus plugin detail, account gating, optional strict app-list verification, and target-scoped app-cache invalidation are a maintainable fix. Merge should wait for current-head proof and maintainer handling. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7c5b3283d6d9. Re-review progress:
|
c3735d6 to
404cb5c
Compare
This comment was marked as spam.
This comment was marked as spam.
* fix(codex): gate migration on app readiness * fix(codex): preserve source auth during migration * fix(codex): isolate migration source app probes * docs(codex): align migration readiness reasons * docs(codex): remove stale auth-required source reason * fix(codex): narrow native auth profile resolver input * fix: clarify codex migration subscription gating * refactor: simplify codex migration subscription gate * fix: make codex app verification optional * docs: clarify codex app inventory cache * test: avoid map spread in migration test
* fix(codex): gate migration on app readiness * fix(codex): preserve source auth during migration * fix(codex): isolate migration source app probes * docs(codex): align migration readiness reasons * docs(codex): remove stale auth-required source reason * fix(codex): narrow native auth profile resolver input * fix: clarify codex migration subscription gating * refactor: simplify codex migration subscription gate * fix: make codex app verification optional * docs: clarify codex app inventory cache * test: avoid map spread in migration test
* fix(codex): gate migration on app readiness * fix(codex): preserve source auth during migration * fix(codex): isolate migration source app probes * docs(codex): align migration readiness reasons * docs(codex): remove stale auth-required source reason * fix(codex): narrow native auth profile resolver input * fix: clarify codex migration subscription gating * refactor: simplify codex migration subscription gate * fix: make codex app verification optional * docs: clarify codex app inventory cache * test: avoid map spread in migration test
* fix(codex): gate migration on app readiness * fix(codex): preserve source auth during migration * fix(codex): isolate migration source app probes * docs(codex): align migration readiness reasons * docs(codex): remove stale auth-required source reason * fix(codex): narrow native auth profile resolver input * fix: clarify codex migration subscription gating * refactor: simplify codex migration subscription gate * fix: make codex app verification optional * docs: clarify codex app inventory cache * test: avoid map spread in migration test
* fix(codex): gate migration on app readiness * fix(codex): preserve source auth during migration * fix(codex): isolate migration source app probes * docs(codex): align migration readiness reasons * docs(codex): remove stale auth-required source reason * fix(codex): narrow native auth profile resolver input * fix: clarify codex migration subscription gating * refactor: simplify codex migration subscription gate * fix: make codex app verification optional * docs: clarify codex app inventory cache * test: avoid map spread in migration test
Summary
plugin/readplus a fresh sourceapp/listreadiness snapshot so unavailable app-backed plugins become manual skipped items instead of migrated config.plugin/list,plugin/read, andapp/listrun against the source Codex home with native source auth and isolated app-server probes.Verification
pnpm test extensions/codex/src/migration/provider.test.ts extensions/codex/src/app-server/auth-bridge.test.ts extensions/codex/src/app-server/shared-client.test.tspnpm test extensions/codex/src/migration/provider.test.tsafter the latest docs-only follow-upgit diff --checkpnpm openclaw --profile codex-migration-readiness migrate codex --dry-run --json --from $HOME/.codexpnpm openclaw --profile codex-migration-readiness-native migrate codex --dry-run --json --from $HOME/.codexReal behavior proof
Behavior addressed: Codex migration source readiness now uses isolated source Codex app-server probes instead of logging that source app-server into the destination OpenClaw auth profile, and app-backed plugins are only planned when the fresh source app inventory reports their backing apps as available.
Real environment tested: Local OpenClaw checkout on macOS. Live migration dry-runs were run at PR head
d803b8c50e3638643694b0a273443c6369bae6e5; latest PR head404cb5c03564b837a6d33c67c0410c5ea602ccd2is a docs-only follow-up validated with the focused provider test andgit diff --check. Thecodex-migration-readinessprofile is a copied dev OpenClaw auth profile. Thecodex-migration-readiness-nativeprofile is the same copied setup with OpenClaw auth removed so the source Codex app server uses native$HOME/.codexauth.Exact steps or command run after the patch: Ran the focused Vitest files, then ran both migration dry-runs with
--dry-run --jsonagainst$HOME/.codex; after the latest docs-only follow-up, reranpnpm test extensions/codex/src/migration/provider.test.tsandgit diff --check.Evidence after fix:
Observed result after fix: The copied dev-auth profile run no longer fails source plugin inventory with Codex OAuth
refresh_token_reused, and both dry-runs exit cleanly after emitting complete migration plans. In the current live Codex app inventory snapshot, Gmail, Google Calendar, and Readwise app ids are all reported missing, so migration leaves them as manual skipped items instead of planning plugin activation.What was not tested: No apply/write migration was run; both live runs were dry-runs only.