Repository navigation
Description
Description
Configuring GPT-6 Astra with serviceTier: "priority" does not preserve that preference in the outgoing Responses request. OpenCode 1.18.29 bundles @ai-sdk/[email protected], whose Priority capability check excludes GPT-6 and removes service_tier during serialization. serviceTier: "default" survives.
This matters for users explicitly choosing the faster queue: the setting can be accepted while the request inherits the API project's default tier instead. This report does not establish which tier the server ultimately serves or any billing impact.
Source trace: OpenCode pins 3.0.84 and selects sdk.responses(modelID) for OpenAI. The SDK's capability check excludes GPT-6; its Responses serializer removes the unsupported tier. OpenAI documents Priority/Fast support for Astra, subject to its compatibility restrictions.
Suggested fix: update the bundled OpenAI SDK to a compatible 3.x release with the GPT-6 capability fix. I verified the request serialization fix in 3.0.88. Keep the canonical @ai-sdk/openai package identity: forcing a versioned model-provider override bypasses some package-specific replay and tool-schema transformations.
An OpenCode regression should check both tiers through request preparation, plus stateless reasoning replay, tool schemas, cancellation, and existing authentication handling. The verification below tests the SDK boundary, not a replacement OpenCode build or live account entitlement.
Plugins
None required for the standalone SDK reproduction.
OpenCode version
1.18.29. The current dev package manifest also pins @ai-sdk/openai to 3.0.84 when checked on September 5, 2026.
Steps to reproduce
Use API model gpt-6-astra with serviceTier: "priority".
In an empty directory, install the old and fixed SDKs:
bun add @ai-sdk/[email protected] openai-fixed@npm:@ai-sdk/[email protected]Save the following as repro.mjs, then run bun repro.mjs. The injected fetch captures the prepared JSON and throws before making any network request.
Offline reproduction
import assert from "node:assert/strict";
import { createOpenAI as oldSDK } from "@ai-sdk/openai";
import { createOpenAI as fixedSDK } from "openai-fixed";
for (const [version, createOpenAI] of [["3.0.84", oldSDK], ["3.0.88", fixedSDK]]) {
for (const tier of ["priority", "default"]) {
let body;
const stop = new Error("Captured offline");
const provider = createOpenAI({
apiKey: "unused-offline-fixture",
fetch: async (url, init) => {
assert.equal(String(url), "https://api.openai.com/v1/responses");
body = JSON.parse(init.body);
throw stop;
},
});
await assert.rejects(provider.responses("gpt-6-astra").doStream({
prompt: [{ role: "user", content: [{ type: "text", text: "Hello" }] }],
providerOptions: { openai: { serviceTier: tier } },
}), error => error === stop);
assert.equal(body.model, "gpt-6-astra");
console.log(`${version}: requested=${tier}, sent=${body.service_tier ?? "omitted"}`);
if (version === "3.0.88" || tier === "default") assert.equal(body.service_tier, tier);
else assert.equal(body.service_tier, undefined);
}
}Observed output:
3.0.84: requested=priority, sent=omitted
3.0.84: requested=default, sent=default
3.0.88: requested=priority, sent=priority
3.0.88: requested=default, sent=default
Expected: requesting priority preserves service_tier: "priority", as in 3.0.88. This deliberately asserts the old SDK's omission to make the side-by-side result reproducible.
Activity