Skip to content

feat(opencode): add KeiRouter plugin#32

Merged
mydisha merged 1 commit into
mydisha:mainfrom
bobbyunknown:feat/opencode-plugin
Jul 4, 2026
Merged

feat(opencode): add KeiRouter plugin#32
mydisha merged 1 commit into
mydisha:mainfrom
bobbyunknown:feat/opencode-plugin

Conversation

@bobbyunknown

Copy link
Copy Markdown
Contributor

What

Add a local OpenCode plugin package for KeiRouter model discovery.

Why

KeiRouter needs OpenCode integration without publishing to npm first. The plugin lets OpenCode fetch KeiRouter models from the local OpenAI-compatible /v1/models endpoint and cache them client-side.

How

  • Added @keirouter/opencode-plugin as a small standalone package.
  • Implements OpenCode auth, provider, and legacy config hooks.
  • Fetches only GET /v1/models with Bearer auth.
  • Adds in-memory TTL caching so repeated model lookups avoid extra network calls.
  • Uses KeiRouter default local URL: http://127.0.0.1:20180.
  • Added unit tests for URL handling, auth, model mapping, fetch behavior, and cache reuse.

Checklist

  • make test passes
  • make vet passes
  • npm run lint and npm run typecheck pass (if frontend changed)
  • Documentation updated (if applicable)
  • Config example updated (if applicable)

Additional verification:

  • npm test passes in @keirouter-opencode-plugin
  • npm run build passes in @keirouter-opencode-plugin
  • Live local fetch against KeiRouter /v1/models succeeds

@mydisha

mydisha commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thanks for the plugin contribution, will merge to main @bobbyunknown

@mydisha mydisha merged commit b0bcb80 into mydisha:main Jul 4, 2026
3 checks passed
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.

2 participants