fix(test): set TEST_KEY before OpenAILLMClient in guardrail test#1280
Conversation
OpenAI 2.34+ rejects an empty api_key in OpenAI(). Match openai_capture fixture order.
7d68370 to
6a97775
Compare
Greptile SummaryThis PR fixes a CI breakage caused by The test reordering is correct and necessary regardless of the version pin. The pin itself is a valid short-term fix, but the underlying issue is that Confidence Score: 4/5Safe to merge as a short-term CI fix; the version cap and test fix are both correct, with a known follow-up needed in the production client. Only P2 findings present. The changes are small, targeted, and correct. The pin is acknowledged as temporary and the test fix is unambiguously right. No regressions introduced. app/services/llm_client.py — the eager Important Files Changed
|
|
🎻 "The diff was clean, the tests did pass, the reviewer wept." That poem was about @muddlebee's PR. 🥹 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |

Summary
OpenAI 2.34+ rejects an empty
api_keyinOpenAI().TestOpenAIClientGuardrails::test_redacts_before_api_callconstructedOpenAILLMClientbefore settingTEST_KEY, so CI failed once the resolver picked 2.34.x.Change
TEST_KEYbefore instantiatingOpenAILLMClient(same order as theopenai_capturefixture).No dependency cap: staying on
openai>=2.0.0and fixing the test is sufficient.