Skip to content

Commit e351ee7

Browse files
test: harden predicate index lookup per review
1 parent b83bce5 commit e351ee7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_tool_dispatch_ordering.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646

4747

4848
def _predicate_index(predicate: Predicate) -> int:
49-
for i, (pred, _) in enumerate(_TOOL_RESULT_DISPATCH):
49+
for i, entry in enumerate(_TOOL_RESULT_DISPATCH):
50+
pred = entry[0]
51+
# Identity match: dispatch table must store bare function refs (not wrappers).
5052
if pred is predicate:
5153
return i
5254
raise ValueError(f"predicate {predicate.__name__} not found in _TOOL_RESULT_DISPATCH")

0 commit comments

Comments
 (0)