tool_use content block silently dropped despite stop_reason=tool_use
Summary
In a Claude Code session via cc-connect, the API returned a response with stop_reason: tool_use but the content array contained only a text block — the tool_use block was missing. The model consumed 581 output tokens but only ~70 chars of text were present in the content. The remaining ~500 tokens (likely the tool_use block) were silently dropped.
This caused the agent to appear to "announce intent" without acting, when in fact it had tried to call a tool.
Evidence
- API message ID:
msg_01T93GF4xZQickPQqfSKN67D - Model:
claude-opus-4-6 - Timestamp: 2026-03-27T13:57:44Z
- Session ID:
7bbd674c-4adf-40dd-b570-30e89d25c0b1
Response metadata
{
"stop_reason": "tool_use",
"content": [{"type": "text", "text": "Let me orient first — pulling context on this channel and recent work."}],
"usage": {
"input_tokens": 3,
"cache_creation_input_tokens": 22156,
"cache_read_input_tokens": 11204,
"output_tokens": 581
}
}
Note: stop_reason: tool_use + content has zero tool_use blocks. 581 output tokens but text content is only ~15 tokens.
Context
- The session had been dormant for ~2h35m before being resumed with a user message
- The user message included a large system-reminder with config change diffs (~2000 chars)
- The thinking block (23 tokens) was delivered correctly in a prior streaming chunk
Frequency
Audited 20,855 responses with stop_reason: tool_use across all sessions — this is the only instance where the tool_use content block was missing. Rate: 1 in 20,855.
Expected behavior
When stop_reason: tool_use, the content array should always contain at least one tool_use block.
Impact
The agent appeared to produce a text-only response and "end its turn" without acting. The user had to manually re-prompt. We've implemented a detection guard (cc-connect auto-retries zero-tool-call first turns on triggered sessions), but the underlying API/SDK issue should be investigated.
Related
Linear issue: ULY-495
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗