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 #6231 - automatic discovery of models from providers by jakubsuchy · Pull Request #39176 · anomalyco/opencode

Conversation

@jakubsuchy

@jakubsuchy jakubsuchy commented Jul 27, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #6231

Type of change

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

What does this PR do?

Fixes issue #6231 to provide a generic way that providers can pull /v1/models, and therefore automatically update their model list at any time.

Updates documentation with information how providers can use this functionality

How did you verify your code works?

Testing + Automated testing

Screenshots / recordings

none

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.

sgayda2 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Jakub Suchy and others added 2 commits July 22, 2026 21:15
Jakub Suchy
Refactors existing commits from issue anomalyco#6231 and adds a new w…
32fa969
…ay to enable model discovery on a provider. Model discovery is opt-in by provider, to provide backwards compatibility
@jakubsuchy
Merge branch 'anomalyco:dev' into dev
0b11dbd
@github-actions github-actions Bot added the needs:title label Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title Fixes #6231 - automatic discovery of models from providers doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Jul 27, 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 potentially related PRs that address similar model discovery functionality:

Most Relevant:

  • PR feat(opencode): auto-discover models from OpenAI-compatible providers #32731 - feat(opencode): auto-discover models from OpenAI-compatible providers - Directly addresses auto-discovery from OpenAI-compatible providers using their API endpoints
  • PR feat(opencode): local LAN provider discovery + auto-discover models #27554 - feat(opencode): local LAN provider discovery + auto-discover models - Implements both LAN provider discovery and auto-model discovery
  • PR feat(opencode): discover abacus models from /v1/models endpoint #34563 - feat(opencode): discover abacus models from /v1/models endpoint - Specifically implements discovery from the /v1/models endpoint

Related Features:

  • PR feat: discover Modal models #39066 - feat: discover Modal models - Recent PR with similar model discovery pattern
  • PR feat(opencode): add local server provider with auto model discovery #19959 - feat(opencode): add local server provider with auto model discovery - Earlier implementation of auto model discovery for local servers

These PRs are not exact duplicates of PR #39176, but they address overlapping concerns around automatic model discovery from various provider types. You may want to review these to ensure consistency in implementation approach and avoid duplicate logic.

All reactions

Sorry, something went wrong.

Uh oh!

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

@jakubsuchy jakubsuchy changed the title Fixes #6231 - automatic discovery of models from providers Feat #6231 - automatic discovery of models from providers Jul 27, 2026
@jakubsuchy
Merge branch 'dev' into dev
4ea5734
@github-actions github-actions Bot mentioned this pull request Jul 27, 2026
📊 AI CLI 工具社区动态日报 2026-07-28 litang9/big_model_radar#276
Open
@Hotragn

Hotragn commented Jul 28, 2026

Copy link
Copy Markdown

I implemented this same feature independently before I found your PR — yours is further along (docs, config schema, SDK types), so I'm standing down and would rather help this one land. Four things from digging through the earlier attempt in #8359 that I think are the actual blockers worth pre-empting:

  1. The new config options. @rekram1-node's notes there start with "ideally no extra config option" (comment), and that author dropped theirs in response — "1. No extra config option" (comment). This PR adds enable_model_discovery and disable_model_discovery, so it will probably hit the same objection. Your code comment has a fair rationale (it's an outbound request to a user-supplied URL) — might be worth making that argument up front, or keying off "provider is config-declared/authed" rather than a new flag.

  2. Union vs. filter. The same note asks discovery to remove models too: if models.dev lists N and the endpoint returns N-2, the missing 2 should be dropped as unsupported. Right now discovery only adds ids that aren't already known, so stale models.dev entries stick around. (My version had this same gap.)

  3. Timeout. AbortSignal.timeout(5_000) vs. the "1-3 sec tops" ask in that review. This runs on the provider-load path, so an unreachable endpoint adds the full delay to startup.

  4. Minor: discovered models that models.dev doesn't know get limit.context: 0 / limit.output: 0 via buildConfigModel(..., {}, ...). That's fine for config-declared models where the user omitted limits, but with discovery it becomes the common case — probably worth confirming nothing downstream (compaction/context math) depends on a real context limit.

Reusing buildConfigModel for discovered models is nicer than what I did (I hand-rolled a minimal Model) — this way anything models.dev already knows keeps its real metadata and variants.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Hotragn Hotragn mentioned this pull request Jul 28, 2026
Auto-discover models from OpenAI-compatible provider endpoints #6231
Closed
@jakubsuchy
Merge branch 'dev' into dev
9cf28da
@github-actions github-actions Bot mentioned this pull request Aug 7, 2026
feat(provider): discover local model context limits #41104
Closed
3 of 6 tasks
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot closed this Aug 28, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Aug 28, 2026
@ckuethe

ckuethe commented Aug 28, 2026

Copy link
Copy Markdown

it's still relevant because people have been asking for this for months or years

All reactions

Sorry, something went wrong.

Uh oh!

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

@Szwendacz99

Szwendacz99 commented Aug 28, 2026

Copy link
Copy Markdown

have anyone checked if this is available/working in opencode2/beta ? I even cannot tell/find where is source code of the beta
https://opencode.ai/v2/docs

All reactions

Sorry, something went wrong.

Uh oh!

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

@el-AI-wei el-AI-wei mentioned this pull request Sep 14, 2026
[FEATURE]: Add LiteLLM as a provider #48938
Closed
1 task done
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

automated-pr-cleanup needs:title

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Auto-discover models from OpenAI-compatible provider endpoints

Uh oh!

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

4 participants

@jakubsuchy @Hotragn @ckuethe @Szwendacz99
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.