Skip to content

oma link opencode generates invalid OpenCode config #571

@Melivo

Description

@Melivo

Summary

oma link opencode generates an invalid OpenCode project configuration for OpenCode 1.17.8.

Symptoms

After running oma link opencode, OpenCode fails to bootstrap the project with:

Failed to finish bootstrap instance Error: ConfigInvalidError

Root Cause

Two issues were observed:

  1. The generated .opencode/agents/*.md files contain:
tools: []

OpenCode's current config schema does not accept tools as an array in agent frontmatter. This causes ConfigInvalidError.

  1. oma link opencode copies the plugin bridge to:
.opencode/plugins/oma/oma.ts

but does not register it in .opencode/opencode.jsonc. On OpenCode 1.17.8, the plugin was not auto-discovered; opencode debug info reported:

plugins:
none

Expected Behavior

oma link opencode should generate OpenCode-compatible config:

  • Omit invalid tools: [] from generated OpenCode agent frontmatter.
  • Explicitly register the local plugin in .opencode/opencode.jsonc, for example:
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["./plugins/oma/oma.ts"]
}

Verification

After removing tools: [] and adding the explicit plugin registration:

opencode debug config --print-logs --log-level DEBUG
opencode debug info --print-logs --log-level DEBUG

both succeed, and opencode debug info lists:

file:///.../.opencode/plugins/oma/oma.ts

A local patch was also validated with the targeted test suites:

bunx vitest run platform/agent-composer.test.ts __tests__/opencode-plugin.test.ts

Result: 2 test files passed, 39 tests passed.

Environment

  • oh-my-agent: 10.3.2
  • OpenCode: 1.17.8
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions