Webwright icon indicating copy to clipboard operation
Webwright copied to clipboard

fix: check any provider API key in doctor command

Open nuthalapativarun opened this issue 5 months ago • 0 comments

Summary

  • check_openai_key() renamed to check_api_key() and now accepts OPENAI_API_KEY, ANTHROPIC_API_KEY, or OPENROUTER_API_KEY
  • Users with Anthropic-only or OpenRouter-only setups no longer see a false FAIL

Why

The doctor command advertises support for three providers but only validated the OpenAI key. A user who configured only ANTHROPIC_API_KEY would see FAIL: No API key found even though their environment is valid.

Changes

  • src/webwright/run/doctor.py: renamed function and extended check to three env vars
  • tests/unit/test_doctor.py: updated existing tests and added Anthropic/OpenRouter cases

Testing

pytest tests/unit/test_doctor.py -v
tests/unit/test_doctor.py::test_check_python PASSED
tests/unit/test_doctor.py::test_check_playwright PASSED
tests/unit/test_doctor.py::test_check_chromium PASSED
tests/unit/test_doctor.py::test_check_screenshot PASSED
tests/unit/test_doctor.py::test_check_api_key_openai PASSED
tests/unit/test_doctor.py::test_check_api_key_anthropic PASSED
tests/unit/test_doctor.py::test_check_api_key_openrouter PASSED
tests/unit/test_doctor.py::test_check_api_key_missing PASSED
tests/unit/test_doctor.py::test_plugin_manifests_exist PASSED
tests/unit/test_doctor.py::test_plugin_manifests_missing PASSED
tests/unit/test_doctor.py::test_screenshot_file_cleanup PASSED
11 passed in 0.15s

nuthalapativarun avatar Jun 05 '26 05:06 nuthalapativarun