fix(openai-adapters): suppress org/project headers that break under Turkish locales - #13097
fix(openai-adapters): suppress org/project headers that break under Turkish locales#13097edenbuilds wants to merge 2 commits into
Conversation
OpenAI SDK injects OpenAI-Organization from OPENAI_ORG_ID; under tr-TR that name lowercases to an invalid token (openaı-organization) and crashes requests.
|
I have read the CLA Document and I hereby sign the CLA |
|
All contributors have signed the CLA ✍️ ✅ |
|
CI note: the two failing checks look unrelated to this OpenAI-adapters header change:
Happy to re-run those checks if a maintainer can kick them, or push an empty commit if that helps. |
|
CI update after retrigger: PromptFile yaml is green now. Remaining failure is `jetbrains-tests` → IntelliJ `Autocomplete.testAutocomplete()` assertion (unrelated to this openai-adapters Turkish-locale header change). Happy to ignore/re-run if maintainers prefer. |
|
Heads-up on the red check: It looks like a broken baseline rather than something this PR introduced — the three most recent failing
The first is the same two-job failure as this PR.
Happy to rebase once the JetBrains suite is healthy on |
Summary
OpenAI-Organization/OpenAI-Projectheaders lowercase to invalid HTTP tokens (openaı-organization) and crash requests.organization/projecttonulland null out those headers with ASCII-safe lowercase keys soOPENAI_ORG_ID/OPENAI_PROJECT_IDfrom the environment cannot inject the PascalCase headers.OpenAIApiandAzureApiclient construction.Fixes #12568
Test plan
OpenAI-Organization.toLocaleLowerCase(tr-TR) produces the invalid token, and that our client does not pick up org/project from envopenai.organizationleaksOPENAI_ORG_ID; with the fix it staysnullvitest --run src/test/main.test.tspassesMade with Cursor