test: restore taskdoc truncation regression
This commit is contained in:
@@ -45,6 +45,18 @@ def test_task_doc_byte_budget_violation_flagged(tmp_path):
|
||||
assert doc.byte_budget_ok is False
|
||||
|
||||
|
||||
def test_taskdoc_truncates_over_budget(tmp_path):
|
||||
s = tmp_path / "sess"
|
||||
s.mkdir()
|
||||
(s / "question.md").write_text("# Domanda\n" + "x" * 200_000)
|
||||
|
||||
doc = generate_task_doc(session_dir=s, phase=1)
|
||||
|
||||
assert doc.byte_budget_ok is False
|
||||
assert len(doc.body.encode()) <= 80_000
|
||||
assert "troncato" in doc.body
|
||||
|
||||
|
||||
def test_task_doc_carries_phase_header(tmp_path):
|
||||
s = tmp_path / "sess"
|
||||
s.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user