(modelId: string)
| 76 | } |
| 77 | |
| 78 | function normalizeModelId(modelId: string): string { |
| 79 | const trimmed = modelId.trim(); |
| 80 | assert(trimmed.length > 0, "Model identifier cannot be empty."); |
| 81 | |
| 82 | if (trimmed.startsWith(OPENCODE_PREFIX)) { |
| 83 | return trimmed.slice(OPENCODE_PREFIX.length); |
| 84 | } |
| 85 | |
| 86 | return trimmed; |
| 87 | } |
| 88 | |
| 89 | function inferEndpoint(modelId: string): "responses" | "anthropic" | "chat" { |
| 90 | const lower = modelId.toLowerCase(); |
no outgoing calls
no test coverage detected