Skip to content

fix(config): support legacy skills array#22120

Open
kobecai wants to merge 2 commits intoanomalyco:devfrom
kobecai:fix-22040-legacy-skills-config
Open

fix(config): support legacy skills array#22120
kobecai wants to merge 2 commits intoanomalyco:devfrom
kobecai:fix-22040-legacy-skills-config

Conversation

@kobecai
Copy link
Copy Markdown

@kobecai kobecai commented Apr 12, 2026

Issue for this PR

Closes #22040

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This fixes startup/config validation when opencode.json contains the older skills array format.
Before this change, a config like:

{
  "skills": [
    {
      "name": "test",
      "description": "Test skill",
      "command": "echo test"
    }
  ]
}
would fail with Invalid input: expected object, received array.
I changed config parsing so skills accepts both the current object format (paths / urls) and the legacy inline array format. I also updated skill loading
so legacy inline entries are still loaded into the skill registry instead of only avoiding the validation error.

This should fix the reported issue because the failure was happening at config schema validation time, and after that the legacy entries still need to be
surfaced as skills to preserve behavior.

### How did you verify your code works?

Ran these locally from packages/opencode:

bun test test/config/config.test.ts test/skill/skill.test.ts
bun typecheck

I also reproduced the issue first with a minimal opencode.json using the legacy skills array and confirmed it failed before the change.

### Screenshots / recordings

N/A

### Checklist

- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR

@Arsalankhan315
Copy link
Copy Markdown

Arsalankhan315 commented Apr 12, 2026 via email

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.

Invalid input: expected object, received array skills

2 participants