Recover from malformed agent edits
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-08-28 12:58:09 +02:00
parent e97cbd7698
commit 441c598890
6 changed files with 172 additions and 4 deletions

View File

@@ -176,3 +176,27 @@ def test_unresolved_placeholder_task_guides_real_answer_path() -> None:
assert "exact token map" in task
assert "HTTP-backed AIService test" in task
assert "local database-result fallback" in task
def test_cross_database_report_guides_staged_source_routing() -> None:
report = FailureReport(
id=56,
chat_message_id=1,
source="user_feedback",
category="incorrect_answer",
user_feedback="Wrong hours",
feedback_type="wrong_result",
expected_behavior="Join cockpit_config.time_registration to customer manager and ERP positions",
prompt="Hours in April",
response="0 hours",
sql_query="SELECT SUM(hours) FROM LX_AUFGABE",
error_message=None,
context={"database_type": "erp"},
)
task = build_task(report)
assert "tables from multiple databases" in task
assert "staged-query workflows" in task
assert "Do not put an impossible cross-connection join" in task
assert "preserving tenant isolation" in task