Skip to content

fix: preserve suppressed workload authorization - #2699

Merged
HAYDEN-OAI merged 1 commit into
mainfrom
fix/workload-authorization-suppression
Sep 8, 2026
Merged

HAYDEN-OAI merged 1 commit into
mainfrom
fix/workload-authorization-suppression

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Preserve explicit null and empty Authorization overrides from client defaults and request headers by resolving only the SDK workload-identity placeholder at dispatch.

Supersedes #2689 with a one-line production fix and 12 focused cases in the existing workload-identity suite. The cases cover client/request overrides, case-insensitive precedence, replacement credentials, undefined values, native Headers, and placeholder resolution. Each case makes two requests to check the result with a populated credential cache.

Review scope

The acceptance criterion is that dispatch respects the final merged Authorization value, including explicit suppression. Credential-acquisition timing, 401 retry attribution, and transparent ownership through custom hooks/header copies should be evaluated as separate changes.

Validation

  • ./scripts/test tests/lib/workload-identity.test.ts tests/buildHeaders.test.ts: 46 tests passed on Node 24.20.0 and exact minimum Node 22.0.0.
  • pnpm lint and pnpm exec tsc passed with pnpm 11.5.1.
  • pnpm build passed, including CJS/ESM core and provider import checks.
  • Built CJS and ESM core imports also passed on Node 22.0.0.

Validation used synthetic credentials and in-memory fetch responses.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T17:34:35.892547Z 1b34a79 PR opened
🔒 Security Review ✅ Completed 2026-09-08T17:36:17.978255Z 1b34a79 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

32 mixed files remain; 1 existing customization changed.

Compared bb0f51bed84b → 1b34a791605f. Generated baselines verified.

File Result Current custom patch
src/client.ts Existing customization changed +787 / −90
31 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/responses/internal-base.ts
  • src/resources/responses/responses.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • src/resources/webhooks/webhooks.ts
  • tests/lib/data-residency.test.ts

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 34257793599 --repo openai/openai-node \
  --name castiron-custom-code-34257793599-1 --dir /tmp/castiron-custom-code-34257793599-1
git apply --stat /tmp/castiron-custom-code-34257793599-1/custom-code.patch
cat /tmp/castiron-custom-code-34257793599-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin bb0f51bed84bf60b0639af7a894fcf538264e435 1b34a791605fdffcb745110514f27a532bc303fd
python3 scripts/castiron/custom_code_report.py report \
  --base bb0f51bed84bf60b0639af7a894fcf538264e435 \
  --head 1b34a791605fdffcb745110514f27a532bc303fd --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-1b34a791605f
cat /tmp/castiron-custom-code-1b34a791605f/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@openai-sdks

openai-sdks Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 11.12s for Node SDK PR #2699.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 157ms
tests/chat-completions-create.test.ts ✅ Passed 199ms
tests/chat-completions-stream.test.ts ✅ Passed 154ms
tests/files-content-binary.test.ts ✅ Passed 200ms
tests/files-create-multipart.test.ts ✅ Passed 282ms
tests/files-list-pagination.test.ts ✅ Passed 206ms
tests/initialize-config.test.ts ✅ Passed 152ms
tests/instance-isolation.test.ts ✅ Passed 163ms
tests/models-list.test.ts ✅ Passed 192ms
tests/responses-background-lifecycle.test.ts ✅ Passed 255ms
tests/responses-body-method-errors.test.ts ✅ Passed 330ms
tests/responses-cancel-timeout.test.ts ✅ Passed 212ms
tests/responses-cancel.test.ts ✅ Passed 255ms
tests/responses-compact-retries.test.ts ✅ Passed 211ms
tests/responses-compact.test.ts ✅ Passed 202ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 128ms
tests/responses-create-advanced.test.ts ✅ Passed 246ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.222s
tests/responses-create-errors.test.ts ✅ Passed 196ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 132ms
tests/responses-create-retries.test.ts ✅ Passed 253ms
tests/responses-create-stream-failures.test.ts ✅ Passed 135ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.2s
tests/responses-create-stream-wire.test.ts ✅ Passed 3.016s
tests/responses-create-stream.test.ts ✅ Passed 67ms
tests/responses-create-terminal-states.test.ts ✅ Passed 195ms
tests/responses-create-timeout.test.ts ✅ Passed 196ms
tests/responses-create.test.ts ✅ Passed 237ms
tests/responses-delete.test.ts ✅ Passed 243ms
tests/responses-input-items-errors.test.ts ✅ Passed 216ms
tests/responses-input-items-list.test.ts ✅ Passed 240ms
tests/responses-input-items-options.test.ts ✅ Passed 236ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 240ms
tests/responses-input-tokens-count.test.ts ✅ Passed 233ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.717s
tests/responses-not-found-errors.test.ts ✅ Passed 229ms
tests/responses-parse.test.ts ✅ Passed 169ms
tests/responses-retrieve-retries.test.ts ✅ Passed 365ms
tests/responses-retrieve.test.ts ✅ Passed 216ms
tests/responses-stored-method-errors.test.ts ✅ Passed 513ms
tests/retry-behavior.test.ts ✅ Passed 3.01s
tests/sdk-error-shape.test.ts ✅ Passed 266ms

View OkTest run #34257759615

SDK merge (32e30a357115) · head (1b34a791605f) · base (bb0f51bed84b) · OkTest (08ec4299e769)

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the exact 2-file patch against the narrow dispatch outcome: preserve the final merged Authorization value, including explicit null and empty client/request overrides, and resolve only the SDK workload-identity placeholder. The equality check is case-insensitive through native Headers lookup, leaves replacement credentials and inherited defaults intact, and preserves suppression on repeated cached-token requests. Credential acquisition timing, 401 provenance, and custom hook ownership are unchanged and remain explicit non-goals. The focused workload-identity and header suites pass locally: 46 tests. Git diff check passes, no API or architecture expansion, no unresolved threads, and every exact-head lint/build/Node 22/24/26/ecosystem/CodeQL/Castiron check is green. No blocking findings.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete two-file diff and the unchanged header merge, workload credential cache, and dispatch path. No findings. Resolving only the existing workload placeholder preserves the final merged Authorization value, including null/empty suppression, case-insensitive overrides, replacement credentials, and undefined inheritance. This is the right structural simplification: remove the fallback, with no additional state or header machinery. Client size stays 2,362 lines; tests grow 457 to 511.

Fresh validation: 46 focused tests pass on Node 24.20.0 and exact minimum 22.0.0; the same tests against the actual base fail seven suppression cases. An independent built CJS/ESM matrix passes 192 cases per runtime, each on first and cached requests. Canonical build and core/provider import checks pass. These runs used copied local dependencies because the configured registry was unavailable; Vitest matches, but the full dependency tree does not match the lockfile. Exact pinned lint could not be completed, and whole-project tsc is blocked by missing example dependencies. Author-reported lint/type results remain unverified locally. Credential-acquisition timing, 401 attribution, and arbitrary hook/header-copy ownership remain separate follow-ups.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Sep 8, 2026
@HAYDEN-OAI HAYDEN-OAI added the codex-security Result of a Codex Security scan label Sep 8, 2026
Merged via the queue into main with commit 57bbfd3 Sep 8, 2026
38 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the fix/workload-authorization-suppression branch September 8, 2026 18:25
@openai-sdks openai-sdks Bot mentioned this pull request Sep 8, 2026
gh-actions-shared Bot pushed a commit to xf-qubit/openai-node that referenced this pull request Sep 9, 2026
Automated Release PR
---


##
[7.12.0](openai/openai-node@v7.11.0...v7.12.0)
(2026-09-08)


### Features

* **api:** add GPT Image 2.5 models and image options
([openai#2705](openai#2705))
([6500a16](openai@6500a16))


### Bug Fixes

* **assistants:** reject root IDs in run-step deltas
([openai#2698](openai#2698))
([63dfa4c](openai@63dfa4c))
* **files:** use a monotonic clock for processing timeout
([openai#2657](openai#2657))
([bb0f51b](openai@bb0f51b))
* preserve suppressed workload authorization
([openai#2699](openai#2699))
([57bbfd3](openai@57bbfd3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security Result of a Codex Security scan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants