Why this matters
Custom OpenAI-compatible providers force manual model ID entry. Server-side discovery from /v1/models (with safe errors) unblocks LiteLLM/LM Studio style setups.
Evidence
Tip 6247b448fa9c791c21c2373c222623871cdd6a0b (base dev):
- Live:
cd packages/opencode && bun test ./src/provider/discover.test.ts → 9/9 pass (auth, path preserve, env keys, 401, timeout, invalid URL/format)
- Evidence class: BEHAVIORAL
Invariant: discovery never replaces an existing /api/v1 path with a root /v1/models; failures stay typed rather than 500ing.
Ask (design, light) — prospective; non-blocking
- Should daily background re-discovery be opt-in for privacy-sensitive air-gapped hosts?
- Prefer config-hardcoded models always winning over discovered ids — any UI affordance when they diverge?
Fork mirror of a sealed OSS review draft. Not posted upstream.
Why this matters
Custom OpenAI-compatible providers force manual model ID entry. Server-side discovery from
/v1/models(with safe errors) unblocks LiteLLM/LM Studio style setups.Evidence
Tip
6247b448fa9c791c21c2373c222623871cdd6a0b(basedev):cd packages/opencode && bun test ./src/provider/discover.test.ts→ 9/9 pass (auth, path preserve, env keys, 401, timeout, invalid URL/format)Invariant: discovery never replaces an existing
/api/v1path with a root/v1/models; failures stay typed rather than 500ing.Ask (design, light) — prospective; non-blocking
Fork mirror of a sealed OSS review draft. Not posted upstream.
6247b448fa9c791c21c2373c222623871cdd6a0bpackages/opencodebun test ./src/provider/discover.test.ts→ 9/9anomalyco/opencode#42660