Retry incomplete agent repairs safely

This commit is contained in:
2026-08-27 19:12:59 +02:00
parent 4895a2a91b
commit d9fe2747a1
6 changed files with 89 additions and 2 deletions

View File

@@ -59,3 +59,26 @@ def test_retry_task_contains_failure_without_secrets() -> None:
assert "Missing import" in task
assert "secret-value" not in task
assert "Do not remove or weaken tests" in task
def test_customer_database_task_explains_tenant_scope() -> None:
report = FailureReport(
id=13,
chat_message_id=1,
source="automatic",
category="sql_execution",
user_feedback=None,
feedback_type=None,
expected_behavior=None,
prompt="What did this customer buy most?",
response=None,
sql_query="SELECT * FROM invoice_row WHERE InvoiceCreator = 'tenant'",
error_message="Unknown column InvoiceCreator",
context={"database_type": "customer"},
)
task = build_task(report)
assert "already selected one tenant database" in task
assert "must not" in task
assert "guessed column" in task