From ebdd709ca051daa4b8e3dfce8a54ade1225eb4fd Mon Sep 17 00:00:00 2001 From: Florian Brand <46377542+xeophon@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:06:07 -0800 Subject: [PATCH] Report differing fields when an integration trace forks --- tests/integration/grid.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/integration/grid.py b/tests/integration/grid.py index b93a443bfe..4fb76ebb4a 100644 --- a/tests/integration/grid.py +++ b/tests/integration/grid.py @@ -94,8 +94,25 @@ def assert_one_branch( assert set(forks) <= FORKS.keys(), ( f"no FORKS reason for {set(forks) - FORKS.keys()}" ) - if harness.id not in forks: - assert trace.num_branches == 1, f"{trace.num_branches} branches" + if harness.id in forks or trace.num_branches == 1: + return + first_child: dict[int | None, int] = {} + for i, node in enumerate(trace.nodes): + first = first_child.setdefault(node.parent, i) + if first != i: + sibling = trace.nodes[first] + a, b = sibling.message, node.message + fields = type(a).model_fields.keys() | type(b).model_fields.keys() + changed = sorted( + k for k in fields if getattr(a, k, None) != getattr(b, k, None) + ) + if sibling.tools != node.tools: + changed.append("tools") + pytest.fail( + f"{trace.num_branches} branches at parent {node.parent}, " + f"nodes {first} ({a.role}) and {i} ({b.role}), differing fields {changed}" + ) + pytest.fail(f"{trace.num_branches} branches") def agent_seats(taskset: str, env_id: str = "") -> list[str]: