Skip to content

fix(provider): preserve explicit OpenAI service tiers - #47671

Merged
rekram1-node merged 1 commit into
devfrom
openai-tier-pass
Sep 6, 2026
Merged

fix(provider): preserve explicit OpenAI service tiers#47671
rekram1-node merged 1 commit into
devfrom
openai-tier-pass

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

The OpenAI SDK silently removes explicitly configured Priority/Flex tiers when a model or Azure deployment name does not match its capability heuristics. The provider should validate the requested tier instead of the SDK silently falling back.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a Bun patch for @ai-sdk/openai@3.0.88 that removes only the Priority/Flex model-name filtering and associated unsupported warnings from Chat Completions and Responses.

The patch covers the public and internal CommonJS/ESM bundles, plus matching source. Azure uses the internal entrypoint, so patching only the public bundle would miss it.

  • Keeps tier-value validation and existing unset, auto, default, and null behavior.
  • Leaves reasoning, tool schemas/replay, authentication, and transport unchanged.
  • Allows unsupported tier combinations to reach the provider and return its normal error rather than silently changing the request.
  • Applies to the shared SDK used by direct OpenAI and Azure in OpenCode/Core. Other SDK versions, including Bedrock Mantle's 3.0.105, remain unchanged. No global override or dependency bump.

Only the dependency patch and its manifest/lockfile registration are added. No application source or permanent tests are added.

How did you verify your code works?

  • 795 selected existing OpenCode/Core tests and both package typechecks passed in an isolated environment.
  • Offline differential verification: 112 tier mismatches before the patch; 776 cases passed afterward across direct OpenAI/Azure, CJS/ESM, Chat/Responses, generate/stream, valid/invalid tiers, and provider-error propagation. Other request fields and unrelated warnings matched the baseline exactly.
  • 36 loopback checks through OpenCode's real Azure request path passed, including custom aliases, Priority/Flex/Default, reasoning and auth assertions.
  • Repeated the 776 cases after a clean-cache install using the saved patch; separately installed OpenAI 3.0.105 remained unpatched.
  • Frozen-lockfile install, formatting, and diff checks passed. No live inference calls or production build.

Screenshots / recordings

Not applicable; no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Requested by: @rekram1-node (Aiden via Slack)

@rekram1-node
rekram1-node merged commit ea2d59d into dev Sep 6, 2026
10 of 11 checks passed
@rekram1-node
rekram1-node deleted the openai-tier-pass branch September 6, 2026 21:48
1056674754 added a commit to 1056674754/opencode that referenced this pull request Sep 9, 2026
Upstream v1.18.29 (1674747, merged at 18a4845) -> v1.18.30 (3104c14),
28 commits / 105 files. Staged delta vs pre-merge fork HEAD is identical to
the upstream tag-to-tag diff (105 files, +1676/-403), confirming a clean
adoption.

Functional changes:
- feat(opencode): port Astra system prompt from v2 (anomalyco#48057) — new
  session/prompt/gpt-astra.txt wired through system.ts; fork's system
  transforms live in the openchamber plugin, no overlap.
- fix: preserve Bedrock DeepSeek model ids (anomalyco#34441) — provider.ts Bedrock
  loader passes arn: model ids through unmodified and tightens the
  cross-region prefix match from "deepseek" to "deepseek.r1"; inside the
  custom Azure/Bedrock loader region, disjoint from the fork snapshot
  architecture.
- fix(provider): preserve explicit OpenAI service tiers (anomalyco#47671).
- fix(opencode): add GitLab reasoning variants (anomalyco#47306) — transform.ts
  reasoningEffort now routes gitlab gpt-family to reasoningEffort and
  claude-family to adaptive thinking; disjoint from the fork GLM/ZhiPu
  normalization block, which remains intact (+77 fork-only lines).
- SDK bumps: @ai-sdk/openai 3.0.88, @ai-sdk/azure 3.0.93,
  gitlab-ai-provider 6.15.0 (8 packages installed via bun install).
- console: oauth client metadata document (anomalyco#47737), Chatwoot enterprise
  form (anomalyco#47488), openai usage normalization + tier threshold (anomalyco#47342),
  localized refund FAQs, zen model table updates (muse spark); go.mdx
  client session compatibility docs incl. zh translation.

Conflicts resolved: 29 package.json version bumps (rebranded 1.18.30-sscity
with a version-generic pattern after the v1.18.27 incident), bun.lock (took
upstream, rebranded workspace entries via bun install). Fork deltas
verified intact vs v1.18.30: ProviderSnapshot architecture (+492 in
provider.ts), deferred snapshot init, GLM normalization (+77 in
transform.ts), config getFresh/commitFresh (+14). Tests: provider,
transform, bedrock, config, v2, azure plugin, session retry/llm — 1058
pass / 0 fail across 15 files (22 new upstream tests included); typecheck
clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant