fix(confidence-engine): bound focused investigation input

This commit is contained in:
2026-09-10 13:23:39 +01:00
parent 2cb2d556fd
commit a6796c6f73
4 changed files with 202 additions and 2 deletions
@@ -50,6 +50,23 @@ async function post(request) {
);
}
const REQUEST_LENGTH_LIMITS = {
answer: 10000,
question: 2048,
centralStatement: 2048,
targetLabel: 2048,
targetDescription: 2048,
};
for (const [field, limit] of Object.entries(REQUEST_LENGTH_LIMITS)) {
if (body[field] && body[field].length > limit) {
return Response.json(
{ error: `Request field "${field}" exceeds maximum length of ${limit} characters` },
{ status: 400 },
);
}
}
const prompt = buildFocusedDeconstructPrompt({
targetLabel: body.targetLabel,
targetDescription: body.targetDescription,