fix(openai): synthesize codex gpt-5.5 oauth model · openclaw/openclaw@79066f5
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai
|
17 | 17 | ### Fixes |
18 | 18 | |
19 | 19 | - Codex/media understanding: support `codex/*` image models through bounded Codex app-server image turns, while keeping `openai-codex/*` on the OpenAI Codex OAuth route and validating app-server responses against generated protocol contracts. Fixes #70201. |
| 20 | +- Providers/OpenAI Codex: synthesize the `openai-codex/gpt-5.5` OAuth model row when Codex catalog discovery omits it, so cron and subagent runs do not fail with `Unknown model` while the account is authenticated. |
20 | 21 | - Providers/Google: honor the private-network SSRF opt-in for Gemini image generation requests, so trusted proxy setups that resolve Google API hosts to private addresses can use `image_generate`. Fixes #67216. |
21 | 22 | - Agents/transport: stop embedded runs from lowering the process-wide undici stream timeouts, so slow Gemini image generation and other long-running provider requests no longer inherit short run-attempt headers timeouts. Fixes #70423. Thanks @giangthb. |
22 | 23 | - Providers/OpenRouter: send image-understanding prompts as user text before image parts, restoring non-empty vision responses for OpenRouter multimodal models. Fixes #70410. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -368,6 +368,27 @@ describe("openai codex provider", () => {
|
368 | 368 | }); |
369 | 369 | }); |
370 | 370 | |
| 371 | +it("synthesizes gpt-5.5 when the Codex catalog omits the OAuth row", () => { |
| 372 | +const provider = buildOpenAICodexProviderPlugin(); |
| 373 | + |
| 374 | +const model = provider.resolveDynamicModel?.({ |
| 375 | +provider: "openai-codex", |
| 376 | +modelId: "gpt-5.5", |
| 377 | +modelRegistry: createSingleModelRegistry(createCodexTemplate({}), null) as never, |
| 378 | +}); |
| 379 | + |
| 380 | +expect(model).toMatchObject({ |
| 381 | +id: "gpt-5.5", |
| 382 | +api: "openai-codex-responses", |
| 383 | +baseUrl: "https://chatgpt.com/backend-api/codex", |
| 384 | +reasoning: true, |
| 385 | +input: ["text", "image"], |
| 386 | +contextWindow: 1_000_000, |
| 387 | +contextTokens: 272_000, |
| 388 | +maxTokens: 128_000, |
| 389 | +}); |
| 390 | +}); |
| 391 | + |
371 | 392 | it("resolves gpt-5.4-pro from a gpt-5.4 runtime template when legacy codex rows are absent", () => { |
372 | 393 | const provider = buildOpenAICodexProviderPlugin(); |
373 | 394 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,6 +50,8 @@ const OPENAI_CODEX_GPT_54_MODEL_ID = "gpt-5.4";
|
50 | 50 | const OPENAI_CODEX_GPT_54_LEGACY_MODEL_ID = "gpt-5.4-codex"; |
51 | 51 | const OPENAI_CODEX_GPT_54_PRO_MODEL_ID = "gpt-5.4-pro"; |
52 | 52 | const OPENAI_CODEX_GPT_54_MINI_MODEL_ID = "gpt-5.4-mini"; |
| 53 | +const OPENAI_CODEX_GPT_55_NATIVE_CONTEXT_TOKENS = 1_000_000; |
| 54 | +const OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS = 272_000; |
53 | 55 | const OPENAI_CODEX_GPT_55_PRO_NATIVE_CONTEXT_TOKENS = 1_000_000; |
54 | 56 | const OPENAI_CODEX_GPT_55_PRO_DEFAULT_CONTEXT_TOKENS = 272_000; |
55 | 57 | const OPENAI_CODEX_GPT_54_NATIVE_CONTEXT_TOKENS = 1_050_000; |
@@ -185,7 +187,22 @@ function resolveCodexForwardCompatModel(ctx: ProviderResolveDynamicModelContext)
|
185 | 187 | const model = ctx.modelRegistry.find(PROVIDER_ID, trimmedModelId) as |
186 | 188 | | ProviderRuntimeModel |
187 | 189 | | undefined; |
188 | | -return model; |
| 190 | +return ( |
| 191 | +model ?? |
| 192 | +normalizeModelCompat({ |
| 193 | +id: trimmedModelId, |
| 194 | +name: trimmedModelId, |
| 195 | +api: "openai-codex-responses", |
| 196 | +provider: PROVIDER_ID, |
| 197 | +baseUrl: OPENAI_CODEX_BASE_URL, |
| 198 | +reasoning: true, |
| 199 | +input: ["text", "image"], |
| 200 | +cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, |
| 201 | +contextWindow: OPENAI_CODEX_GPT_55_NATIVE_CONTEXT_TOKENS, |
| 202 | +contextTokens: OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS, |
| 203 | +maxTokens: OPENAI_CODEX_GPT_54_MAX_TOKENS, |
| 204 | +} as ProviderRuntimeModel) |
| 205 | +); |
189 | 206 | } |
190 | 207 | |
191 | 208 | let templateIds: readonly string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -233,7 +233,22 @@ function buildDynamicModel(
|
233 | 233 | if (lower === "gpt-5.5") { |
234 | 234 | return ( |
235 | 235 | (params.modelRegistry.find("openai-codex", modelId) as ResolvedModelLike | null) ?? |
236 | | -undefined |
| 236 | +cloneTemplate( |
| 237 | +undefined, |
| 238 | +modelId, |
| 239 | +{ |
| 240 | +provider: "openai-codex", |
| 241 | +api: "openai-codex-responses", |
| 242 | +baseUrl: OPENAI_CODEX_BASE_URL, |
| 243 | +reasoning: true, |
| 244 | +input: ["text", "image"], |
| 245 | +cost: OPENROUTER_FALLBACK_COST, |
| 246 | +contextWindow: 1_000_000, |
| 247 | +contextTokens: 272_000, |
| 248 | +maxTokens: 128_000, |
| 249 | +}, |
| 250 | +{}, |
| 251 | +) |
237 | 252 | ); |
238 | 253 | } |
239 | 254 | const template = |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1145,6 +1145,23 @@ describe("resolveModel", () => {
|
1145 | 1145 | }); |
1146 | 1146 | }); |
1147 | 1147 | |
| 1148 | +it("resolves openai-codex gpt-5.5 even when discovery omits the OAuth catalog row", () => { |
| 1149 | +const result = resolveModelForTest("openai-codex", "gpt-5.5"); |
| 1150 | + |
| 1151 | +expect(result.error).toBeUndefined(); |
| 1152 | +expect(result.model).toMatchObject({ |
| 1153 | +provider: "openai-codex", |
| 1154 | +id: "gpt-5.5", |
| 1155 | +api: "openai-codex-responses", |
| 1156 | +baseUrl: "https://chatgpt.com/backend-api", |
| 1157 | +reasoning: true, |
| 1158 | +input: ["text", "image"], |
| 1159 | +contextWindow: 1_000_000, |
| 1160 | +contextTokens: 272_000, |
| 1161 | +maxTokens: 128_000, |
| 1162 | +}); |
| 1163 | +}); |
| 1164 | + |
1148 | 1165 | it("preserves unmarked manual openai-codex metadata overrides", () => { |
1149 | 1166 | mockDiscoveredModel(discoverModels, { |
1150 | 1167 | provider: "openai-codex", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。