Fix startup failures caused by missing dependency, incorrect import, and missing attribute#4
Fix startup failures caused by missing dependency, incorrect import, and missing attribute#4Suravi021 wants to merge 3 commits into
Conversation
PR Summary by QodoFix startup failures: add missing dependency, correct Mistral import, persist OpenAI init field
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
11 rules 1. llm.py outside windows_use/llms
|
| self.base_url = base_url or os.environ.get("OPENAI_BASE_URL") | ||
| self.temperature = temperature | ||
| self.extra_body = extra_body | ||
| self.reasoning_effort = reasoning_effort |
There was a problem hiding this comment.
1. llm.py outside windows_use/llms 📘 Rule violation ⌂ Architecture
LLM integration code was modified in windows_use/providers/.../llm.py, but the checklist requires all LLM integration code to live under windows_use/llms. This breaks the required module boundary for LLM client code and complicates auditing/maintenance.
Agent Prompt
## Issue description
LLM integration code (OpenAI/Mistral client usage) is implemented/modified outside the required `windows_use/llms` directory.
## Issue Context
This PR updates LLM provider implementations in `windows_use/providers/...`, but compliance requires LLM communication/orchestration code to be centralized under `windows_use/llms`.
## Fix Focus Areas
- windows_use/providers/openai/llm.py[75-75]
- windows_use/providers/mistral/llm.py[7-7]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| "typer>=0.15.0", | ||
| "questionary>=2.0.0", | ||
| "cryptography>=44.0.0", | ||
| "pytest-asyncio>=1.4.0" |
There was a problem hiding this comment.
2. uv.lock mismatches pytest-asyncio 📘 Rule violation § Compliance
pyproject.toml now requires pytest-asyncio>=1.4.0, but uv.lock pins pytest-asyncio to 1.3.0. This makes the lockfile inconsistent with declared dependencies and can cause non-reproducible installs.
Agent Prompt
## Issue description
The dependency spec was updated, but the uv lockfile still pins an older incompatible version.
## Issue Context
`pyproject.toml` requires `pytest-asyncio>=1.4.0`, while `uv.lock` contains `pytest-asyncio` at `1.3.0`, which does not satisfy the new constraint.
## Fix Focus Areas
- pyproject.toml[60-64]
- uv.lock[3121-3133]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| "typer>=0.15.0", | ||
| "questionary>=2.0.0", | ||
| "cryptography>=44.0.0", | ||
| "pytest-asyncio>=1.4.0" | ||
| ] |
There was a problem hiding this comment.
3. Duplicate pytest-asyncio requirement 🐞 Bug ☼ Reliability
pyproject.toml adds pytest-asyncio to runtime dependencies even though it already exists under the dev optional extra with a different version constraint, which can lead to inconsistent dependency resolution and forces a test-focused dependency into normal installs.
Agent Prompt
### Issue description
`pytest-asyncio` is declared twice with different constraints: once as a runtime dependency and once as a `dev` extra. This creates inconsistent package metadata and can change what downstream users get when they install `windows-use` without the `dev` extra.
Additionally, the repo uses `uv` in CI (`uv sync --extra dev`), and `uv.lock` currently reflects only the `dev`-extra dependency metadata for `pytest-asyncio`, not a runtime dependency, so dependency metadata is inconsistent.
### Issue Context
- `pytest-asyncio` is typically a test dependency and is already declared in `[project.optional-dependencies].dev`.
- CI uses `uv sync --extra dev`, so the project is lockfile-driven for installs.
### Fix Focus Areas
- pyproject.toml[41-74]
- uv.lock[4425-4430]
- .github/workflows/ci.yml[30-39]
### Suggested fix
1. Remove `"pytest-asyncio>=1.4.0"` from `[project].dependencies` (keep it only in `[project.optional-dependencies].dev`), **or** if it truly is required at runtime, remove it from `dev` and keep a single consistent specifier.
2. Regenerate/update and commit `uv.lock` so it matches the chosen dependency layout (runtime vs dev extra) and version constraint(s).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Fixes several issues that prevented the application from starting:
Testing