Skip to content

fix(openai-adapters): suppress org/project headers that break under Turkish locales - #13097

Open
edenbuilds wants to merge 2 commits into
continuedev:mainfrom
edenbuilds:fix/turkish-locale-openai-headers
Open

fix(openai-adapters): suppress org/project headers that break under Turkish locales#13097
edenbuilds wants to merge 2 commits into
continuedev:mainfrom
edenbuilds:fix/turkish-locale-openai-headers

Conversation

@edenbuilds

Copy link
Copy Markdown

Summary

  • Under Turkish locales, the OpenAI SDK's OpenAI-Organization / OpenAI-Project headers lowercase to invalid HTTP tokens (openaı-organization) and crash requests.
  • Explicitly set organization/project to null and null out those headers with ASCII-safe lowercase keys so OPENAI_ORG_ID / OPENAI_PROJECT_ID from the environment cannot inject the PascalCase headers.
  • Applied in both OpenAIApi and AzureApi client construction.

Fixes #12568

Test plan

  • Regression test asserts OpenAI-Organization.toLocaleLowerCase(tr-TR) produces the invalid token, and that our client does not pick up org/project from env
  • A/B: without the fix, openai.organization leaks OPENAI_ORG_ID; with the fix it stays null
  • vitest --run src/test/main.test.ts passes

Made with Cursor

OpenAI SDK injects OpenAI-Organization from OPENAI_ORG_ID; under tr-TR that
name lowercases to an invalid token (openaı-organization) and crashes requests.
@edenbuilds
edenbuilds requested a review from a team as a code owner August 6, 2026 23:22
@edenbuilds
edenbuilds requested review from sestinj and removed request for a team August 6, 2026 23:22
@edenbuilds

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@edenbuilds

Copy link
Copy Markdown
Author

CI note: the two failing checks look unrelated to this OpenAI-adapters header change:

  • e2e/.../PromptFile.test.js (yaml)ReadError: The server aborted pending request (infra flake; the non-yaml PromptFile e2e passed)
  • jetbrains-tests — JetBrains plugin suite; this PR only touches packages/openai-adapters

Happy to re-run those checks if a maintainer can kick them, or push an empty commit if that helps.

@edenbuilds

Copy link
Copy Markdown
Author

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.

@edenbuilds

Copy link
Copy Markdown
Author

Heads-up on the red check: jetbrains-tests here is failing on Autocomplete > testAutocomplete() (Autocomplete.kt:42), which is the IntelliJ integration suite and doesn't touch this change.

It looks like a broken baseline rather than something this PR introduced — the three most recent failing PR Checks runs on unrelated branches all fail the same job:

branch failing jobs
fix-autocomplete-prune-length-min-response-tokens jetbrains-tests, require-all-checks-to-pass
snyk-fix-ec3df2206… jetbrains-tests, packages-checks (openai-adapters), all e2e, …
snyk-fix-cfe49b462… core-checks, jetbrains-tests, packages-checks (openai-adapters), all e2e, …

The first is the same two-job failure as this PR. require-all-checks-to-pass is just the aggregate gate downstream of it.

packages-checks (openai-adapters) — the job that actually covers this change — is green here.

Happy to rebase once the JetBrains suite is healthy on main if that's the simplest way to get a clean run.

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.

Bug: Turkish Locale Crash - Header name must be a valid HTTP token ["openaı-organization"]

1 participant