repair-opencode-kilo-python-lsp-diagnostics
Installation
SKILL.md
Repair Opencode/Kilo Python LSP Diagnostics
Scope
This skill is only for Kilo and opencode (which share the same core). It does not apply to Claude Code, Codex, or other agents.
Symptom
While reading or editing Python files through the edit tool, the built-in LSP reports failed third-party library resolution:
Import "fastapi" could not be resolved from source
Import "pytest" could not be resolved
...
These come from the agent harness's LSP, not from your own verification. The code may be fine — the LSP is just misconfigured.
Root Cause
Kilo/opencode sends the venv interpreter as a top-level initialization.pythonPath, but pyright only reads the venv from python.pythonPath or from the [tool.pyright] config section. So pyright falls back to the system Python and cannot resolve third-party imports that live only in the project venv. Builtins and local imports still resolve.