test(ci): remove suite-order mock coupling

This commit is contained in:
YeonGyu-Kim
2026-05-15 18:21:04 +09:00
parent f1fb1e08eb
commit a02686e729
17 changed files with 387 additions and 401 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import type { OpencodeClient } from "./types"
import { log } from "../../shared/logger"
import { isRecord } from "../../shared/record-type-guard"
import { readConnectedProvidersCache, readProviderModelsCache } from "../../shared/connected-providers-cache"
import * as connectedProvidersCache from "../../shared/connected-providers-cache"
type ModelListClient = OpencodeClient & {
model: { list: () => Promise<unknown> }
@@ -34,7 +34,7 @@ function addFromProviderModels(
}
export async function getAvailableModelsForDelegateTask(client: OpencodeClient): Promise<Set<string>> {
const providerModelsCache = readProviderModelsCache()
const providerModelsCache = connectedProvidersCache.readProviderModelsCache()
if (providerModelsCache?.models) {
const connected = new Set(providerModelsCache.connected)
@@ -47,7 +47,7 @@ export async function getAvailableModelsForDelegateTask(client: OpencodeClient):
return out
}
const connectedProviders = readConnectedProvidersCache()
const connectedProviders = connectedProvidersCache.readConnectedProvidersCache()
if (!connectedProviders || connectedProviders.length === 0) {
return new Set()
+7 -3
View File
@@ -2,7 +2,7 @@ import type { FallbackEntry } from "../../shared/model-requirements"
import { normalizeModel } from "../../shared/model-normalization"
import { fuzzyMatchModel } from "../../shared/model-availability"
import { transformModelForProvider } from "../../shared/provider-model-id-transform"
import { hasConnectedProvidersCache, hasProviderModelsCache, readConnectedProvidersCache } from "../../shared/connected-providers-cache"
import * as connectedProvidersCache from "../../shared/connected-providers-cache"
import { log } from "../../shared/logger"
import { parseModelString, parseVariantFromModelID } from "../../shared/model-string-parser"
@@ -63,11 +63,15 @@ export function resolveModelForDelegateTask(input: {
return { model: userModel }
}
const connectedProviders = input.availableModels.size === 0 ? readConnectedProvidersCache() : null
const connectedProviders = input.availableModels.size === 0 ? connectedProvidersCache.readConnectedProvidersCache() : null
// Before provider cache is created (first run), skip model resolution entirely.
// OpenCode will use its system default model when no model is specified in the prompt.
if (input.availableModels.size === 0 && !hasProviderModelsCache() && !hasConnectedProvidersCache()) {
if (
input.availableModels.size === 0 &&
!connectedProvidersCache.hasProviderModelsCache() &&
!connectedProvidersCache.hasConnectedProvidersCache()
) {
return { skipped: true }
}