Repository navigation
Description
Request
Please provide a model-discovery path that does not initialize authentication-dependent plugins or resolve/refresh credentials.
This is a source-inspected feature request for OpenCode v2.2.6, not a live reproduction. I did not run a credential-refresh probe or inspect any real credential values. In particular, I am not claiming that OpenCode implements omp's !command API-key syntax or reproduces that separate command-execution behavior.
Source path
- The
modelsCLI handler resolves a server connection and callsclient.model.listfor the current directory. Server connection resolution can start a service or standalone server. - The
model.listserver handler waits forawaitPluginsbefore returning model metadata. - The OpenAI plugin calls
activeCredentialduring initialization (yield* load()at line 259). activeCredentialcallsctx.integration.connection.resolve.Integration.connection.resolverefreshes a stored OAuth credential when a refresh implementation exists and the credential expires within five minutes. The refresh call is at line 724.
This suggests that model discovery in a cold location can enter an OAuth-refresh path as part of plugin initialization. It does not imply every listing refreshes authentication: the active connection, credential type/expiry, and whether initialization has already happened matter.
Separately, configuration substitution expands environment/file references, so ordinary configuration loading is also not a credential-free metadata operation.
Why it matters
Passive inventory and routing tools need to enumerate models without changing authentication state, contacting a token endpoint, or materializing credentials merely to inspect metadata. A known/configured model catalog is useful even when authentication and inference readiness remain unverified.
Desired behavior
An explicit metadata-only command or API should:
- Return known/configured model metadata without resolving credential values, reading secret-backed references, or refreshing OAuth credentials.
- Avoid authentication-dependent plugin initialization, or offer plugins an explicitly non-authenticating discovery interface.
- Emit no secret values and distinguish catalog/configuration presence from authenticated availability.
- Preserve existing authentication behavior for deliberate inference and other operations that need it.
Suggested regression coverage: instrument the OAuth refresh implementation and credential resolver, then enumerate models in a cold location with an expiring synthetic credential. The metadata-only path should invoke neither. No real credentials or token endpoints are needed.
Targeted issue and PR searches on 2026-11-07 found no matching request.
Activity
opencodejr commentedon Nov 7, 2026
Thanks for the detailed write-up, @djbclark. You're asking for a metadata-only way to list models: one that returns the catalog and configured models without starting credential-dependent plugins and without resolving or refreshing credentials. It should also make clear that a model appearing in the catalog doesn't mean it's authenticated and ready to use.
I checked this against the current code.
model.listwaits for all plugins to finish loading before it returns, and provider plugins such as OpenAI resolve the active connection while they load, so a token close to expiry can be refreshed at that point. This works as designed today, so I'm treating it as a feature request. It can't be built as a plugin, because the wait happens in the server before any plugin code runs. Maintainers will consider it.Related issues:
/modelsendpoints