fix(confidence-engine): unwrap synthesis provider response
This commit is contained in:
@@ -279,9 +279,9 @@ export async function synthesizeCurrentUnderstanding(
|
||||
modelName = process.env.OLLAMA_MODEL ?? null;
|
||||
}
|
||||
|
||||
let rawResponse;
|
||||
let providerResult;
|
||||
try {
|
||||
rawResponse = await provider.generateReconstruction(
|
||||
providerResult = await provider.generateReconstruction(
|
||||
prompt,
|
||||
modelName,
|
||||
synthesisOutputSchema,
|
||||
@@ -293,7 +293,7 @@ export async function synthesizeCurrentUnderstanding(
|
||||
}
|
||||
|
||||
// 5. Validate response
|
||||
const validated = validateSynthesisResponse(rawResponse);
|
||||
const validated = validateSynthesisResponse(providerResult.response);
|
||||
if (!validated.valid) {
|
||||
const err = new Error(`Synthesis validation failed: ${validated.error}`);
|
||||
err.statusCode = 502;
|
||||
|
||||
Reference in New Issue
Block a user