fix(llm,storage): harden Windows extraction paths#287
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR improves Windows handling in the Claude Code provider by normalizing overridden CLI paths, inlining oversized system prompts into stdin, and setting explicit UTF-8 subprocess decoding. It also normalizes plausible millisecond epochs in ChangesClaude Code Windows compatibility
Estimated code review effort: 4 (Complex) | ~40 minutes Epoch to ISO Millisecond Normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@reflexio/server/llm/providers/claude_code_provider.py`:
- Around line 120-129: The Windows override lookup in
_windows_executable_cli_path() only tries a .cmd suffix, so extensionless
CLAUDE_SMART_CLI_PATH values can miss common shims like .exe and .bat and fall
back to PATH. Update the logic in _windows_executable_cli_path() to resolve
Windows executable extensions more broadly, either by honoring PATHEXT or by
probing the usual extensions in addition to .cmd, while keeping the non-Windows
and already-qualified-path behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d3835acb-2552-4055-8816-f9c83555768a
📒 Files selected for processing (4)
reflexio/server/llm/providers/claude_code_provider.pyreflexio/server/services/storage/sqlite_storage/_base.pytests/server/llm/test_claude_code_provider.pytests/server/services/storage/test_sqlite_storage.py
Code reviewFound 1 issue:
reflexio/reflexio/server/services/storage/sqlite_storage/_base.py Lines 389 to 410 in 829b67b
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@reflexio/server/llm/providers/claude_code_provider.py`:
- Around line 140-153: _skip .ps1 from Windows CLI override resolution or launch
it through PowerShell._ The _resolve_cli_override_path() helper can currently
resolve a PowerShell script path that _run_claude_stream() cannot execute
directly, which leads to an OSError instead of the intended fallback. Update
_resolve_cli_override_path() to avoid returning .ps1 candidates, or adjust
_run_claude_stream() to detect and invoke PowerShell scripts via PowerShell, so
the existing fallback behavior continues to work.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e13e2f52-ecaf-45b9-8dc6-360b12a3aa7f
📒 Files selected for processing (4)
reflexio/server/llm/providers/claude_code_provider.pyreflexio/server/services/storage/sqlite_storage/_base.pytests/server/llm/test_claude_code_provider.pytests/server/services/storage/test_sqlite_storage.py
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/server/llm/test_claude_code_provider.py
- reflexio/server/services/storage/sqlite_storage/_base.py
Why
Windows local extraction can fail before Reflexio gets a usable model response:
--append-system-prompt.What Changed
--append-system-prompt.## Taskframing.CLAUDE_SMART_CLI_PATHoverrides throughPATHEXTplus.cmd/.exe/.batWindows shims..ps1shim auto-resolution because PowerShell scripts require an explicit PowerShell host.to_ts=10**12..cmd/.exe/.batoverride shims,.ps1exclusion, and seconds/milliseconds/sentinel timestamp cases.Compatibility Notes
Validation
uv run pytest --no-cov tests/server/llm/test_claude_code_provider.py tests/server/services/storage/test_sqlite_storage.py tests/server/api_endpoints/test_evaluation_overview_api.py -q- 112 passed.uv run pytest --no-cov tests/lib/test_interactions_unit.py tests/e2e_tests/test_playbook_workflows.py -q- 39 passed, 16 skipped.uv run ruff check reflexio/server/llm/providers/claude_code_provider.py reflexio/server/services/storage/sqlite_storage/_base.py tests/server/llm/test_claude_code_provider.py tests/server/services/storage/test_sqlite_storage.py tests/server/api_endpoints/test_evaluation_overview_api.py- passed.uv run ruff format --check reflexio/server/llm/providers/claude_code_provider.py reflexio/server/services/storage/sqlite_storage/_base.py tests/server/llm/test_claude_code_provider.py tests/server/services/storage/test_sqlite_storage.py tests/server/api_endpoints/test_evaluation_overview_api.py- passed.uv run pyright reflexio/server/llm/providers/claude_code_provider.py reflexio/server/services/storage/sqlite_storage/_base.py tests/server/llm/test_claude_code_provider.py tests/server/services/storage/test_sqlite_storage.py tests/server/api_endpoints/test_evaluation_overview_api.py- passed.git diff --check- passed.uv run pytest -qwas attempted on this branch: coverage passed at 81.78%, but unrelated benchmark/eval/optimizer tests failed locally becauseOPENAI_API_KEYis not set.