Skip to content

fix: check any provider API key in doctor command#44

Open
nuthalapativarun wants to merge 1 commit into
microsoft:mainfrom
nuthalapativarun:fix/doctor-api-key-check
Open

fix: check any provider API key in doctor command#44
nuthalapativarun wants to merge 1 commit into
microsoft:mainfrom
nuthalapativarun:fix/doctor-api-key-check

Conversation

@nuthalapativarun

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant