Restructure the migrate codex CLI output:
- Split into separate Before (preview) and After (result) messages
so each can be tuned independently. Both render through clack's
log.message so they pick up the standard '|' gutter.
- Group items by kind (Skills, Plugins, Memory, Secrets, Archive,
Manual review, Other) instead of one flat list. Hide config items
from display and exclude them from the summary count.
- Drop the internal kind/action tag (e.g. 'manual/manual'), strip
'<kind>:' id prefixes and trailing ':N' disambiguators, and use
'•' for bullets.
- Mute parenthetical action text.
- In result mode: replace status text with emoji (✅ migrated,
❌ error, ⏭️ skipped, ⚠️ conflict), show '(Migrated)' on success,
show humanized failure reasons for known codes (plugin_missing,
marketplace_missing, etc.), say '(Skipped)' for user-deselected
skill/plugin items but keep the real message on manual-review
skips. Drop warnings from the result message.
- In preview mode: omit the 'Next' section and move warnings to
the bottom. Use generic action descriptions ('Copy Codex skill
into OpenClaw', 'Install Codex plugin into OpenClaw').
- Drop the redundant 'Codex cached plugin bundles remain
manual-review only.' warning — covered by the source-installed
warning above it.
Add a post-install seam so the wizard can prompt the user to import their
existing Codex CLI state (skills, archived config/hooks, advisory cached
plugins) through the existing `openclaw migrate codex` flow once the
harness plugin is in place. Fires on both fresh installs and repair runs;
the user can decline at any time.
Trigger sites, both routing through one helper:
- src/plugins/provider-auth-choice.ts: after
`ensureCodexRuntimePluginForModelSelection` reports `installed: true`,
dynamically import `offerPostInstallMigrations` and call it before the
wizard moves on.
- src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.ts:
same call shape with `nonInteractive: true`, so the helper emits a hint
line only and never mutates state.
Helper (src/wizard/setup.post-install-migration.ts) is generic, not
Codex-hardcoded — it resolves migration providers via the manifest
`migrationProviders` contract, filters to providers owned by plugins the
caller flags as installed in this onboarding step, runs `provider.detect`,
and on TTY hands accepted runs to `migrateDefaultCommand`. All detect,
prompt, and migrate failures are swallowed so onboarding never aborts on
this optional offer.
Also harden the Codex app-server subprocess lifecycle now that `detect()`
runs from a hotter onboarding path: isolate the plugin-install
`plugin/read` call (extensions/codex/src/migration/apply.ts) and have the
isolated request wait for child exit with a SIGKILL fallback
(extensions/codex/src/app-server/request.ts) so parents are not held open
by an orphaned codex binary.
Tests:
- src/wizard/setup.post-install-migration.test.ts (new, 10 cases)
- src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts
extended with hint-call assertions and a not-required-no-offer case.
discoverInstalledCuratedPlugins acquired the shared Codex app-server client
to issue a one-shot plugin/list RPC against the source CODEX_HOME. The
shared slot kept the spawned child alive with stdio pipes attached to the
onboarding process, so the Node event loop never drained after the wizard
emitted its outro and the CLI appeared to hang.
The discovery RPC has its own one-off startOptions (custom CODEX_HOME,
HOME) that should never be reused for an agent session, so request it as
an isolated client. request.ts closes the child as soon as the call
returns, removing the dependence on process-exit harness disposal and
eliminating the post-onboarding hang.