Skip to content

fix(bedrock): honor cancellation during bearer credential resolution - #2478

Merged
HAYDEN-OAI merged 3 commits into
mainfrom
codex/bedrock-bearer-cancellation-20260825-9qt3khub
Aug 26, 2026
Merged

HAYDEN-OAI merged 3 commits into
mainfrom
codex/bedrock-bearer-cancellation-20260825-9qt3khub

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • Honor the documented per-request signal while a Bedrock bearer tokenProvider is resolving, including dependency-free and AWS bearer provider entrypoints.
  • Preserve configured-origin and Authorization ownership validation, direct user-abort causes, existing credential-provider error wrapping, credential rotation, static and environment credentials, and hostile AbortSignal cleanup behavior.
  • Prevent cancelled credential resolution from attaching authorization headers or reaching fetch, without introducing provider timeouts or unsupported signal options.

Validation

  • Reproduced through real new OpenAI({ provider: bedrock({ tokenProvider }), fetch }).models.list({ signal }) requests across both provider entrypoints and Mantle/runtime endpoints, including retries, reentrant registration, throwing cleanup/getters, native Promise compatibility, NaN first-cause ownership, and late provider failures.
  • 6,325 handwritten tests; 556 isolated generated tests; 227 adjacent Bedrock tests on both Node 22 and Node 24.
  • Full formatting/lint, strict source types, rebuilt package, published TypeScript 4.9 and current types, publint, packed package, and real built CommonJS/ESM cancellation smoke tests.

@HAYDEN-OAI
HAYDEN-OAI requested a review from a team as a code owner August 26, 2026 01:24
@openai-sdks

openai-sdks Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 8.827s for Node SDK PR #2478.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 150ms
tests/chat-completions-create.test.ts ✅ Passed 205ms
tests/chat-completions-stream.test.ts ✅ Passed 184ms
tests/files-content-binary.test.ts ✅ Passed 100ms
tests/files-create-multipart.test.ts ✅ Passed 122ms
tests/files-list-pagination.test.ts ✅ Passed 141ms
tests/initialize-config.test.ts ✅ Passed 161ms
tests/instance-isolation.test.ts ✅ Passed 93ms
tests/models-list.test.ts ✅ Passed 99ms
tests/responses-background-lifecycle.test.ts ✅ Passed 213ms
tests/responses-body-method-errors.test.ts ✅ Passed 236ms
tests/responses-cancel-timeout.test.ts ✅ Passed 195ms
tests/responses-cancel.test.ts ✅ Passed 155ms
tests/responses-compact-retries.test.ts ✅ Passed 181ms
tests/responses-compact.test.ts ✅ Passed 205ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 86ms
tests/responses-create-advanced.test.ts ✅ Passed 118ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.098s
tests/responses-create-errors.test.ts ✅ Passed 139ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 109ms
tests/responses-create-retries.test.ts ✅ Passed 197ms
tests/responses-create-stream-failures.test.ts ✅ Passed 155ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.132s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.245s
tests/responses-create-stream.test.ts ✅ Passed 78ms
tests/responses-create-terminal-states.test.ts ✅ Passed 203ms
tests/responses-create-timeout.test.ts ✅ Passed 205ms
tests/responses-create.test.ts ✅ Passed 102ms
tests/responses-delete.test.ts ✅ Passed 104ms
tests/responses-input-items-errors.test.ts ✅ Passed 192ms
tests/responses-input-items-list.test.ts ✅ Passed 139ms
tests/responses-input-items-options.test.ts ✅ Passed 95ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 224ms
tests/responses-input-tokens-count.test.ts ✅ Passed 191ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.547s
tests/responses-not-found-errors.test.ts ✅ Passed 194ms
tests/responses-parse.test.ts ✅ Passed 140ms
tests/responses-retrieve-retries.test.ts ✅ Passed 182ms
tests/responses-retrieve.test.ts ✅ Passed 161ms
tests/responses-stored-method-errors.test.ts ✅ Passed 429ms
tests/retry-behavior.test.ts ✅ Passed 3.069s
tests/sdk-error-shape.test.ts ✅ Passed 204ms

View OkTest run #33011725327

SDK merge (c23df1352e45) · head (b228a78c937d) · base (520d60447177) · OkTest (2b1bdfd25e98)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 26, 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-08-26T20:44:06.509434Z b228a78 New commits
🔒 Security Review ✅ Completed 2026-08-26T20:44:04.422510Z b228a78 New commits
ℹ️ 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 Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

32 mixed files remain; 0 existing customizations changed.

Compared 520d60447177 → b228a78c937d. Generated baselines verified.

32 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • 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 33011759018 --repo openai/openai-node \
  --name castiron-custom-code-33011759018-1 --dir /tmp/castiron-custom-code-33011759018-1
git apply --stat /tmp/castiron-custom-code-33011759018-1/custom-code.patch
cat /tmp/castiron-custom-code-33011759018-1/custom-code.patch

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

git fetch --no-tags origin 520d6044717790d922e9659427518850a80a0345 b228a78c937d115f98669ed2ecd80b739944e821
python3 scripts/castiron/custom_code_report.py report \
  --base 520d6044717790d922e9659427518850a80a0345 \
  --head b228a78c937d115f98669ed2ecd80b739944e821 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-b228a78c937d
cat /tmp/castiron-custom-code-b228a78c937d/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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38c97171a9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/internal/bedrock.ts Resolved

@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.

Independently reviewed Bedrock bearer credential cancellation across both original and finalized request signals, signal deduplication, pre-abort handling, registration/cleanup races, exact abort causes, late credential rejection, provider-error propagation, and both provider entrypoints.

@HAYDEN-OAI
HAYDEN-OAI force-pushed the codex/bedrock-bearer-cancellation-20260825-9qt3khub branch from 47c4cad to bea8e45 Compare August 26, 2026 20:32
@HAYDEN-OAI
HAYDEN-OAI force-pushed the codex/bedrock-bearer-cancellation-20260825-9qt3khub branch from bea8e45 to 86e6de4 Compare August 26, 2026 20:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86e6de4b1c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/internal/bedrock.ts Resolved
@HAYDEN-OAI
HAYDEN-OAI merged commit 2dac2f4 into main Aug 26, 2026
33 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the codex/bedrock-bearer-cancellation-20260825-9qt3khub branch August 26, 2026 20:47
@openai-sdks openai-sdks Bot mentioned this pull request Aug 26, 2026
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.

2 participants