MCPcopy Create free account
hub / github.com/anomalyco/opencode / getFirstValidModel

Function getFirstValidModel

packages/tui/src/context/local.tsx:69–75  ·  view source on GitHub ↗
(...modelFns: (() => { providerID: string; modelID: string } | undefined)[])

Source from the content-addressed store, hash-verified

67 }
68
69 function getFirstValidModel(...modelFns: (() => { providerID: string; modelID: string } | undefined)[]) {
70 for (const modelFn of modelFns) {
71 const model = modelFn()
72 if (!model) continue
73 if (isModelValid(model)) return model
74 }
75 }
76
77 function createAgent() {
78 const agents = createMemo(() => sync.data.agent.filter((agent) => agent.mode !== "subagent" && !agent.hidden))

Callers 1

createModelFunction · 0.85

Calls 1

isModelValidFunction · 0.85

Tested by

no test coverage detected