@@ -34,10 +34,11 @@ export const OPENCODE_GO_DEFAULT_TEMPERATURE = 0
3434 * This registry encodes the native capabilities of each curated Go model,
3535 * sourced from the same vendor specs used by the dedicated providers
3636 * (zai/moonshot/mimo/minimax/deepseek/qwen) and the Go pricing table at
37- * https://opencode.ai/docs/go/#usage-limits. The fetcher merges the live
38- * `/models` payload on top of these defaults so that context-window and
39- * max-token values stay in sync with the gateway while capability flags and
40- * pricing remain correct.
37+ * https://opencode.ai/docs/go/#usage-limits. It also includes explicitly
38+ * curated Responses-format models whose gateway metadata is not available
39+ * through `/models`. The fetcher merges the live `/models` payload on top of
40+ * these defaults so that context-window and max-token values stay in sync
41+ * with the gateway while capability flags and pricing remain correct.
4142 *
4243 * `supportsPromptCache` has two distinct meanings depending on the wire format:
4344 *
@@ -358,6 +359,30 @@ export const opencodeGoModels: Record<string, ModelInfo> = {
358359 description :
359360 "DeepSeek-V4-Flash is DeepSeek's fast, cost-efficient V4 model supporting thinking and non-thinking modes. Available via the Opencode Go plan." ,
360361 } ,
362+ // --- OpenAI Responses ---
363+ // Luna is curated here because the Go gateway's model catalogue does not
364+ // currently provide its capability metadata. These values intentionally
365+ // describe the Go Responses route, not the OpenAI-native or Codex routes.
366+ "gpt-5.6-luna" : {
367+ maxTokens : 128_000 ,
368+ contextWindow : 1_050_000 ,
369+ supportsImages : true ,
370+ supportsPromptCache : true ,
371+ supportsReasoningEffort : [ "none" , "low" , "medium" , "high" , "xhigh" , "max" ] ,
372+ reasoningEffort : "medium" ,
373+ inputPrice : 0.2 ,
374+ outputPrice : 1.2 ,
375+ cacheWritesPrice : 0.25 ,
376+ cacheReadsPrice : 0.02 ,
377+ longContextPricing : {
378+ thresholdTokens : 272_000 ,
379+ inputPriceMultiplier : 2 ,
380+ outputPriceMultiplier : 1.5 ,
381+ cacheWritesPriceMultiplier : 2 ,
382+ cacheReadsPriceMultiplier : 2 ,
383+ } ,
384+ description : "GPT-5.6 Luna via the OpenCode Go Responses API." ,
385+ } ,
361386}
362387
363388/**
@@ -388,16 +413,48 @@ export const OPENCODE_GO_ANTHROPIC_FORMAT_MODELS = new Set<string>([
388413 "minimax-m2.5" ,
389414] )
390415
416+ /**
417+ * OpenCode Go models that must be requested via the OpenAI Responses API
418+ * (`/v1/responses`), not the OpenAI-compatible Chat Completions endpoint
419+ * (`/v1/chat/completions`).
420+ *
421+ * The Go gateway maps every model to exactly one wire format. Some models
422+ * (currently only `gpt-5.6-luna`) are Responses-only and are also explicitly
423+ * curated in `opencodeGoModels`: the gateway's
424+ * `/v1/chat/completions` adapter for them fails with an opaque HTTP 500
425+ * (`{"type":"error","error":{"type":"error","message":"Internal server error"}}`),
426+ * while `/v1/responses` succeeds (Zoo-Code-Org/Zoo-Code#1431).
427+ *
428+ * Drive routing from this set rather than from the model ID string so the
429+ * gateway's protocol contract stays explicit, testable, and easy to extend
430+ * when the next Responses-only model lands. Unknown model IDs default to the
431+ * OpenAI-compatible chat completions format.
432+ */
433+ export const OPENCODE_GO_RESPONSES_FORMAT_MODELS = new Set < string > ( [
434+ // --- OpenAI ---
435+ "gpt-5.6-luna" ,
436+ ] )
437+
391438/**
392439 * Returns `true` when the given Go-plan model ID must be requested via the
393440 * Anthropic Messages format (`/v1/messages`) rather than the OpenAI-compatible
394- * chat completions format. Unknown (non-curated) model IDs default to the
395- * OpenAI-compatible format, matching the gateway's default routing.
441+ * chat completions format. Unknown model IDs default to the OpenAI-compatible
442+ * format, matching the gateway's default routing.
396443 */
397444export function isOpencodeGoAnthropicFormatModel ( modelId : string ) : boolean {
398445 return OPENCODE_GO_ANTHROPIC_FORMAT_MODELS . has ( modelId )
399446}
400447
448+ /**
449+ * Returns `true` when the given Go-plan model ID must be requested via the
450+ * OpenAI Responses API (`/v1/responses`) rather than the OpenAI-compatible
451+ * chat completions format. Unknown model IDs default to the OpenAI-compatible
452+ * format, matching the gateway's default routing.
453+ */
454+ export function isOpencodeGoResponsesFormatModel ( modelId : string ) : boolean {
455+ return OPENCODE_GO_RESPONSES_FORMAT_MODELS . has ( modelId )
456+ }
457+
401458/**
402459 * Returns the native {@link ModelInfo} for a Go-plan model ID, or `undefined`
403460 * when the ID is not part of the curated registry. Callers should fall back to
0 commit comments