Skip to content

fix(llm): probe Windows Claude CLI candidates before spawning - #2728

Open
DebadityaHait wants to merge 1 commit into
Graphify-Labs:v8from
DebadityaHait:fix/2573-claude-cli-resolution
Open

fix(llm): probe Windows Claude CLI candidates before spawning#2728
DebadityaHait wants to merge 1 commit into
Graphify-Labs:v8from
DebadityaHait:fix/2573-claude-cli-resolution

Conversation

@DebadityaHait

Copy link
Copy Markdown

Summary

On Windows, Graphify currently trusts the first claude.cmd found on PATH. A stale or broken npm shim can shadow a working native Claude CLI and make both Claude CLI call paths fail.

This is a resolver-only split of #2573. The all-batches-failed artifact write guard remains separate in #2726.

Changes

  • centralize Windows Claude CLI resolution for extraction and lightweight labeling;
  • probe claude.cmd, claude.exe, then claude with a bounded --version call;
  • skip candidates that return non-zero or raise an OS/subprocess error;
  • pass the selected path to the real -p invocation;
  • preserve non-Windows bare claude behavior;
  • add mocked regression coverage for fallback and all-candidate failure.

Validation

  • uv run --frozen pytest tests/test_claude_cli_backend.py -q — 38 passed
  • uv run --frozen pytest tests/test_claude_cli_backend.py tests/test_labeling.py -q — 65 passed
  • uv run --frozen pytest tests/test_llm_backends.py tests/test_extract.py tests/test_extract_cli.py -q --tb=short — 287 passed, 8 skipped
  • uv run --frozen ruff check graphify/llm.py tests/test_claude_cli_backend.py — passed
  • python -m py_compile graphify/llm.py tests/test_claude_cli_backend.py — passed
  • uv run --frozen graphify update . — completed
  • git diff --check — passed

Related to #2573.

@DebadityaHait
DebadityaHait marked this pull request as ready for review August 13, 2026 20:43
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.

1 participant