Skip to content

fix(opencode): drop skills emission to avoid provider 400 errors - #8

Merged
S1933 merged 1 commit into
mainfrom
fix/opencode-drop-skills-emission
Jul 13, 2026
Merged

fix(opencode): drop skills emission to avoid provider 400 errors#8
S1933 merged 1 commit into
mainfrom
fix/opencode-drop-skills-emission

Conversation

@S1933

@S1933 S1933 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

OpenCode v1.x does not recognize skills as an agent field; the CLI forwards unknown top-level options to the LLM provider as payload fields. Strict providers (Pydantic additionalProperties: false, e.g. GLM-5.2) reject them with HTTP 400 Extra inputs are not permitted, which made every OpenCode-backed agent with a pivot agents[].skills binding unusable from providers with strict schemas.

Stop emitting skills from the OpenCode agent fragment. The pivot field is still consumed by the Claude Code adapter (frontmatter) and the Codex adapter (instruction hint). OpenCode agents are expected to reference their skills from the prompt body (e.g. an ## Available skills section) or rely on the opencode skill tool at runtime.

Tested:

  • TestGenerateAgent, TestGenerateAgentSkills, TestGoldenOpenCodeJSON updated to assert the key is absent
  • TestEndToEnd_SkillsRoundTrip updated to assert the OpenCode build agent has no skills key (Claude and native-only legacy-helper paths still validated)
  • Golden file (expected_opencode.json) and init bootstrap fixture updated
  • Docs (README, docs/SKILLS.md, docs/prd/shenron.md D9 + FR11) updated to describe the new policy

Summary by CodeRabbit

  • Documentation

    • Clarified how per-agent skills are handled across Claude Code, Codex, and OpenCode.
    • Documented that OpenCode configurations omit the skills field, while Claude Code and Codex receive skill bindings through supported formats.
    • Updated installation and skill-binding guidance to reflect current behavior.
  • Bug Fixes

    • Prevented unsupported skill fields from being included in OpenCode agent configurations, avoiding provider validation errors.

OpenCode v1.x does not recognize `skills` as an agent field; the CLI
forwards unknown top-level options to the LLM provider as payload fields.
Strict providers (Pydantic `additionalProperties: false`, e.g. GLM-5.2)
reject them with HTTP 400 `Extra inputs are not permitted`, which made
every OpenCode-backed agent with a pivot `agents[].skills` binding
unusable from providers with strict schemas.

Stop emitting `skills` from the OpenCode agent fragment. The pivot field
is still consumed by the Claude Code adapter (frontmatter) and the Codex
adapter (instruction hint). OpenCode agents are expected to reference
their skills from the prompt body (e.g. an `## Available skills` section)
or rely on the opencode `skill` tool at runtime.

Tested:
- TestGenerateAgent, TestGenerateAgentSkills, TestGoldenOpenCodeJSON
  updated to assert the key is absent
- TestEndToEnd_SkillsRoundTrip updated to assert the OpenCode build agent
  has no `skills` key (Claude and native-only `legacy-helper` paths
  still validated)
- Golden file (expected_opencode.json) and init bootstrap fixture updated
- Docs (README, docs/SKILLS.md, docs/prd/shenron.md D9 + FR11) updated
  to describe the new policy
@S1933
S1933 merged commit 92c19a0 into main Jul 13, 2026
0 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 819c62c6-fa38-4285-8fa6-2f90ee4e6fc7

📥 Commits

Reviewing files that changed from the base of the PR and between 97825fe and 0dcd5b3.

📒 Files selected for processing (8)
  • README.md
  • docs/SKILLS.md
  • docs/prd/shenron.md
  • internal/adapter/opencode/adapter_test.go
  • internal/adapter/opencode/agent.go
  • internal/adapter/opencode/testdata/expected_opencode.json
  • internal/cli/testdata/init/opencode/opencode.json
  • internal/integration_test.go

📝 Walkthrough

Walkthrough

The change removes per-agent skills from generated OpenCode agents, updates adapter fixtures and tests, and documents that Claude Code and Codex retain skill metadata through their respective output formats.

Changes

OpenCode skill handling

Layer / File(s) Summary
Skill emission contract
README.md, docs/SKILLS.md, docs/prd/shenron.md
Documentation specifies Claude Code frontmatter and Codex instructions for skills, while OpenCode output omits the skills key because strict providers may reject it.
OpenCode generation and validation
internal/adapter/opencode/agent.go, internal/adapter/opencode/adapter_test.go, internal/adapter/opencode/testdata/..., internal/cli/testdata/..., internal/integration_test.go
OpenCode agent generation no longer emits agent.Skills; fixtures and adapter/integration tests now require the key to be absent.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/opencode-drop-skills-emission

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant