CCAR-F Agentic Architecture & Orchestration MEDIUM
PRODUCTION SCENARIO
Your research agent uses the web search server tool. On a broad query the response comes back with stop_reason pause_turn, a server_tool_use block with no result block after it, no client tool_use blocks, stop_details null, and output_tokens well under the max_tokens you set. The loop you wrote treats any unfamiliar stop reason as a failure and retries the original prompt from scratch.

What is the correct way for the loop to handle this response?

Answering here is anonymous. Nothing is saved unless you sign in.

Show answer and explanation

Answer: Append the returned assistant content to the messages and send the request again as it is

A paused turn means the server-side sampling loop reached its iteration limit, ten by default, while running a server tool such as web search; sending the assistant content back unchanged lets Claude pick up where it stopped. Returning an is_error result is the right handling for a client tool call you declined to run, but the unresolved block here belongs to a server tool that runs on Anthropic infrastructure, and the API rejects a tool_result addressed to it. Raising the ceiling is the fix when the stop reason is max_tokens, and output_tokens sits far below it. Reading stop_details and falling back is refusal handling, and stop_details is null for every stop reason except refusal.
Free

Keep practicing CCAR-F

59 original CCAR-F practice questions, each with an explanation and a source link. No account needed.

Start free practice set → Timed, explained, free