anomalyco / anomalyco/opencode

acp: custom providers fail to load due to SchemaError(Missing key at ["path"]) on event subscription

Open
#49,630 0 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Sep 17, 2026.

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

Description

Summary

In opencode acp on versions 2.0.6 and 2.0.7, the internal event subscriber crashes with an unhandled schema error (SchemaError: Missing key at ["path"]) during startup. As a consequence, custom providers configured in user settings (opencode.jsonc) are never merged into the ACP session catalog, leaving only built-in fallback models (opencode/*) and causing ACP clients (such as Obsidian's Claudian) to fail with model not found.

Environment

  • opencode version: 2.0.6, 2.0.7 (works correctly on 2.0.3)
  • OS: macOS (Darwin 25.5.0, arm64)
  • Shell: /bin/zsh
  • Install: npm global (@opencode/cli)

Reproduction

  1. Configure custom models/providers under provider in ~/.config/opencode/opencode.jsonc.
  2. Start the ACP server:
    opencode acp --log-level all --print-logs
    
  3. Send standard JSON-RPC initialize followed by session/new with mcpServers: [].
  4. Inspect the returned configOptions for model and review stderr logs.

Expected Behavior

session/new options should include custom models from opencode.jsonc, and incoming location events (provider.updated, model.updated) should be decoded without schema errors.

Actual Behavior

During boot, right after event.type=command.updated, the CLI process encounters an unhandled rejection:

level=ERROR message="unhandled rejection" cause="SchemaError(Missing key at [\"path\"])" role=cli

Because of this rejection, ACP caches only the initial fallback models (opencode/union-alpha, etc.). Requesting any custom model via session/set_config_option fails with:

{
  "code": -32602,
  "message": "Invalid params: model not found: <custom-provider>/<model>"
}

Additional Context

  • Tested in an isolated sandbox on version 2.0.3: custom providers load cleanly over ACP and session/set_config_option succeeds.
  • Tested on 2.0.6 and 2.0.7: both fail with the identical SchemaError stack.

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.