ouroboros/tests/test_delivery_tools_after_candidate.py
Ouroboros 14fdc81343 fix(tasks): preserve delivery, lineage and cancellation observations
Remove the universal commit-or-revert delivery guard in an explicit follow-up.
Wake task waits on the actor mailbox without acknowledging messages, keep
promoted lineage and observed execution facts, and retain full completion
sources before synthesis. Cancellation observations remain separate from
caller intent and never change stop authority.

Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
2026-09-06 08:45:51 +00:00

26 lines
1.2 KiB
Python

"""A retained answer constrains final text without disabling further tool work."""
import json
from tests.test_delivery_candidate import _run_loop
def test_further_write_then_complete_replacement_remain_available(tmp_path, monkeypatch):
replacement = "The requested effect.txt now contains the verified result."
result, _usage, trace, calls = _run_loop(
tmp_path, monkeypatch,
["The first answer is retained.",
{"content": None, "tool_calls": [{"id": "write-1", "type": "function", "function": {
"name": "write_file", "arguments": json.dumps({"path": "effect.txt", "content": "verified result"}),
}}]},
json.dumps({"delivery_control": "replace", "full_answer": replacement})],
acceptance_results=[True, False],
)
prompt = json.dumps(calls[1])
assert "may continue using tools" in prompt
assert "only to your final response with no tool calls" in prompt
assert (tmp_path / "effect.txt").read_text() == "verified result"
assert result == replacement
assert trace["delivery_candidate"]["revision"] == 2
assert trace["delivery_candidate"]["finalization_control"] == "replace"
assert trace["delivery_candidate"]["degraded"] is False