fix(ai): harden Windows CLI spawning and surface suggest failures (DAN-11)#37
Merged
Conversation
Resolution now only accepts .exe/.cmd/.bat on Windows: npm installs an extensionless POSIX-shell shim next to every .cmd, and resolving it made provider_status report the CLI as installed while every spawn failed -- Settings showed Codex as "installed but not signed in" on a signed-in machine, and suggest could never work. Batch shims run through cmd /C (CreateProcess cannot execute them directly), so prompts move from argv to stdin, which also sidesteps the 32K command-line ceiling. run_capture gains a null-stdin default plus 30s/120s timeouts so a CLI that stops to ask a question fails with a visible error instead of spinning forever, and CREATE_NO_WINDOW stops the release build flashing a console window per AI call (same rationale as strand_core's git_command). Claude auth-status parsing now recognizes explicit logged-out text instead of treating every non-JSON success as signed in.
A missing CLI no longer disables the sparkle button into a silent no-op: clicking now surfaces the backend's install/sign-in hint in the commit-bar error slot. Error messages carry their own prefix so a suggestion failure reads "Suggestion failed: ..." instead of the misleading "Commit failed: ..." (which also mislabeled the "Browser opened -- complete sign-in" notice).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes DAN-11 — AI does not work. Root causes reproduced against the running app over CDP; full RCA posted on the Linear issue.
ai/bin.rs: on Windows resolve only.exe/.cmd/.bat— never npm's extensionless POSIX-shell shims, which resolved first, can't be spawned, and made Codex report "installed but not signed in" on a signed-in machine. Batch shims run viacmd /C; prompts travel over stdin (immune tocmd /Cre-parsing and the 32K argv ceiling); null stdin + 30s/120s timeouts so an interactive CLI prompt errors visibly instead of spinning forever;CREATE_NO_WINDOWstops per-call console flashes in the release build (same rationale asstrand_core::git_command).ai/claude.rs: auth-status parsing recognizes explicit "not logged in" text instead of treating any non-JSON success as signed in.LocalChanges.tsx: a missing CLI no longer disables the sparkle into a silent no-op — clicking surfaces the backend's install/sign-in hint inline; errors are labeled "Suggestion failed: …" instead of the misleading "Commit failed: …".docs/learnings.mdrule for vendor-CLI spawning on Windows;TASKS.mdrow.Test plan
cargo test -p strand-tauri ai::— 19 pass, incl. new tests: shim-vs-.cmdresolution, extensionless skip,.cmdexecution viacmd /C, stdin piping, timeout kill.cargo clippy -p strand-tauri --no-default-featuresandcargo check -p strand-core -p strand-tauriclean;tsc --noEmitclean (known App.tsx noise only)..cmdshim (impossible before), Claude viaclaude.exe; Codex status now correctly reports signed in.🤖 Generated with Claude Code