@@ -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 *
@@ -343,6 +344,31 @@ export const opencodeGoModels: Record<string, ModelInfo> = {
343344 description :
344345 "DeepSeek-V4-Pro-0813 is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. Available via the Opencode Go plan." ,
345346 } ,
347+ // --- OpenAI Responses ---
348+ // Luna is curated here because the Go gateway's model catalogue does not
349+ // currently provide its capability metadata. These values intentionally
350+ // describe the Go Responses route, not the OpenAI-native or Codex routes.
351+ "gpt-5.6-luna" : {
352+ maxTokens : 128_000 ,
353+ contextWindow : 1_050_000 ,
354+ supportsImages : true ,
355+ supportsPromptCache : true ,
356+ supportsReasoningEffort : [ "none" , "low" , "medium" , "high" , "xhigh" , "max" ] ,
357+ reasoningEffort : "medium" ,
358+ inputPrice : 0.2 ,
359+ outputPrice : 1.2 ,
360+ cacheWritesPrice : 0.25 ,
361+ cacheReadsPrice : 0.02 ,
362+ longContextPricing : {
363+ thresholdTokens : 272_000 ,
364+ inputPriceMultiplier : 2 ,
365+ outputPriceMultiplier : 1.5 ,
366+ cacheWritesPriceMultiplier : 2 ,
367+ cacheReadsPriceMultiplier : 2 ,
368+ } ,
369+ description : "GPT-5.6 Luna via the OpenCode Go Responses API." ,
370+ } ,
371+
346372 "deepseek-v4-flash" : {
347373 maxTokens : 384_000 ,
348374 contextWindow : 1_000_000 ,
@@ -388,16 +414,48 @@ export const OPENCODE_GO_ANTHROPIC_FORMAT_MODELS = new Set<string>([
388414 "minimax-m2.5" ,
389415] )
390416
417+ /**
418+ * OpenCode Go models that must be requested via the OpenAI Responses API
419+ * (`/v1/responses`), not the OpenAI-compatible Chat Completions endpoint
420+ * (`/v1/chat/completions`).
421+ *
422+ * The Go gateway maps every model to exactly one wire format. Some models
423+ * (currently only `gpt-5.6-luna`) are Responses-only and are also explicitly
424+ * curated in `opencodeGoModels`: the gateway's
425+ * `/v1/chat/completions` adapter for them fails with an opaque HTTP 500
426+ * (`{"type":"error","error":{"type":"error","message":"Internal server error"}}`),
427+ * while `/v1/responses` succeeds (Zoo-Code-Org/Zoo-Code#1431).
428+ *
429+ * Drive routing from this set rather than from the model ID string so the
430+ * gateway's protocol contract stays explicit, testable, and easy to extend
431+ * when the next Responses-only model lands. Unknown model IDs default to the
432+ * OpenAI-compatible chat completions format.
433+ */
434+ export const OPENCODE_GO_RESPONSES_FORMAT_MODELS = new Set < string > ( [
435+ // --- OpenAI ---
436+ "gpt-5.6-luna" ,
437+ ] )
438+
391439/**
392440 * Returns `true` when the given Go-plan model ID must be requested via the
393441 * 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.
442+ * chat completions format. Unknown model IDs default to the OpenAI-compatible
443+ * format, matching the gateway's default routing.
396444 */
397445export function isOpencodeGoAnthropicFormatModel ( modelId : string ) : boolean {
398446 return OPENCODE_GO_ANTHROPIC_FORMAT_MODELS . has ( modelId )
399447}
400448
449+ /**
450+ * Returns `true` when the given Go-plan model ID must be requested via the
451+ * OpenAI Responses API (`/v1/responses`) rather than the OpenAI-compatible
452+ * chat completions format. Unknown model IDs default to the OpenAI-compatible
453+ * format, matching the gateway's default routing.
454+ */
455+ export function isOpencodeGoResponsesFormatModel ( modelId : string ) : boolean {
456+ return OPENCODE_GO_RESPONSES_FORMAT_MODELS . has ( modelId )
457+ }
458+
401459/**
402460 * Returns the native {@link ModelInfo} for a Go-plan model ID, or `undefined`
403461 * when the ID is not part of the curated registry. Callers should fall back to
0 commit comments