test(agent): repoint send-path clone AST contract at turn_context.build_api_messages

This commit is contained in:
Teknium
2026-09-02 13:41:27 -07:00
parent ab48b1ddc5
commit 449f8c954d
@@ -172,12 +172,19 @@ class TestSendPathBuildIsWiredToTheClone:
import ast
import inspect
source = inspect.getsource(cl)
tree = ast.parse(source)
import agent.turn_context as tc
# The history build lives in turn_context.build_api_messages; the
# prefill insert stays in conversation_loop. Scan both homes.
nodes = [
node
for mod in (cl, tc)
for node in ast.walk(ast.parse(inspect.getsource(mod)))
]
clone_calls = []
shallow_copies = []
for node in ast.walk(tree):
for node in nodes:
if isinstance(node, ast.Call):
fn = node.func
if isinstance(fn, ast.Name) and fn.id == "_clone_message_for_send":