Skip to content

fix(onboard): shorten codex detect timeout to 30s and show progress spinner#81233

Closed
sjf wants to merge 1 commit into
mainfrom
fix/post-install-migration-detect-feedback
Closed

fix(onboard): shorten codex detect timeout to 30s and show progress spinner#81233
sjf wants to merge 1 commit into
mainfrom
fix/post-install-migration-detect-feedback

Conversation

@sjf
Copy link
Copy Markdown
Contributor

@sjf sjf commented May 13, 2026

Summary

The post-install migration prompt (#81192) can take up to 60 seconds before it appears, with no visible activity on the terminal. Two narrow fixes that together turn "the wizard looks frozen" into "the wizard is clearly checking, with a known time bound."

  1. Shorten the source-side codex app-server timeout to 30 seconds in requestSourceCodexAppServerJson (extensions/codex/src/migration/source.ts:268). This is the call that provider.detect() and provider.plan() make to enumerate curated-marketplace plugins. 60s is too long for an interactive prompt path; on an unauth'd or stalled ~/.codex, the full minute was eaten before the migration prompt could fire.

  2. Wrap each provider's detect() call in a wizard progress spinner in src/wizard/setup.post-install-migration.ts. The spinner shows Checking Codex state… while the probe runs, and ends with Found Codex state. / No Codex state to migrate. / Codex detection failed. so the operator sees outcome, not just absence. Only fires when the helper is actually going to drive an interactive prompt (TTY + prompter passed); non-interactive callers still rely on runtime.log and are unchanged.

Behavior

Before (interactive wizard, post ensureCodexRuntimePluginForModelSelection):

…
Codex install complete.
                            ← up to 60s of silent terminal
? Migrate Codex at /Users/me/.codex into this agent now? (y/N)

After:

…
Codex install complete.
◇  Checking Codex state… (spinner)
◇  Found Codex state.
? Migrate Codex at /Users/me/.codex into this agent now? (y/N)

If codex app-server does not respond within 30s the spinner stops with Codex detection failed., the wizard moves on, and onboarding continues — no abort.

Files

  • extensions/codex/src/migration/source.tstimeoutMs: 60_00030_000 on requestSourceCodexAppServerJson, with a comment recording why.
  • src/wizard/setup.post-install-migration.tsresolveCandidates gains an optional prompter parameter and runs each detect() inside prompter.progress(...) with success / no-state / failure end labels. offerPostInstallMigrations only forwards the prompter when the helper is in interactive mode (!nonInteractive && stdin.isTTY && prompter).

Verification

pnpm lint                                                              # 0 errors
pnpm tsgo:core && pnpm tsgo:core:test                                  # clean
pnpm test src/wizard/setup.post-install-migration.test.ts              # 10/10 passed

Real behavior proof — interactive bash run.sh onboard-fast

Against the seeded fixture at ~/onboarding/codex_home:

  1. Picked openai/gpt-5.5 so the Codex harness install ran.
  2. Post-install, the spinner appeared: ◐ Checking Codex state… — running while codex app-server plugin/list was in flight.
  3. Spinner stopped with Found Codex state.; migration confirm prompt followed immediately.

Notes

  • The 30s ceiling still lets a slow but eventually-successful plugin/list complete; it just caps the worst case to half what it used to be. Longer-term, a filesystem-only "light" detect mode (flagged in the original PR's follow-ups) would let this drop to milliseconds — that's a separate change.
  • The spinner uses the existing WizardPrompter.progress seam used by src/commands/onboard-skills.ts:168, src/commands/onboarding-plugin-install.ts:604, etc. No new prompter surface.
  • prompter.progress(...) is only invoked when prompter is forwarded, so non-interactive / non-TTY paths see no UI change.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 13, 2026

Codex review: needs changes before merge.

Summary
The PR shortens Codex source app-server requests from 60 seconds to 30 seconds and adds interactive wizard progress feedback around post-install migration provider detection.

Reproducibility: yes. Source inspection shows current main can wait up to 60 seconds in the Codex source app-server request before the migration prompt, and the PR body includes an after-fix interactive onboard run showing spinner feedback.

Real behavior proof
Sufficient (live_output): The PR body includes after-fix live interactive onboard output showing the spinner and successful Codex migration prompt flow against a seeded fixture.

Next step before merge
There is one narrow repair: make the new spinner classify Codex app-server inventory timeout/error as detection failure instead of no-state.

Security
Cleared: The diff only changes a Codex app-server timeout and wizard progress messages; it does not add dependencies, secret handling, permissions, downloaded artifacts, or new code execution paths.

Review findings

  • [P2] Report app-server timeouts as detection failures — src/wizard/setup.post-install-migration.ts:80
Review details

Best possible solution:

Keep the 30-second ceiling and interactive spinner, but make the spinner distinguish app-server inventory failures/timeouts from true no-state detection and cover that path with a focused regression test.

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

Yes. Source inspection shows current main can wait up to 60 seconds in the Codex source app-server request before the migration prompt, and the PR body includes an after-fix interactive onboard run showing spinner feedback.

Is this the best way to solve the issue?

No, not quite. The timeout/spinner approach is the right narrow fix, but the failure status should be wired to the Codex app-server error path instead of only to thrown provider.detect() failures.

Full review comments:

  • [P2] Report app-server timeouts as detection failures — src/wizard/setup.post-install-migration.ts:80
    The timeout this PR targets is caught inside discoverInstalledCuratedPlugins and returned as a low-confidence no-state detection, so this new branch prints No Codex state to migrate. instead of the promised Codex detection failed. when plugin/list times out and no filesystem signal is found. Please propagate or classify the inventory error so the spinner reports a detection failure for that case.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.82

Acceptance criteria:

  • pnpm test src/wizard/setup.post-install-migration.test.ts
  • pnpm test extensions/codex/src/migration/source.test.ts
  • pnpm tsgo:core && pnpm tsgo:core:test
  • pnpm lint

What I checked:

Likely related people:

  • sjf: Introduced the post-install migration helper in merged PR feat(onboard): offer codex migration after harness install #81192 and recently fixed Codex migration detect app-server isolation in the same source area. (role: feature owner and recent area contributor; confidence: high; commits: 48529f1a965c, c8998b71e246; files: src/wizard/setup.post-install-migration.ts, extensions/codex/src/migration/source.ts, extensions/codex/src/app-server/request.ts)
  • kevinslin: Recent merged work changed Codex migration readiness, native plugin app support, and source app-server migration behavior in extensions/codex/src/migration/source.ts. (role: adjacent Codex migration owner; confidence: medium; commits: 9ff5250792e6, a1ac559ed7e6; files: extensions/codex/src/migration/source.ts)

Remaining risk / open question:

  • Read-only review did not rerun the interactive wizard or local tests; the finding is from source-path inspection of current main plus the PR diff.

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

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 13, 2026
@sjf sjf closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR proof: sufficient ClawSweeper judged the real behavior proof convincing. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant