fix(agents): fix reasoning model routing for gpt-5.4 and gpt-5.5#347
Conversation
|
|
||
| // Responses API (/v1/responses) supports reasoningSummary and must not have it stripped. | ||
| // Chat Completions (/v1/chat/completions) and any other path use the restricted set. | ||
| const isResponsesApi = context.url?.includes('/v1/responses') || context.url === '/responses'; |
There was a problem hiding this comment.
context.url is assigned directly from req.url — the /v1 prefix is never stripped, so the second condition (=== '/responses') is dead code. The first condition (includes) is a substring match and would
incorrectly treat /v1/responses/stream as a Responses API request. Fix: context.url === '/v1/responses'
| } | ||
| }, | ||
|
|
||
| 'gpt-5.4': { |
There was a problem hiding this comment.
'gpt-5.4': { cost: { input: 1.75, output: 14, cache_read: 0.175 }, ... }
'gpt-5.4-2026-03-05': { cost: { input: 1.75, output: 14, cache_read: 0.175 }, ... }
These four config blocks are nearly identical only id, name, and displayName differ. If pricing changes, it needs to be updated in multiple places and it's easy to miss one. maybe worth extracting shared fields into a base object?
|
Approved |
Summary
Adds gpt-5.5 model support with correct routing to OpenAI Responses API and consolidates Responses API model detection into a single source of truth.
Changes
gpt-5.5andgpt-5.5-2026-04-24static entries withuse_responses_api: trueinopencode-model-configs.tsRESPONSES_API_MODEL_PATTERNSandisResponsesApiModel()fromopencode-dynamic-models.tstoopencode-model-configs.ts(single source of truth)getModelConfig()fallback to applyisResponsesApiModel()so unknown future models are auto-routed correctlyopencode-dynamic-models.tsImpact
Before: gpt-5.5 was routed to
/v1/chat/completions— no reasoning output, tool calls crashed withreasoning_effort not supportederror.After: gpt-5.5 routes to
/v1/responses— reasoning blocks visible in CLI, tool calls work correctly.Checklist