Skip to content

[Bug]: opencode + Muse Spark 1.3 Contributor fails in Synara with Recursive JSON schemas not supported #957

Closed

Description

@alexfoxtm

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. macOS Apple Silicon, Synara desktop 0.8.1, opencode 1.18.27 (opencode --version verified), opencode provider enabled with default binary path.
  2. opencode auth has opencode-go subscription; model selected: opencode-go/muse-spark-1.3-contributor (free contributor). Same failure on muse-spark-1.2-contributor.
  3. Start any task via Synara using opencode runtime (e.g. cwd /Users/AleksandrSlobodanyuk/Projects/Current/mj/opsarmor.net).
  4. Send any prompt (even Hello). First request fails before any tool executes.

Expected behavior

Request succeeds — same model works fine in opencode TUI directly outside Synara, and other models (e.g. opencode-go/qwen3.8-flash) work fine inside Synara.

Actual behavior

Immediate failure:

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

Thread title generation also fails for the same model. 15 occurrences in opencode log. This is a Synara-side issue: Synara gateway MCP tools injected into opencode sessions likely contain recursive $ref schemas that Meta Model API explicitly rejects (https://ai.developer.meta.com/docs/features/structured-output/).

Impact

Blocks work completely

Muse Spark 1.2/1.3 via opencode-go is completely unusable inside Synara. No workaround except switching model or leaving Synara.

Version or commit

Synara 0.8.1

Environment

macOS 26 (Apple Silicon arm64), Synara desktop 0.8.1, opencode 1.18.27, provider opencode, model opencode-go/muse-spark-1.3-contributor (Console Go subscription). Global opencode.json has only 1password MCP (disabled), no project-level opencode.json in failing project.

Logs or stack traces

# ~/.local/share/opencode/log/opencode.log
stream providerID=opencode-go modelID=muse-spark-1.3-contributor error.error="AI_APICallError: Error from provider (Console Go): Upstream request failed: [invalid_request_error] Recursive JSON schemas are not currently supported"
stream providerID=opencode-go modelID=muse-spark-1.2-contributor ... same error
stream providerID=opencode-go modelID=qwen3.8-flash ... success (step=1, exiting loop)

# ~/.synara/userdata/logs/server.log
provider command reactor failed to generate thread title ... threadModel: opencode-go/muse-spark-1.3-contributor ... Text generation failed in generateThreadTitle

Synara gateway proxy in play: ~/.synara/userdata/agent-gateway-mcp-proxy.mjs (SYNARA_AGENT_GATEWAY_URL). Extra Synara task-coordination tools are only present in Synara-driven sessions, explaining TUI-ok vs Synara-fail difference. Suspected recursive $ref in gateway tools/list response, analogous to opencode issues anomalyco/opencode#45800 (postgres) and #45823 (housecarl).

Request: sanitize/desanitize gateway tool schemas (inline local $refs, replace recursive refs with permissive {} or {type:object, additionalProperties:true}) or expose option to disable Synara gateway tools per-task for strict providers like Muse Spark.

Workaround

Switch Synara task to qwen3.8-flash, or run muse-spark-1.3-contributor directly in opencode TUI outside Synara.

Activity

  1. alexfoxtm commented on Sep 7, 2026

    @alexfoxtm
    Author

    Verified fixed on Synara 0.8.3 (stock, Developer ID signed). The local MCP sanitize proxy / asar patch is no longer in the path.

    Root cause was agent-gateway tools/list serving recursive $ref tool schemas; Console Go / Muse Spark rejects those with Recursive JSON schemas are not currently supported. Same model works in opencode TUI without Synara gateway tools.

    Fix is #931 (sanitizeToolInputSchema at serve time: inline acyclic #/$defs refs, replace cycles with a permissive object). Present in the 0.8.3 asar.

    Reproduction on this machine with Muse Spark 1.3 Contributor (opencode-go/muse-spark-1.3-contributor):

    • MCP tools/list with a cyclic $ref schema → same 400 as originally reported
    • identical schema after the 0.8.3 sanitizer → request succeeds (pong)
    • last real recursive error in local opencode.log was 2026-09-04 (pre-0.8.3)

    Closing as completed by 0.8.2/#931, confirmed on 0.8.3.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions