anomalyco / anomalyco/opencode

Console Go -> Meta: sanitize recursive $ref tool schemas (Codex Desktop codex_app tools hit it too)

Open
#48,151 1 comment 0 reactions 1 assignee View on GitHub

@MrMushrooooom is already working on this.

Since Sep 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

What

Muse Spark 1.3 Contributor via OpenCode Go (endpoint https://opencode.ai/zen/go/v1/responses) fails on the FIRST request, before any tool executes, when the client sends a recursive tool schema:

Error from provider (Console Go): Upstream request failed: [invalid_request_error] Recursive JSON schemas are not currently supported

Meta returns HTTP 400 for recursive schemas (https://ai.developer.meta.com/docs/features/structured-output).

Relation to #45800

Same error class as #45800 (postgres MCP $defs/__schema0 self-ref broke Muse 1.2). This report shows it's not MCP-specific: Codex Desktop's built-in app tools (codex_app MCP: automation_update, create_thread, send_message_to_thread, fork_thread, handoff_thread) trigger it too. Proven by elimination: same codex binary (0.153.4), same config/model/provider succeeds via codex exec (no Desktop-only tools) and fails in Desktop (with them). OpenAI-side report: openai/codex#44144.

Ask

Apply recursive-$ref sanitization Meta-bound in the provider transform layer (the approach from unmerged #29295 - inline local $refs, replace cycles with permissive {} - or the merged #16910 fallback {type:object, additionalProperties:true}), so one strict upstream doesn't break every tool-heavy client. transform.ts currently has sanitizers for OpenAI/Moonshot/Gemini but nothing Meta/Muse-shaped.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.