Repository navigation
feat(js/plugins/compat-oai): add gpt-6-astra to the OpenAI model catalog - #6303
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the new gpt-6-astra model to the OpenAI compatibility plugin, along with corresponding unit tests. Feedback highlights that the reasoning_effort configuration parameter is currently missing from the OpenAIChatCompletionConfigSchema, which will cause Zod to strip it during validation in real-world usage. Additionally, the value 'max' used in the tests is invalid; the schema and tests should be updated to support and use the valid OpenAI values: 'low', 'medium', or 'high'.
73fc540 to
b8d8157
Compare
b8d8157 to
c3e1269
Compare
gpt-6-astra fell through the default GPT heuristics, which advertised tools: true and media: false. Live runs against /v1/chat/completions (genkit-ai/genkit#6303) show the opposite: function tools are rejected with 400 at every accepted reasoning_effort, and none is itself rejected, so no value lets tools through. Image input, system role, multiturn, streaming and json_schema output work. Add a _Gpt6AstraModelCapabilities profile (tools false, media true, multiturn and systemRole true) matched by ^gpt-6-astra(?:-|$) so dated snapshots and suffixed variants get the same metadata. The request builder still forwards tools unconditionally; supports.tools is advisory for the Dev UI and model refs, as it is for every other model here. Add a reasoningEffort option (none, minimal, low, medium, high, xhigh) to OpenAIChatOptions and forward it as reasoning_effort through an explicit switch, so a value outside the enum fails with INVALID_ARGUMENT instead of reaching the API as the SDK's unknown sentinel. gpt-6-astra accepts low, medium, high and xhigh, and rejects none and max; it also rejects temperature other than 1 and top_p, which the plugin only sends when set. Tests pin the astra supports map for the bare id, a dated snapshot and a suffixed variant, that fine-tune ids keep the default profile, the option enum in the JSON schema, reasoning_effort on the wire, rejection of an unknown effort before any request, and that a default request carries no temperature, top_p or reasoning_effort while tools still reach the wire. No live smoke was run from Dart.
gpt-6-astra fell through the dynamic gpt-* path and was registered with default model info, so listActions and the Dev UI advertised tool support. Add an explicit catalog entry that declares tools: false. A live run against /v1/chat/completions rejected function tools for this model at every accepted reasoning_effort value with a 400 that points at /v1/responses, and reasoning_effort none was itself rejected, so no value lets tools through. This plugin only speaks Chat Completions. Core treats supports.tools as advisory in JS, so the entry changes what is advertised and warned about, not what is sent. Text, streaming, structured JSON output, image input, system role and multiturn worked live. The endpoint accepts reasoning_effort low, medium, high and xhigh only. Tests pin the catalog entry and the action metadata built from it.
c3e1269 to
cfdc708
Compare
adesinah
left a comment
There was a problem hiding this comment.
This looks good to me. One thing i noticed (non-blocking for this PR) is JS has no gpt-5.6 entries at all like the Go does, which means the curated lists are drifting apart across ecosystems.
|
Agreed on the gpt-5.6 drift; it is tracked in #5898 and out of scope here. |
gpt-6-astracurrently falls through the dynamicgpt-${string}path, so the registered action andlistActionscarry the default model info, and the Dev UI advertises tool support the model does not have on this endpoint. This adds an explicitgpt-6-astraref toSUPPORTED_GPT_MODELS, mirroring howgpt-5.5was added. Note thatopenAI.model('gpt-6-astra')still returns generic info; that helper never consults the catalog for any model, so only the registered action andlistActionschange here.The ref takes
GPT_5_MODEL_INFOwithtools: false. A live run against/v1/chat/completionswith a single function tool returned:The same error came back at
lowandxhigh, andreasoning_effort: 'none'was itself rejected (Supported values are: 'low', 'medium', 'high', and 'xhigh'). So no value lets tools through on this endpoint. The model page lists function calling as supported without an endpoint caveat, so this looks like a Chat Completions restriction that could lift; worth re-checking when the Responses API lands in JS. In JS, core treatssupports.toolsas advisory (a warning, tools still sent), so the entry changes what is advertised, not what is transmitted.Text, streaming, structured JSON output (
json_schemawithoutstrict), image input, system role, multiturn andmaxOutputTokensall worked live.Tests in
tests/openai_test.tspin the catalog entry and the action metadata produced from it.pnpm buildandpnpm testinjs/plugins/compat-oaipass (7 suites, 101 tests); prettier is clean.Caveats: the endpoint accepts
reasoning_effortlow,medium,highandxhighonly;maxandnoneare rejected.temperatureother than 1 andtop_pare rejected. The plugin only sends those when a caller sets them. No typedreasoningEffortconfig was added; the existing passthrough covers it. Go counterpart: #6304. Thegpt-5.6-sol/terra/lunafamily that Go carries is still missing from the JS catalog; see #5898.