Subagent ignores tool-call denials and keeps fetching instead of summarizing existing context
Summary
When a user denies a tool call inside a running subagent (e.g. denying a WebFetch), the agent should treat this as a signal to stop gathering and summarize what it already has. Instead, it treats each denial as a temporary obstacle and immediately tries the next URL on its list — continuing to accumulate tool uses and cost.
Steps to reproduce
- Spawn a subagent with a research prompt (e.g. "search Reddit and HN for user opinions on X")
- The agent starts fetching URLs in sequence
- User denies one of the
WebFetchtool calls via the permission prompt - Expected: agent stops fetching, uses its existing context to produce the summary
- Actual: agent finds the next URL and tries again — indefinitely
Impact
- In this specific case: ~98
WebFetchcalls were made, costing ~$1.15, before the session was force-killed via Ctrl+C - The user explicitly tried to stop the agent mid-run by denying tool calls — the signal was ignored
- The useful context from the first ~98 fetches was lost because the agent never got to summarize
Expected behavior
A tool-call denial inside a subagent should be treated as "stop and use what you have." The agent has already gathered substantial context — it should synthesize that into a response rather than continuing to search.
This is similar to how a human researcher would respond to "stop, tell me what you found so far" — not by trying to open another browser tab.
Suggested fix
When a tool call is denied inside a subagent:
- Inject a system message along the lines of: "The user denied this tool call. Stop gathering and summarize your findings from the context you already have."
- Or: treat repeated denials (2+) as an implicit
stop_sequence
Environment
- Claude Code CLI
- Model: claude-sonnet-4-6 (subagent)
- Platform: macOS
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗