You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(login): surface and recover from missing codex CLI (#27)
* feat(login): surface and recover from missing codex CLI
Login on Windows used to hide a missing codex CLI behind mojibake: the
fallback `cmd /C codex login` printed cmd.exe's GBK "command not found"
message, and `String::from_utf8_lossy` mangled it into U+FFFD soup. The
toast was unreadable and the only escape was reinstalling codex.
This change replaces the cmd fallback with a typed
`REAL_CODEX_NOT_FOUND` error and gives the user a recovery path:
- New "Codex CLI 路径" dialog auto-opens on REAL_CODEX_NOT_FOUND. It
shows the currently resolved path + source, common install locations
as click-to-fill chips, and Save / Clear / Cancel actions.
- A user-supplied path is persisted as `user_codex_path` in
install_state.json and takes priority over auto-discovery, with a
silent fallback when the override file disappears so the user is
never permanently wedged.
- Settings page now has a "Codex CLI 路径" row showing the resolved
path so users can adjust it any time, not only after a failure.
- Login button doubles as a cancel button while a login is in flight:
clicking sends SIGTERM (Unix) / taskkill (Windows) to the codex
process so a closed OAuth tab no longer leaves a permanent spinner.
Bump to 1.5.6.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(login): preserve stderr on failure; tighten cancel toast race
Three follow-ups from PR review:
- `Command::output()` previously captured codex login's stdio for the
LOGIN_FAILED toast; the spawn+wait_with_output split silently dropped
it. Pipe stdout/stderr explicitly so the message surface stays the
same when codex login itself errors out.
- Roll back `cancelledLoginProfile` when the backend reports no login
was actually cancelled, so a click that races a natural failure
doesn't mask the real toast.
- Document the PID-reuse caveat in `login_cancel.rs` — the slot
clears after wait_with_output, so a cancel in that microsecond
window could theoretically target a recycled PID. Accepted for
v1.5.6; long-term fix is a Child-handle slot.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(win): patch InstallState constructors and exhaustive match for user_codex_path
CI on Linux (which compiles the Windows runtime path) caught three
spots I missed locally because the macOS toolchain doesn't cross-check
the win module. Same shape as the mac install.rs fix already in this
PR:
- Two `InstallState { ... }` constructors in win install.rs needed the
new `user_codex_path` field (preserve the previous value).
- `run_codex_auth_refresh` had a `match real_codex_source` that wasn't
exhaustive after `RealCodexPathSource::UserOverride` was added.
- Two test fixtures had to set `user_codex_path: None` explicitly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore(git): ignore .claude runtime artifacts
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(win): patch test InstallState constructors for user_codex_path
Two more InstallState literals in win/runtime/process.rs tests that the
mac toolchain didn't surface (Linux CI compiles the win cfg path).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
<pid="codex-cli-dialog-copy">Codex Switch couldn't find the codex CLI on this machine, or the cached path is wrong. Pick the real codex binary so login can spawn it directly.</p>
0 commit comments