test: set _incremental_persistence_failed=False on MagicMock agent
PR #72425 added getattr(agent, '_incremental_persistence_failed', False) checks at the top of execute_tool_calls_{sequential,concurrent,segmented}. A bare MagicMock auto-creates a truthy value for any attribute access, so the interrupt-skip test's MagicMock agent short-circuited before appending cancelled-tool messages — assert len(messages)==3 got 0. Production is unaffected: run_conversation resets the flag to False explicitly at turn start (conversation_loop.py:~1028).
This commit is contained in:
parent
8e934e84ac
commit
51a36f1fc1
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue