From 3336c96b879b9b87f4444c8e16c79ba2ee2ae515 Mon Sep 17 00:00:00 2001 From: alrcatraz Date: Sun, 4 Oct 2026 20:36:25 +0800 Subject: [PATCH] fix(agent): render skipped-call notices from the recorded reason Both sequential skip sites hardcoded a user-initiated cause ("User sent a new message" / "skipped due to user interrupt"), so any system abort that reached them asserted an action the user never took. Render the notice from the published reason instead: a system issuer describes itself, and only the genuinely user-initiated reasons keep the user-facing wording. (cherry picked from commit 8efe429e2a485a183c7ad46522d9a5c99cef6a9c) --- agent/tool_executor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/tool_executor.py b/agent/tool_executor.py index b3b5c11aec..bfb768e389 100644 --- a/agent/tool_executor.py +++ b/agent/tool_executor.py @@ -31,6 +31,7 @@ from agent.display import ( _detect_tool_failure, ) from agent.compression_marker import _COMPRESSION_MARKER_PREFIX +from agent.interrupt_control import interrupt_skip_wording from agent.message_sanitization import coalesce_tool_call_id from agent.inline_tool_executors import ( INLINE_TOOL_EXECUTORS, @@ -1860,7 +1861,7 @@ def _execute_tool_calls_sequential(agent, assistant_message, messages: list, eff if not _skip_remaining_sequential( agent, messages, tool_calls[i - 1:], effective_task_id, notice="tool call(s)", - content="[Tool execution cancelled — {name} was skipped due to user interrupt]", + content=f"[Tool execution cancelled — {{name}} was skipped. {interrupt_skip_wording(agent)}]", hook_error_type="user_interrupt", hook_id=lambda tc: getattr(tc, "id", "") or "", flush_stage="cancelled tool result", @@ -1893,7 +1894,7 @@ def _execute_tool_calls_sequential(agent, assistant_message, messages: list, eff if not _skip_remaining_sequential( agent, messages, tool_calls[i:], effective_task_id, notice="remaining tool call(s)", - content="[Tool execution skipped — {name} was not started. User sent a new message]", + content=f"[Tool execution skipped — {{name}} was not started. {interrupt_skip_wording(agent)}]", flush_stage="skipped tool result", ): return