fix(confidence-engine): resolve synthesis model configuration

This commit is contained in:
2026-08-31 07:32:04 +01:00
parent 75f7c6bafd
commit 8e941b0c7b
4 changed files with 114 additions and 3 deletions
+10 -1
View File
@@ -213,11 +213,20 @@ export async function synthesizeCurrentUnderstanding(
throw new Error("Invalid dependency: provider must have generateReconstruction");
}
// Resolve configured model: explicit dep > config dep (assertConfig) > process.env > null
let modelName = dependencies.modelName;
if (modelName == null && dependencies.config?.OLLAMA_MODEL != null) {
modelName = dependencies.config.OLLAMA_MODEL;
}
if (modelName == null) {
modelName = process.env.OLLAMA_MODEL ?? null;
}
let rawResponse;
try {
rawResponse = await provider.generateReconstruction(
prompt,
dependencies.modelName ?? null
modelName
);
} catch (error) {
const err = new Error(error.message ?? "Synthesis provider call failed");