Skip to content

The agent that grows with you

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

Teknium449f8c954db7
diff --git a/tests/agent/test_send_path_history_isolation.py b/tests/agent/test_send_path_history_isolation.py
index 051a41472f7..1f5f6727a6f 100644
--- a/tests/agent/test_send_path_history_isolation.py
+++ b/tests/agent/test_send_path_history_isolation.py
@@ -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":