Bound investigation prompts and paginate research evidence

This commit is contained in:
Nico committed 2026-10-20 17:04:49 +02:00
1 parent 377644ffa0
commit 682f275590
24 files changed
+1005 -37

No files matched your search

+9 -1
View File
@@ -42,9 +42,14 @@ def is_investigation_review(request):
try:
message = next(m for m in reversed(request['messages']) if m['role'] == 'user')
document = parse_manifest(message['content'].encode('utf-8'))
action_schema = request['output_schema']['properties']['next']
if request['output_schema'].get('x-viano-investigation-window') == 1 and 'anyOf' in action_schema:
action_schema = action_schema['anyOf'][0]
if request['output_schema'].get('x-viano-investigation-window') == 1 and 'oneOf' in action_schema:
action_schema = action_schema['oneOf'][0]
return (document.get('task') == 'assess_pending_result_for_early_review'
and document['input']['early_review']['request']['status'] == 'preparing'
and set(request['output_schema']['properties']['next']['properties']['kind']['enum'])
and set(action_schema['properties']['kind']['enum'])
== {'defer','reject'})
except (ValueError, TypeError, KeyError, AttributeError, StopIteration, RecursionError):
return False
@@ -84,6 +89,9 @@ class LLMGateway:
raise LLMError("LLM_REQUEST")
_schema_check(request["output_schema"])
Draft202012Validator.check_schema(request["output_schema"])
from .investigation_size import is_investigation, check, TRANSPORT_RESERVE
if is_investigation(request):
check(request, reserve=TRANSPORT_RESERVE)
eligible = PRIVACY[request["privacy"]] & PRIVACY[self.config.privacy_profile]
if not any(p.enabled and p.privacy in eligible for p in self.config.providers):
raise LLMError("LLM_PRIVACY_NO_PROVIDER")