fix: model format normalization and explicit config cache bypass
- Add normalizeModelFormat() utility for string/object model handling - Update subagent-resolver to handle both model formats - Add explicitUserConfig flag to ModelResolutionResult - Set explicitUserConfig: true when user model is found in pipeline This fixes the issue where plugin-provided models fail cache validation and fall through to random fallback models.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export function normalizeModelFormat(
|
||||
model: string | { providerID: string; modelID: string }
|
||||
): { providerID: string; modelID: string } | undefined {
|
||||
if (!model) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (typeof model === "object" && "providerID" in model && "modelID" in model) {
|
||||
return { providerID: model.providerID, modelID: model.modelID }
|
||||
}
|
||||
|
||||
if (typeof model === "string") {
|
||||
const parts = model.split("/")
|
||||
if (parts.length >= 2) {
|
||||
return { providerID: parts[0], modelID: parts.slice(1).join("/") }
|
||||
}
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
Reference in New Issue
Block a user