From ae3547c1d0768deba01c7f7fe5425d5c5b69d643 Mon Sep 17 00:00:00 2001 From: Zeph Gillen Date: Tue, 14 Jul 2026 13:11:59 -0700 Subject: [PATCH] feat(openai): reconcile gpt-5.6 defs with upstream (cacheWrites + tiers) Upstream independently shipped gpt-5.6 sol/terra/luna after the fork did, so the entries collide and differ. Adopt upstream's cacheWritesPrice and flex/priority service tiers (cost was under-counted without them); keep the fork's Luna 1.05M contextWindow + longContextPricing, reasoning-effort defaults (high/medium/low), and descriptions. All tier contextWindows pinned to 1_050_000 (upstream tied them to its 400K Luna figure, which is still unverified against OpenAI docs). - openai.ts: add cacheWritesPrice + tiers to the three gpt-5.6 entries - openai-native.spec: assert Sol cacheWritesPrice 6.25 + priority tier present - FORK.md: record the collision, the index.ts default-model divergence (openAiNativeDefaultModelId vs upstream hardcoded gpt-4o), next-sync guidance, and GPT-5.6 provider coverage (Bedrock GA-via-mantle deferred; Vertex not offered) Co-Authored-By: Claude Opus 4.8 (1M context) --- FORK.md | 43 +++++++++++++------ packages/types/src/providers/openai.ts | 12 ++++++ .../providers/__tests__/openai-native.spec.ts | 2 + 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/FORK.md b/FORK.md index 2cee803188..d6dd5674fe 100644 --- a/FORK.md +++ b/FORK.md @@ -34,13 +34,13 @@ across merges. `AGENTS.md` only points here. ## Divergence at a glance -| # | Local feature | Origin commit(s) | Nature | -| --- | --------------------------------------------------------------- | ------------------------------------ | ---------------------------------- | -| 1 | Effort-based Anthropic reasoning (Opus 4.6/4.7/4.8) | `fd93c5bde`, `64fc5fc98` | modifies shared provider logic | -| 2 | OpenRouter effort-array mirroring + gpt-5.5 defs | `062657a7d`, `64fc5fc98` | modifies shared fetcher/registry | -| 3 | Claude Fable 5 + safety-refusal handling | `811b5ca55` | modifies shared provider logic | -| 4 | `"max"` reasoningEffort i18n label | `dd675fd3b` | mechanical i18n | -| 5 | Workspace-scoped code-index config (`.roo/codebase-index.json`) | `3efa0728e`→`8f54e2274` (phases 1–5) | mostly new files + isolated wiring | +| # | Local feature | Origin commit(s) | Nature | +| --- | ---------------------------------------------------------------------------------- | ------------------------------------- | ---------------------------------- | +| 1 | Effort-based Anthropic reasoning (Opus 4.6/4.7/4.8) | `fd93c5bde`, `64fc5fc98` | modifies shared provider logic | +| 2 | OpenRouter effort mirroring + gpt-5.5/5.6 defs (5.6 now also upstream — collision) | `062657a7d`, `64fc5fc98`, `ded80951d` | modifies shared fetcher/registry | +| 3 | Claude Fable 5 + safety-refusal handling | `811b5ca55` | modifies shared provider logic | +| 4 | `"max"` reasoningEffort i18n label | `dd675fd3b` | mechanical i18n | +| 5 | Workspace-scoped code-index config (`.roo/codebase-index.json`) | `3efa0728e`→`8f54e2274` (phases 1–5) | mostly new files + isolated wiring | ## Conflict-prone code paths (shared files we modified) @@ -88,11 +88,30 @@ for **Claude Sonnet 5** — upstream #778 shipped it budget/binary; the fork con ### Feature 2 — OpenRouter / OpenAI / Requesty effort -| File | Upstream churn (6mo) | Our change | Change nature | Risk | -| ------------------------------------------ | -------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------- | -| `packages/types/src/providers/openai.ts` | 8 | gpt-5.5 defs + static effort arrays | modifies registry | **MED** | -| `src/api/providers/fetchers/openrouter.ts` | 6 | Dynamic fetcher patches known IDs (`anthropic/claude-opus-4.7`, `4.8`, `claude-sonnet-5`, `claude-fable-5`, gpt-5.5 family) to mirror the static effort arrays so `xhigh`/`max` stay reachable from the UI | modifies shared fetcher | **MED** | -| `src/api/providers/fetchers/requesty.ts` | low | Same effort-array mirroring as openrouter for `anthropic/claude-fable-5` + `claude-sonnet-5` (sets `supportsReasoningBudget:false`). Upstream's Sonnet 5 (#778) patches the same block → conflict-prone. **Was missing from this map before the v3.68.0 sync.** | modifies shared fetcher | **MED** | +| File | Upstream churn (6mo) | Our change | Change nature | Risk | +| ------------------------------------------ | -------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------- | +| `packages/types/src/providers/openai.ts` | 8 | gpt-5.5 + gpt-5.6 (sol/terra/luna) defs + static effort arrays. gpt-5.6 now shared with upstream (collision): fork keeps Luna 1.05M + longContextPricing + effort defaults (high/med/low) + descriptions, adopts upstream cacheWrites + flex/priority tiers; default pinned `gpt-5.6-sol` | modifies registry | **MED** | +| `packages/types/src/providers/index.ts` | 14 | `getProviderDefaultModelId("openai-native")` returns `openAiNativeDefaultModelId` (import added) vs upstream's hardcoded `"gpt-4o"`; fork-only default fix — silent-revert risk on merge | modifies shared registry | **MED** | +| `src/api/providers/fetchers/openrouter.ts` | 6 | Dynamic fetcher patches known IDs (`anthropic/claude-opus-4.7`, `4.8`, `claude-sonnet-5`, `claude-fable-5`, gpt-5.5 family) to mirror the static effort arrays so `xhigh`/`max` stay reachable from the UI | modifies shared fetcher | **MED** | +| `src/api/providers/fetchers/requesty.ts` | low | Same effort-array mirroring as openrouter for `anthropic/claude-fable-5` + `claude-sonnet-5` (sets `supportsReasoningBudget:false`). Upstream's Sonnet 5 (#778) patches the same block → conflict-prone. **Was missing from this map before the v3.68.0 sync.** | modifies shared fetcher | **MED** | + +**Next-sync note (gpt-5.6):** upstream independently shipped `gpt-5.6-sol/terra/luna` after the fork +did, so these entries WILL conflict on the next merge. Resolution baked in here: keep the fork's Luna +`contextWindow: 1_050_000` + `longContextPricing` + effort defaults + descriptions; take upstream's +`cacheWritesPrice` + flex/priority `tiers` (with every tier `contextWindow` at `1_050_000`, not +upstream's 400K). Luna's 1.05M (fork) vs 400K (upstream) is still unverified against OpenAI's own +docs — confirm when possible. + +**GPT-5.6 provider coverage (verified 2026-07-14):** + +- OpenAI-native + OpenRouter — supported here. +- Amazon Bedrock — GA on Bedrock 2026-07-13, but **Responses-API-only via the `bedrock-mantle` + endpoint**. The fork's Bedrock provider is Converse/`bedrock-runtime`-only, so a `bedrockModels` + entry would 400 at request time. Real support needs a separate OpenAI-Responses-on-`bedrock-mantle` + transport — **deferred** (do not add `openai.gpt-5.6-*` to `bedrock.ts`). +- Google Vertex — **not offered** by Vertex Model Garden (proprietary GPT ships to Azure Foundry + + Bedrock, not Google). Claude on Vertex (Opus 4.8, Fable 5, Sonnet 5) is already wired — see the + Feature 1+3 `vertex.ts` row. ### Feature 5 — Workspace-scoped code-index (modified shared files) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 600a94cd2e..dc5b7c6945 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -17,6 +17,7 @@ export const openAiNativeModels = { reasoningEffort: "high", inputPrice: 5.0, outputPrice: 30.0, + cacheWritesPrice: 6.25, cacheReadsPrice: 0.5, longContextPricing: { thresholdTokens: 272_000, @@ -26,6 +27,10 @@ export const openAiNativeModels = { }, supportsVerbosity: true, supportsTemperature: false, + tiers: [ + { name: "flex", contextWindow: 1_050_000, inputPrice: 2.5, outputPrice: 15.0, cacheReadsPrice: 0.25 }, + { name: "priority", contextWindow: 1_050_000, inputPrice: 12.5, outputPrice: 75.0, cacheReadsPrice: 1.25 }, + ], description: "GPT-5.6 Sol: OpenAI's flagship model for frontier reasoning, complex coding, and multi-step agentic tasks", }, @@ -40,6 +45,7 @@ export const openAiNativeModels = { reasoningEffort: "medium", inputPrice: 2.5, outputPrice: 15.0, + cacheWritesPrice: 3.125, cacheReadsPrice: 0.25, longContextPricing: { thresholdTokens: 272_000, @@ -49,6 +55,10 @@ export const openAiNativeModels = { }, supportsVerbosity: true, supportsTemperature: false, + tiers: [ + { name: "flex", contextWindow: 1_050_000, inputPrice: 1.25, outputPrice: 7.5, cacheReadsPrice: 0.125 }, + { name: "priority", contextWindow: 1_050_000, inputPrice: 6.25, outputPrice: 37.5, cacheReadsPrice: 0.625 }, + ], description: "GPT-5.6 Terra: Balanced model for everyday coding, reasoning, and agentic tasks", }, "gpt-5.6-luna": { @@ -62,6 +72,7 @@ export const openAiNativeModels = { reasoningEffort: "low", inputPrice: 1.0, outputPrice: 6.0, + cacheWritesPrice: 1.25, cacheReadsPrice: 0.1, longContextPricing: { thresholdTokens: 272_000, @@ -71,6 +82,7 @@ export const openAiNativeModels = { }, supportsVerbosity: true, supportsTemperature: false, + tiers: [{ name: "flex", contextWindow: 1_050_000, inputPrice: 0.5, outputPrice: 3.0, cacheReadsPrice: 0.05 }], description: "GPT-5.6 Luna: Fast, cost-efficient model optimized for speed and everyday use", }, "gpt-5.1-codex-max": { diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 397ca993cf..c540adc0fb 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -299,7 +299,9 @@ describe("OpenAiNativeHandler", () => { expect(modelInfo.info.reasoningEffort).toBe("high") expect(modelInfo.info.inputPrice).toBe(5.0) expect(modelInfo.info.outputPrice).toBe(30.0) + expect(modelInfo.info.cacheWritesPrice).toBe(6.25) expect(modelInfo.info.cacheReadsPrice).toBe(0.5) + expect(modelInfo.info.tiers?.some((t) => t.name === "priority")).toBe(true) }) it("should return GPT-5.4 model info when selected", () => {