Files
crewAI/lib
Devin AI 47b0081333 fix: strip whitespace from API keys and handle AuthenticationError with guidance
Fixes #5622

- Strip whitespace/newlines from OPENAI_API_KEY when read from env vars
  or passed directly (in _normalize_openai_fields and _get_client_params)
- Strip whitespace from env var values in llm_utils.py fallback path
- Add specific AuthenticationError handling in all OpenAI completion
  methods (sync/async, completions/responses) with troubleshooting
  guidance for users
- Let AuthenticationError propagate through call()/acall() without
  being swallowed by the generic Exception handler
- Add comprehensive tests covering whitespace stripping and auth error
  handling

Co-Authored-By: João <joao@crewai.com>
2026-04-25 19:34:01 +00:00
..
2026-04-25 00:04:46 +08:00