Skip to content

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

Open

Description

@mykhailoyermolenko

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.

Activity

  1. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Your report adds useful context (Codex Desktop built-in tools reproducing it, not just MCP tools), but the underlying bug and fix request are already tracked in those issues. Consider adding your findings as a comment there instead.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up and for narrowing it down to Codex Desktop's codex_app tools.

    The request is clear: Console Go would sanitize recursive $ref tool schemas (inline local refs, replace cycles with a permissive schema) before forwarding to Meta/Muse Spark, so that any client sending such schemas, not just OpenCode, keeps working. Since the failing client here is Codex calling https://opencode.ai/zen/go/v1/responses directly, a change in OpenCode's client-side transform.ts wouldn't help. This would have to be handled on the Go gateway. Meta documents that it doesn't support recursive schemas, so we're treating this as a feature request for the gateway. Maintainers will consider it.

    Related issues and PRs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions