GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): add OmniRoute custom provider support by MohammadMD1383 · Pull Request #32170 · anomalyco/opencode

Conversation

@MohammadMD1383

@MohammadMD1383 MohammadMD1383 commented Jun 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

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

What does this PR do?

Adds OmniRoute as a supported custom provider. OmniRoute is a gateway that connects to any OpenAI-compatible endpoint and dynamically discovers models via /v1/models.

When a user runs opencode auth login and selects OmniRoute, they're prompted for the endpoint URL and an optional API key. The provider then fetches the model list from the endpoint and makes them available for chat.

Key implementation details:

  • Registered as a well-known ProviderV2.ID with a static entry in the provider database
  • Auth plugin prompts for endpoint URL and API key; SDK plugin loads @ai-sdk/openai-compatible
  • The custom loader normalizes the base URL (strips trailing /v1 to prevent double-prefix in the discovery path)
  • Model discovery fetches GET ${baseURL}/v1/models — sends Authorization: Bearer header only when an API key was provided, skips it otherwise for unauthenticated endpoints
  • Maps the response to internal Model format with sensible defaults (128K context, 4K output) when fields are missing
  • 13 contract tests covering model mapping, defaults, deduplication, error handling, and integration

How did you verify your code works?

  • bun typecheck passes across all packages
  • All 13 new tests in packages/opencode/test/provider/omniroute.test.ts pass
  • Manually tested against a live OmniRoute instance: ran opencode auth login, entered endpoint URL and API key, verified models appeared in the provider list and model selection dialog

Screenshots / recordings

N/A — provider-only change, no UI modifications

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MohammadMD1383
implemented omniroute support
37e96d7
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found several related PRs that involve gateway/proxy providers and auto-discovery mechanisms:

Potentially Related PRs:

  1. #19959 - "feat(opencode): add local server provider with auto model discovery"

    • Similar: Implements auto-discovery of models from a local server endpoint
  2. #27554 - "feat(opencode): local LAN provider discovery + auto-discover models"

    • Similar: Adds local LAN provider support with auto model discovery
  3. #14468 - "feat(opencode): add LiteLLM provider with auto model discovery"

    • Similar: Implements a provider with dynamic model discovery from an external service
  4. #28387 - "feat(provider): add Aperture gateway provider"

    • Similar: Adds support for a gateway provider (similar architecture to OmniRoute)
  5. #32052 - "fix(provider): pass apiKey to createUnified for Cloudflare AI Gateway"

    • Similar: Handles API key authentication for gateway providers

These PRs share similar patterns: gateway/proxy support, dynamic model discovery, and OpenAI-compatible endpoints. You may want to review them for consistency in implementation approach and whether any overlapping functionality should be consolidated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MohammadMD1383 added 2 commits June 13, 2026 12:40
@MohammadMD1383
Merge branch 'dev' into feat/omniroute-provider
ec75df6
@MohammadMD1383
Merge branch 'dev' into feat/omniroute-provider
9913791
This was referenced Jun 14, 2026
feat(provider): auto-discover models from custom OpenAI-compatible pr… #32344
Closed
feat(opencode): auto-discover models from OpenAI-compatible providers #32731
Closed
@MohammadMD1383 MohammadMD1383 closed this by deleting the head repository Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MohammadMD1383
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.