Skip to content

feat(onboard): offer codex migration after harness install - #81192

Merged
sjf merged 1 commit into
mainfrom
feat/onboard-codex-migration-prompt
May 12, 2026
Merged

sjf merged 1 commit into
mainfrom
feat/onboard-codex-migration-prompt

Conversation

@sjf

@sjf sjf commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After the Codex harness plugin is installed during onboarding, prompt the user to import their personal Codex CLI state (skills, archived config/hooks, advisory cached plugins) via the existing `openclaw migrate codex` flow. The prompt is anchored to the install event so it only fires once per fresh install, not on repair passes.

Interactive

Screen.Recording.2026-05-12.at.16.08.03.mov

Non-interactive
Screenshot 2026-05-12 at 16 06 37

Behavior

Trigger points — both call into a single helper:

  1. Interactive wizard, "Install optional plugins" step (`src/wizard/setup.ts`): after `setupOfficialPluginInstalls` reports newly installed plugin ids, flush config to disk, offer migration, re-read the snapshot.
  2. Auth-choice driven install (`src/plugins/provider-auth-choice.ts`): after `ensureCodexRuntimePluginForModelSelection` reports a fresh install, prompt before the wizard moves on.
  3. Non-interactive equivalent (`src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.ts`): emit a one-line tip pointing at `openclaw migrate codex --dry-run`; never auto-apply.

Helper (`src/wizard/setup.post-install-migration.ts`):

  • Loads the migration provider registry, filters to providers owned by plugins that just transitioned to installed in this onboarding step, runs `provider.detect()`, skips when `!found` or `confidence === "low"`.
  • Interactive TTY: `Migrate at into this agent now?` → yes hands off to `migrateDefaultCommand` (which owns the existing skill/plugin checkbox UI from `openclaw migrate codex`).
  • Non-interactive / non-TTY: emits the hint and returns; never mutates state.
  • All migration failures are caught — onboarding never aborts on an optional offer.

Generic seam, not Codex-hardcoded. The helper is driven off the manifest `contracts.migrationProviders` ownership map, so when the Claude / Hermes plugins land via onboarding their providers get the same offer for free.

`freshlyInstalled` field on `CodexRuntimePluginInstallResult`. Upstream added a "plugin already on disk → repair" branch that returns `installed: true`. To avoid re-prompting every wizard run for users who already have the harness, the migration offer gates on a new `freshlyInstalled: boolean` flag instead:

  • "not required" → `freshlyInstalled: false`
  • "already on disk, repair" → `freshlyInstalled: false`
  • "newly installed via ensureOnboardingPluginInstalled" → `freshlyInstalled: result.installed`

Files

  • `src/wizard/setup.post-install-migration.ts` (+ `.test.ts`) — new helper, 9 test cases
  • `src/wizard/setup.official-plugins.ts` (+ `.test.ts`) — return `{ config, installedPluginIds }`
  • `src/wizard/setup.ts` — wire post-install migration offer after the official-plugin install step
  • `src/commands/codex-runtime-plugin-install.ts` — `pluginId` + `freshlyInstalled` on result
  • `src/plugins/provider-auth-choice.ts` — offer migration after auth-driven Codex install
  • `src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.ts` (+ `.test.ts`) — hint-only mode for non-interactive

Verification

```
pnpm test src/wizard/setup.post-install-migration.test.ts \
src/wizard/setup.official-plugins.test.ts \
src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts

Test Files 3 passed (3)

Tests 24 passed (24)

```

`pnpm check:changed` exit 0 (lint, typecheck core, typecheck core tests, import cycles all clean).

Real behavior proof — dry-run against a fake CODEX_HOME

```
$ openclaw migrate codex --dry-run --from ~/onboarding/codex_home
Migration plan: codex
Source: /Users/sjf/onboarding/codex_home
Target: /Users/sjf/.openclaw/workspace
5 items, 0 conflicts, 0 sensitive items

Items:

  • planned: skill/copy skill:greeting-bot
  • planned: skill/copy skill:hello-world
  • skipped: manual plugin:orphan-plugin:1 (cached-only, manual review)
  • planned: archive archive:config.toml
  • planned: archive archive:hooks/hooks.json
    ```

Fixture layout exercises:

  • Two planned skills (`hello-world`, `greeting-bot`)
  • `skills/.system/` bootstrap skills correctly excluded (imagegen, openai-docs, plugin-creator, skill-creator, skill-installer all skipped)
  • Archived `config.toml` and `hooks/hooks.json` with sentinels
  • One cached-only "orphan-plugin" advisory entry

What was not tested

  • End-to-end wizard run (`openclaw setup --wizard`) wiring — the trigger sites are unit-tested in isolation; the live wizard prompt has not been exercised end-to-end yet.
  • The Claude / Hermes provider plugins through the same generic seam — the helper's ownership filter is unit-tested but not exercised against the real Claude/Hermes `detect()` implementations.

Notes / follow-ups

  • The Codex migration provider's `detect()` and `plan()` both spawn `codex app-server --listen stdio://` as a child process (see `extensions/codex/src/migration/source.ts:144-160`). This pre-dates this PR but is now reachable from a hotter path — onboarding will spawn `codex` on any wizard run that installs the Codex plugin if `codex` is on PATH. A follow-up could split a filesystem-only "light" detect mode from the curated-plugin inventory call so `--dry-run` and onboarding detection skip the subprocess until apply time.
  • Docs: `docs/cli/migrate.md` has an "Onboarding integration" section that should pick up a note about the new auto-prompt. Not included here; happy to add in a follow-up or this PR if reviewers want it inline.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: L maintainer Maintainer-authored PR labels May 12, 2026
@clawsweeper

clawsweeper Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge.

Summary
The PR adds a generic post-install migration helper and wires Codex auth-choice onboarding paths to offer or hint at openclaw migrate codex, with Codex app-server subprocess cleanup changes.

Reproducibility: yes. from source inspection. The existing Codex install helper returns installed: true for already-on-disk repair, and the PR passes that value into a helper documented for just-installed plugin ids; the accepted migration path also writes config through the migration runtime while the caller keeps returning its earlier nextConfig.

Real behavior proof
Sufficient (terminal): The PR body includes terminal dry-run output and a downloaded terminal screenshot showing the non-interactive onboarding path installing Codex and emitting the migration hint after the change.

Next step before merge
This is an active protected-label PR with concrete blocking findings, so it should go back through author or maintainer review rather than cleanup closure.

Security
Cleared: No new dependency, workflow, permissions, secret handling, or package-resolution change was found; the existing Codex app-server execution path is a functional validation concern rather than a concrete supply-chain regression in this diff.

Review findings

  • [P1] Sync config before applying the migration — src/plugins/provider-auth-choice.ts:175-180
  • [P2] Gate the offer on a fresh install — src/plugins/provider-auth-choice.ts:167-180
Review details

Best possible solution:

Keep the feature on the PR branch, but make the onboarding caller persist and re-read config around accepted migrations and pass a true fresh-install signal before the migration helper sees a plugin id.

Do we have a high-confidence way to reproduce the issue?

Yes, from source inspection. The existing Codex install helper returns installed: true for already-on-disk repair, and the PR passes that value into a helper documented for just-installed plugin ids; the accepted migration path also writes config through the migration runtime while the caller keeps returning its earlier nextConfig.

Is this the best way to solve the issue?

No. The direction is useful, but the implementation should flush and re-read config around migrateDefaultCommand and gate prompts on a newly-installed transition rather than the broad installed flag.

Full review comments:

  • [P1] Sync config before applying the migration — src/plugins/provider-auth-choice.ts:175-180
    When the user accepts this new prompt, offerPostInstallMigrations can call migrateDefaultCommand, whose Codex migration path writes plugin config through the runtime config API. This caller then returns the pre-migration nextConfig to setup, so the later setup write can overwrite the migrated Codex plugin config. Flush the pending onboarding config before invoking migration and re-read or return the post-migration config.
    Confidence: 0.88
  • [P2] Gate the offer on a fresh install — src/plugins/provider-auth-choice.ts:167-180
    installed is also true when the Codex harness was already on disk and this run only repaired/enabled it, so rerunning auth-choice setup can resolve migration providers and show the prompt again. Add the promised fresh-install result and pass installedPluginIds only when Codex actually transitioned to installed; the non-interactive call site has the same pattern.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.89

What I checked:

  • protected live PR context: The live PR metadata shows the PR is open, unmerged, recent, and labeled maintainer, so it is not eligible for cleanup closure even before the code-review findings. (7ff48cb4b280)
  • existing Codex install contract: Current main returns installed: true for the already-on-disk repair path, so a caller that treats installed as newly installed will run on repairs too. (src/commands/codex-runtime-plugin-install.ts:55, 0e4f2c53c71d)
  • PR gates migration on installed: The PR calls offerPostInstallMigrations whenever codexInstall.installed is true and passes [codex] as installed plugin ids, including the already-installed repair branch from current main. (src/plugins/provider-auth-choice.ts:167, 7ff48cb4b280)
  • helper expects fresh installs: The new helper's option comments and implementation treat installedPluginIds as plugins just installed in this onboarding step, which conflicts with the PR call sites passing an existing-install success. (src/wizard/setup.post-install-migration.ts:14, 7ff48cb4b280)
  • migration applies config independently: The existing migration command can write Codex plugin config through the runtime config API, while the new auth-choice caller keeps returning its pre-migration nextConfig; setup can then persist that stale object after migration acceptance. (extensions/codex/src/migration/apply.ts:232, 0e4f2c53c71d)
  • non-interactive proof artifact: The downloaded terminal screenshot shows a real non-interactive onboarding run installing Codex and logging the migration preview hint. (7ff48cb4b280)

Likely related people:

  • Peter Steinberger: Current-main blame for the auth-choice flow, Codex install helper, and Codex migration apply code points to commit e8a8675. (role: recent area contributor; confidence: medium; commits: e8a8675128a2; files: src/plugins/provider-auth-choice.ts, src/commands/codex-runtime-plugin-install.ts, extensions/codex/src/migration/apply.ts)
  • Kevin Lin: Recent history on src/commands/migrate.ts includes migration selector behavior that this PR now invokes from onboarding. (role: adjacent migration command contributor; confidence: medium; commits: bc44f3824f9b; files: src/commands/migrate.ts)

Remaining risk / open question:

  • The PR body says an end-to-end interactive wizard acceptance run was not exercised, and source review found a config persistence gap in that path.
  • The new detect path can start the Codex app-server during onboarding; that deserves live validation once the config-ordering bug is fixed.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0e4f2c53c71d.

Re-review progress:

@sjf
sjf force-pushed the feat/onboard-codex-migration-prompt branch from 67047c0 to 27214bc Compare May 12, 2026 23:02
@sjf
sjf force-pushed the feat/onboard-codex-migration-prompt branch from e3509d4 to 8a6f0f4 Compare May 12, 2026 23:25
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.
@sjf
sjf force-pushed the feat/onboard-codex-migration-prompt branch from 8a6f0f4 to 7ff48cb Compare May 12, 2026 23:27
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
@sjf
sjf requested a review from kevinslin May 12, 2026 23:37

@kevinslin kevinslin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job. some thoughts:

  1. can we remove the warnings? you're right - these are unnecessary and pollute screen real estate
Image
  1. why is plan showing up before user makes selection? can we hide it?
Image
  1. looks like migration errored out. do you know what the error was?
Image

@kevinslin

Copy link
Copy Markdown
Contributor

theres an edge case where we can't migrate plugins if you're logged in via api on your source codex account. currently, we emit a warning for that. could you check that this behavior is still preserved and doesn't break onboarding?

@sjf

sjf commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

nice job. some thoughts:

  1. can we remove the warnings? you're right - these are unnecessary and pollute screen real estate
Image 2. why is plan showing up before user makes selection? can we hide it? Image 3. looks like migration errored out. do you know what the error was? Image
  1. I will change the UX in a second PR.
  2. Yeah, this is lame, let me see.
  3. It couldn't migrate one of the plugins, but its not related to this PR.

@sjf
sjf merged commit 48529f1 into main May 12, 2026
113 of 115 checks passed
@sjf
sjf deleted the feat/onboard-codex-migration-prompt branch May 12, 2026 23:51
sjf added a commit that referenced this pull request May 13, 2026
…r Enter with rest of wizard

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt
that landed in #81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. Selection-picker Enter behavior aligned with the rest of the wizard.
   The Codex selection prompt (`promptCodexMigrationSkillSelection`,
   `promptCodexMigrationPluginSelection`) previously installed a custom
   `key` handler in `skill-selection-prompt.ts` that, on Enter, mutated
   `prompt.value` based on the cursor row via
   `reconcileInteractiveMigrationEnterValues`. With the cursor at index
   0 = "Skip for now" (the default), pressing Enter therefore wiped the
   pre-selected items and submitted `[MIGRATION_SELECTION_SKIP]` even
   though every item was visually checked. No other wizard multiselect
   (see `src/wizard/setup.official-plugins.ts`) does this: Enter
   submits whatever is currently selected, period.

   Drop the custom Enter handler. Enter now falls through to clack's
   default behavior — submit the current selection. The
   `reconcileInteractiveMigrationSkillToggleValues` space handler and
   the `a`/`i` shortcut handler are unchanged, so the sentinel rows
   ("Skip for now", "Toggle all on", "Toggle all off") still work via
   space-then-Enter (matching the official-plugins picker pattern for
   "Skip for now"). The now-unused
   `reconcileInteractiveMigrationEnterValues` function and its tests
   are removed.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- `pnpm test src/commands/migrate/skill-selection-prompt.test.ts` 6/6
- `pnpm test src/commands/migrate/selection.test.ts` 16/16
- `pnpm test src/wizard/setup.post-install-migration.test.ts` 10/10
- Live verified against the seeded fixture at `~/onboarding/codex_home`
  via `bash run.sh onboard-fast`: wizard prompt → no plan dump →
  selection picker (cursor wherever, Enter accepts the visual state) →
  "Apply this migration now?" → progress + post-apply summary.
sjf added a commit that referenced this pull request May 13, 2026
…ed" affordance

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in #81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
pashpashpash pushed a commit that referenced this pull request May 13, 2026
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.

(cherry picked from commit 48529f1)
sjf added a commit that referenced this pull request May 13, 2026
…ed" affordance (#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in #81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
sjf added a commit that referenced this pull request May 13, 2026
* feat(migrate): suppress plan log on embedding + add "Accept recommended" affordance (#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in #81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).

(cherry picked from commit a197e31)

* test(migrate): reconcile beta selection tests
l3ocifer pushed a commit to l3ocifer/frack-openclaw that referenced this pull request May 13, 2026
…81192)

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.
l3ocifer pushed a commit to l3ocifer/frack-openclaw that referenced this pull request May 13, 2026
…ed" affordance (openclaw#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in openclaw#81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…81192)

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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…ed" affordance (openclaw#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in openclaw#81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…81192)

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.
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…ed" affordance (openclaw#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in openclaw#81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…81192)

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.
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…ed" affordance (openclaw#81219)

Two related improvements to the interactive `openclaw migrate <provider>`
flow, both surfaced by the onboarding post-install migration prompt that
landed in openclaw#81192.

1. `suppressPlanLog?: boolean` on `MigrateCommonOptions`
   (`src/commands/migrate/types.ts`). When set, `migratePlanCommand`
   skips the up-front `runtime.log(formatMigrationPlan(plan))` dump.
   The interactive Codex selection picker and the "Apply this migration
   now?" confirm still run. Wired from the wizard helper at
   `src/wizard/setup.post-install-migration.ts` so that path no longer
   shows the plan dump after the user has already confirmed at the
   wizard prompt.

2. New "Accept recommended" sentinel row at the top of both Codex
   selection pickers, with "Toggle all on" and "Toggle all off" moved
   to the bottom. The cursor starts on "Accept recommended" so pressing
   Enter at the default position submits the picker's `initialValues`
   (the recommended set) — matching the visual state of the checkboxes.

   Implemented in `skill-selection-prompt.ts`:
   - Enter on the Accept sentinel sets `prompt.value` to
     `opts.initialValues` and lets clack submit.
   - Space on the Accept sentinel snaps `prompt.value` to
     `opts.initialValues` so the visible checkboxes flip to the
     recommended state. The user can then Enter to commit or continue
     toggling individual rows. The Accept row itself is never persisted
     in the submitted value list.

   The existing Enter handler for "Toggle all on" / "Toggle all off"
   stays unchanged.

3. Removed the "Skip for now" sentinel entirely. It was a single-
   keystroke trap: with the picker cursor wrapping from Accept to Skip
   via up-arrow (or via accidental down-arrows), Enter on Skip wiped
   `prompt.value` to `[MIGRATION_SELECTION_SKIP]` and abandoned the
   whole migration — including any items the user had already
   confirmed in the previous picker. To exit without migrating, users
   now navigate to "Toggle all off" (or use the `a` / `i` keyboard
   shortcuts) to clear the selection; the apply phase then sees no
   planned work and skips itself via the existing
   `shouldSkipCodexApplyAfterInteractiveSelection` path.

   Cleanup spans `migrate/selection.ts` (constants, `{ action: "skip" }`
   variant, and the reconcile/resolve SKIP branches),
   `migrate.ts` (the picker option rows and the
   `if (selection.action === "skip")` handler blocks in both pickers),
   and the corresponding tests.

4. Plugin selection hint relabelled from "Activate every recommended
   plugin" to "Migrate every recommended plugin" so it matches the
   skill hint and the prompt's own verb ("Migrate ... into this agent
   now?").

Tests:

- `src/commands/migrate/skill-selection-prompt.test.ts` — Accept
  sentinel cases (Enter and Space + Enter both submit initialValues);
  Skip-related test removed; Skip row dropped from the picker fixture.
- `src/commands/migrate/selection.test.ts` — Skip-related sub-
  assertions trimmed from the resolve/reconcile tests; the
  "skip + toggle-off precedence" test renamed to "toggle-off precedence
  over toggle-on" and Skip cases removed.
- `src/commands/migrate.test.ts` — four Skip-driven scenarios removed
  (plugin-only skip, both-pickers skip, skip-skills-continue-to-plugins,
  Codex subscription warning + skip).
- `src/wizard/setup.post-install-migration.test.ts` — call-args
  assertion expects the new `suppressPlanLog` option.

Verification:

- `pnpm lint` clean
- `pnpm tsgo:core` + `pnpm tsgo:core:test` clean
- Touched test suites green (migrate 32/32, selection 17/17,
  skill-selection-prompt 6/6, setup.post-install-migration 10/10).
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…81192)

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.

(cherry picked from commit 48529f1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations extensions: codex maintainer Maintainer-authored PR proof: sufficient ClawSweeper judged the real behavior proof convincing. size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants