Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(cli): emit PowerShell-compatible model-cleanup command on Windows#1559

Merged
kovtcharov-amd merged 3 commits into
mainfrom
autofix/issue-554
Jun 11, 2026
Merged

fix(cli): emit PowerShell-compatible model-cleanup command on Windows#1559
kovtcharov-amd merged 3 commits into
mainfrom
autofix/issue-554

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

On Windows, gaia init's "manually delete failed models" hint printed cmd's rmdir /s /q, which fails when pasted into PowerShell — GAIA's assumed Windows shell — leaving users (per #554) unable to follow the recovery steps the model-verification output told them to run. After this change the hint emits Remove-Item -Recurse -Force "<path>", the valid PowerShell form already used elsewhere in the repo (run.ps1), so the copy-paste recovery command works.

Closes #554.

Test plan

  • On Windows, trigger a failed-model verification in gaia init and confirm the printed cleanup command is Remove-Item -Recurse -Force "<path>" and runs in PowerShell
  • On Linux/macOS, confirm the hint still emits rm -rf "<path>" (non-win32 branch unchanged)
  • python -m pytest tests/unit/test_init_command.py

Follow-up (non-blocking): add a tiny unit test to tests/unit/test_init_command.py asserting the win32 vs non-win32 cleanup-hint strings, to guard against regression back to cmd syntax.

The model-cleanup hint printed by 'gaia init' on Windows used cmd's
'rmdir /s /q', which is not valid PowerShell syntax (GAIA's assumed
Windows shell). Emit 'Remove-Item -Recurse -Force' instead so the
copy-paste command actually works.

Closes #554
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review: fix(cli): emit PowerShell-compatible model-cleanup command on Windows

Summary

Correct, well-scoped fix — approve. The Windows recovery hint in gaia init printed cmd's rmdir /s /q, which errors when pasted into PowerShell (GAIA's assumed Windows shell), so the recovery steps the verification output told users to run were unfollowable. Swapping to Remove-Item -Recurse -Force resolves it, and the diff matches the stated intent exactly: the non-win32 rm -rf branch is untouched (init_command.py:1824-1827), and no other rmdir /s /q remains anywhere in src/. The Remove-Item -Recurse -Force form is consistent with how the rest of the repo writes PowerShell delete commands (src/gaia/apps/jira/webui/run.ps1, .github/actions/setup-venv/action.yml, docs/quickstart.mdx), so the "already used elsewhere" claim in the description checks out.

The one thing worth knowing: there's still no test guarding this branch — see below.

Issues

🟢 Minor — No regression guard for the cleanup-hint strings

tests/unit/test_init_command.py has 78 tests but none exercise the failed-model cleanup hint, so nothing stops a future edit from reverting to cmd syntax. You already flagged this as a non-blocking follow-up in the description, which is the right call — a focused fix shouldn't be held up for it. A small parametrized test asserting the win32 (Remove-Item -Recurse -Force) vs non-win32 (rm -rf) form, patching sys.platform, would close the loop. Not blocking.

Strengths

  • Minimal, surgical diff — one platform branch changed, nothing else touched; reads cleanly against the surrounding rm -rf path.
  • The added comment states the why (cmd syntax isn't valid PowerShell) in one line, exactly the WHY-only style CLAUDE.md asks for — not a what-it-does narration.
  • PR description leads with user-observable impact (before: copy-paste recovery fails on Windows; after: it works) and links Quickstart guide unexpected WARNING #554.

Verdict

Approve. No blocking issues. The missing regression test is a genuine nice-to-have that the author has already acknowledged as a follow-up — safe to merge as-is, ideally with that test added in a quick follow-up PR.

@kovtcharov-amd kovtcharov-amd enabled auto-merge June 11, 2026 00:29
@kovtcharov-amd kovtcharov-amd added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 083e79b Jun 11, 2026
34 checks passed
@kovtcharov-amd kovtcharov-amd deleted the autofix/issue-554 branch June 11, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quickstart guide unexpected WARNING

2 participants