Skip to content

Port provider registration to the OpenCode 2.0.22 plugin API - #7

Closed
HendrikPetertje wants to merge 2 commits into
NachoFLizaur:opencode-v2from
HendrikPetertje:fix/opencode-2.0.22
Closed

HendrikPetertje wants to merge 2 commits into
NachoFLizaur:opencode-v2from
HendrikPetertje:fix/opencode-2.0.22

Conversation

@HendrikPetertje

Copy link
Copy Markdown

Linked issue

I didn't open an issue, just this PR.

Type of change

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

What does this PR do?

OpenCode 2.0.22 removed context.catalog, so plugin setup crashed every time i open opencode v2.022. the error i got in the toast was:

undefined is not an object (evaluating 'context.catalog.transform')

what this change does it that it registers models through context.provider.transform/reload
Then it bumps the peer dep on opencode-ai(plugin from the dev version to the now released 2.0.22 version.

Test mocks are updated. same with docs.

How did you verify it?

  • npm test passes

  • Manual check (describe below)

  • Removed the beta 5 plugin from opencode plugins

  • Cloned a copy of my fork (that didn't have deps installed and all that) to .config/opencode/plugins/opencode-kiro

  • Ran a fresh npm ci && npm run build on that dir

  • Opened opencode, noticed that the error was gone and i was once again able to start new chats with my various Kiro models through kiro ACP.

Checklist

  • PR is focused and linked to an issue
  • npm test passes
  • npm run typecheck passes
  • README / docs updated if behavior changed

OpenCode 2.0.22 removed context.catalog, so plugin setup crashed with
"undefined is not an object (evaluating 'context.catalog.transform')".

- Register Kiro models through context.provider.transform/reload. Rich
  entries are intersected with the runtime list as before; otherwise the
  provider is added (or its models replaced) with only the models the
  runtime returns.
- Move the dev and peer dependency from @opencode-ai/[email protected]
  to @opencode/[email protected], and bump @opentui/solid to 0.5.14 to meet
  its peer floor.
- Update the test mocks to the ProviderEditor shape, and update the pin
  tables in README, docs/COMPATIBILITY and the beta.5 CHANGELOG section.
npm 12 prints an object keyed by package name instead of an array of
manifests, which made the packed-tarball tests crash with "object is
not iterable". Parse both shapes through a shared helper.
@HendrikPetertje

Copy link
Copy Markdown
Author

Just pulled your beta 7 down. it looks like you've managed to migrate the details that needed migrating to opencode v2 yourself. fantastic!

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