Skip to content

The agent that grows with you

test: set _incremental_persistence_failed=False on MagicMock agent

kshitijk4poor51a36f1fc1c3
diff --git a/tests/tools/test_interrupt.py b/tests/tools/test_interrupt.py
index aca47df9e19..5552ea496b1 100644
--- a/tests/tools/test_interrupt.py
+++ b/tests/tools/test_interrupt.py
@@ -122,6 +122,11 @@ class TestPreToolCheck:
agent._interrupt_requested = True
agent.log_prefix = ""
agent._persist_session = MagicMock()
+ # PR #72425: execute_tool_calls_* read _incremental_persistence_failed
+ # via getattr at loop top. A bare MagicMock auto-creates a truthy value
+ # for any attribute access, which would short-circuit the interrupt
+ # skip path before any cancelled-tool messages are appended.
+ agent._incremental_persistence_failed = False
# Import and call the method
import types