Fix Windows fresh-install crash: missing questionary (v2.3.3)#52
Conversation
Clip suggestion caught the actual failure reason (Claude/Codex stderr, a timeout, or unparseable output) but only sent it to transient progress and returned None, so the user always saw 'check claude/codex login' regardless of the real cause. Capture the last failure detail through an error_sink and classify it (auth vs usage limit vs crash) so the message names what actually went wrong.
A failed or partial pip install during first-run setup left the backend permanently unable to import its deps (e.g. questionary), since ensureRuntime gated on the backend tree existing rather than the deps being present. Verify deps on every runtime-wanting launch via a requirements-hash stamp so a broken provision self-heals, bootstrap pip via ensurepip when absent, and surface an actionable error instead of crashing Python on the missing import.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR improves error reporting for AI clip suggestion failures by adding a classify_cli_error helper and error_sink propagation from suggest_with_claude to handle_suggest_clips. It also adds hashed dependency stamping and pip bootstrap in the CLI's provision package, and updates main.go to propagate runtime provisioning errors. The package version is bumped. ChangesSuggest-clips error detail propagation
CLI runtime dependency provisioning
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant handle_suggest_clips
participant suggest_with_claude
participant classify_cli_error
Client->>handle_suggest_clips: request clip suggestions
handle_suggest_clips->>suggest_with_claude: call with error_sink list
suggest_with_claude->>suggest_with_claude: track last_detail on failure
suggest_with_claude->>classify_cli_error: classify(last_detail)
classify_cli_error-->>suggest_with_claude: actionable message
suggest_with_claude-->>handle_suggest_clips: return None, error_sink populated
handle_suggest_clips-->>Client: emit first error or fallback message
sequenceDiagram
participant podcli
participant ensureRuntime
participant ensureBackendDeps
participant provision_EnsurePython
podcli->>ensureRuntime: runEngine invokes on wantsRuntime
ensureRuntime->>ensureRuntime: setup(nil) if BackendRoot missing
ensureRuntime->>ensureBackendDeps: check hermetic python deps
ensureBackendDeps->>provision_EnsurePython: install if requirements-runtime.txt exists
provision_EnsurePython-->>ensureBackendDeps: success or error
ensureBackendDeps-->>ensureRuntime: return error or nil
ensureRuntime-->>podcli: return error
podcli->>podcli: print podcli: error, exit 1
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
Fixes #51
Fresh Windows installs of v2.3.1 crashed on launch with
ModuleNotFoundError: No module named 'questionary'.Root cause
The hermetic Python dep install ran only on first-run setup, gated on the backend tree existing (
ensureRuntime) rather than the deps being present. If pip failed or was interrupted, the failure was swallowed (python: skipped), setup reportedDone., and the launcher handed straight off to Python, which crashed onimport questionary. A plain binary reinstall didn't recover because the half-provisionedruntime/persists.Fix
EnsurePythoninstalls deps through a requirements-hash stamp (.podcli-deps), so a failed/partial install self-heals on the next run and the check is a cheap no-op once satisfied. Bootstrap pip viaensurepipwhen the interpreter lacks a working pip.run 'podcli setup' to retrymessage instead of crashing Python on the missing import.Also carries the earlier "Surface the real AI CLI failure" backend change that never landed on the rewritten
main, and bumps version to 2.3.3.Existing users on a broken runtime recover by running
podclionce on 2.3.3 (no purge needed).Summary by CodeRabbit
New Features
Bug Fixes
Chores