Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions memory-bank/aiConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@ limit or drops a thinking level fails requests until a row is added.
(`getGpt6ModelProfile`, not exported from the package). It takes a canonical,
unprefixed ID and owns the traits that hold on every endpoint: family, tools,
image/PDF input, tool-result images, and reasoning levels — including which
models lack `off` (GPT-6 Astra and GPT-6.1 Sol, matched at a model-name boundary
for any accepted suffix; original Sol/Luna and unknown future GPT-6 IDs keep
`off`). `openai-helpers.ts` and `bedrock-mantle-helpers.ts` both consume it
models lack `off` (GPT-6 Astra, GPT-6.1 Sol, GPT-6.2 Sol, and GPT-6.2 Astra,
matched at a model-name boundary for any accepted suffix; original Sol/Luna,
6.1 Terra, and unknown future GPT-6 IDs keep `off`). `openai-helpers.ts` and `bedrock-mantle-helpers.ts` both consume it
(Bedrock strips `openai.` first) and layer their own endpoint policy on top:
token limits, protocol, web search. The profile must never carry limits,
routes, or eligibility — a published OpenAI capacity is not an assumed
Expand Down Expand Up @@ -699,7 +699,7 @@ Per-provider cases:
known older GPT-5.4/5.5 IDs retain the prior 272K rule, and unknown future
GPT-5.x IDs default to the 1M family window. GPT-6 uses Responses with the
shared GPT-6 profile; only bare and dated IDs with a published AWS card
carry its limits (Astra and 6.1 Terra: 1.05M/128K; 6.1 Sol: 1M/131,072),
carry its limits (Astra, 6.1 Terra, 6.2 Sol, and 6.2 Astra: 1.05M/128K; 6.1 Sol: 1M/131,072),
and other GPT-6 IDs get a 1M window with unknown output — so a suffixed
Astra ID can inherit Astra's no-`off` rule without its limits.
- `openai` → the OpenAI table, with `maxInputTokens` re-derived via
Expand Down
14 changes: 14 additions & 0 deletions packages/ai-config/src/model-capabilities/__tests__/infer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ describe("inferModelCapabilities", () => {
}
});

it("omits off but allows max for GPT-6.2 Sol and Astra on OpenAI and Bedrock", () => {
for (const name of ["gpt-6.2-sol", "gpt-6.2-astra"]) {
for (const [providerId, modelId] of [
["openai", name],
["bedrock", `openai.${name}`],
]) {
const facts = inferModelCapabilities(providerId, modelId).facts;
expect(facts.thinkingEffortLevels).toEqual(["low", "medium", "high", "xhigh", "max"]);
expect(facts.maxContextLength).toBe(1_050_000);
expect(facts.maxOutputTokens).toBe(128_000);
}
}
});

it("keeps provider-owned GPT-6 capacities while sharing reasoning levels", () => {
const openai = inferModelCapabilities("openai", "gpt-6.1-sol");
const bedrock = inferModelCapabilities("bedrock", "openai.gpt-6.1-sol");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@ const IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp",
const DATED_SNAPSHOT_SUFFIX = /-\d{4}-\d{2}-\d{2}$/;

// Limits published on each model's AWS card, keyed by undated model name.
// Sources verified 2026-09-22 (Astra) and 2026-10-27 (6.1 Terra, 6.1 Sol):
// Sources verified 2026-09-22 (Astra), 2026-10-27 (6.1 Terra, 6.1 Sol), and
// 2026-11-18 (6.2 Sol, 6.2 Astra):
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-astra.html
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-1-terra.html
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-1-sol.html
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-2-sol.html
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-2-astra.html
// 6.1 Sol's card lists a 1M window and 131,072 output tokens, unlike the
// 1.05M / 128K of the other two.
// 1.05M / 128K of the others.
const GPT6_PUBLISHED_LIMITS = new Map<
string,
Required<Pick<InferredModelCapabilities, "maxContextLength" | "maxOutputTokens">>
>([
["gpt-6-astra", { maxContextLength: 1_050_000, maxOutputTokens: 128_000 }],
["gpt-6.1-terra", { maxContextLength: 1_050_000, maxOutputTokens: 128_000 }],
["gpt-6.1-sol", { maxContextLength: 1_000_000, maxOutputTokens: 131_072 }],
["gpt-6.2-sol", { maxContextLength: 1_050_000, maxOutputTokens: 128_000 }],
["gpt-6.2-astra", { maxContextLength: 1_050_000, maxOutputTokens: 128_000 }],
]);

/**
Expand Down
10 changes: 6 additions & 4 deletions packages/ai-config/src/model-capabilities/gpt6-model-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ export type Gpt6ModelProfile = Required<
const GPT6_EFFORT_LEVELS = ["off", "low", "medium", "high", "xhigh", "max"];
// The product's "off" maps onto OpenAI's "none" effort (the OpenAI client
// omits reasoning_effort; Bedrock Mantle sends the wire value "none").
// Sources verified 2026-09-22 (Astra) and 2026-09-30 (6.1 Sol):
// Sources verified 2026-09-22 (Astra), 2026-09-30 (6.1 Sol), 2026-11-18 (6.2):
// https://developers.openai.com/api/docs/models/gpt-6-astra
// https://developers.openai.com/api/docs/models/gpt-6.1-sol
// Neither model offers "none", so the product must not offer "off". This is a
// model property, so it applies to every accepted suffix of these names.
// https://developers.openai.com/api/docs/models/gpt-6.2-sol
// https://developers.openai.com/api/docs/models/gpt-6.2-astra
// None of these models offers "none", so the product must not offer "off".
// This is a model property, so it applies to every accepted suffix of these names.
const GPT6_NO_OFF_EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
const GPT6_NO_OFF_MODEL = /^gpt-6(?:-astra|\.1-sol)(?:-|$)/;
const GPT6_NO_OFF_MODEL = /^gpt-6(?:-astra|\.1-sol|\.2-(?:sol|astra))(?:-|$)/;
const IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp", "application/pdf"];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,16 @@ describe("OpenAI model discovery", () => {
"gpt-6-sol",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6.2-sol",
"gpt-6.2-astra",
"gpt-6-luna",
]),
);
expect(models.find((model) => model.id === "gpt-6.2-sol")).toMatchObject({
name: "GPT-6.2 Sol",
thinkingEffortLevels: ["low", "medium", "high", "xhigh", "max"],
});
expect(models.find((model) => model.id === "gpt-6.2-astra")?.name).toBe("GPT-6.2 Astra");
expect(models.find((model) => model.id === "gpt-6.1-terra")).toMatchObject({
name: "GPT-6.1 Terra",
thinkingEffortLevels: ["off", "low", "medium", "high", "xhigh", "max"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const OPENAI_MODEL_NAMES: Record<string, string> = {
"gpt-6-sol": "GPT-6 Sol",
"gpt-6.1-sol": "GPT-6.1 Sol",
"gpt-6.1-terra": "GPT-6.1 Terra",
"gpt-6.2-sol": "GPT-6.2 Sol",
"gpt-6.2-astra": "GPT-6.2 Astra",
"gpt-6-luna": "GPT-6 Luna",
"gpt-5-mini": "GPT-5 Mini",
"gpt-5-nano": "GPT-5 Nano",
Expand Down
26 changes: 14 additions & 12 deletions packages/ai-provider-bridge/src/providers/openai-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ const OPENAI_DEFAULT_CAPABILITIES = {

// Static fallback models for Responses API - current as of September 2026
// Only includes models confirmed to support Responses API
const OPENAI_FALLBACK_ROWS = [
{ id: "gpt-6-astra", name: "GPT-6 Astra" },
{ id: "gpt-6-sol", name: "GPT-6 Sol" },
{ id: "gpt-6.1-sol", name: "GPT-6.1 Sol" },
{ id: "gpt-6.1-terra", name: "GPT-6.1 Terra" },
{ id: "gpt-6-luna", name: "GPT-6 Luna" },
{ id: "gpt-5.4", name: "GPT-5.4" },
{ id: "gpt-5.4-mini", name: "GPT-5.4 Mini" },
{ id: "gpt-5.4-nano", name: "GPT-5.4 Nano" },
{ id: "gpt-5.4-pro", name: "GPT-5.4 Pro" },
{ id: "gpt-5-chat-latest", name: "GPT-5 Chat Latest" },
const OPENAI_FALLBACK_IDS = [
"gpt-6-astra",
"gpt-6-sol",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6.2-sol",
"gpt-6.2-astra",
"gpt-6-luna",
"gpt-5.4",
"gpt-5.4-mini",
"gpt-5.4-nano",
"gpt-5.4-pro",
"gpt-5-chat-latest",
];

function buildOpenAIModel(providerId: ResolvedProviderId, id: string, name: string): ModelInfo {
Expand Down Expand Up @@ -106,7 +108,7 @@ function createOpenAIModelFetcher(
);
},
fallbackModels: includeHostedModels
? OPENAI_FALLBACK_ROWS.map(({ id, name }) => buildOpenAIModel(providerId, id, name))
? OPENAI_FALLBACK_IDS.map((id) => buildOpenAIModel(providerId, id, getOpenAIModelName(id)))
: [],
logger,
});
Expand Down
Loading