Conversation
Declare modelDiscoveryMode on provider capabilities so listing, Settings pickers, imports, and diagnostics stop treating GET /models as universal. Fixes OpenCoworkAI#210
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Provider model discovery still mostly assumed a listing endpoint, even though real providers split into GET
/models, a static catalog, manual IDs, inference-only gateways, and imports with a single known default. This adds a formalmodelDiscoveryModeand drives listing, Settings pickers, import defaults, connection tests, and diagnostics from it so “no/models” is no longer a uniform hard failure.Fixes #210
Mode enum:
models|static-hint|manual|infer-onlymodels:v1:list-for-providermodels/models/models; 404 + working inference staysdegradedstatic-hintmodelsHint+defaultModel/models(ChatGPT Codex OAuth still uses its existing token check)manual[defaultModel]locally/models, probe inference →compatibleinfer-only/models; missing listing is expected, not degradedBuilt-in / import defaults:
modelsstatic-hintapi.anthropic.com→models; custom/proxy base →infer-onlymodelsinfer-onlymodels; listing failed →infer-only; user chose manual →manualIndependent of sibling PRs #419 / #420 / #421; additive types only.
Type of change
Linked issue
Fixes #210
Checklist
pnpm lint && pnpm typecheck && pnpm testpasses locallypnpm changeset) if user-visiblePrinciples 5b
supportsModelsEndpoint/modelsHintstill work;modelDiscoveryModeis optional on disk and older configs derive a modeschemaVersionunchanged; Zod accepts the new optional capability field and locksteps it with listingTests
Cover mode helpers,
list-for-providerplans, infer-only/manual connection tests (skip/models, success iscompatible), Settings picker state, parser payloads, builtin/import stamps, and diagnostics that treat listing 404 as info when the mode does not expect/models.Screenshots / recordings (UI changes)
Settings picker and custom-provider test copy changed. This environment cannot drive the Electron Settings UI, so those flows were verified with unit tests rather than a live click-through.