Claude Certified Architect – Foundations Practice Question 23: Max Tokens Pause Turn
Claude Certified Architect, Foundations · Test 3 · question 3 of 10
An agent loop calls the Messages API with client tools plus the server-side web search tool. In production, two failures appear. In one, a response arrives with stop_reason set to max_tokens and its last content block is a tool_use block whose JSON input looks cut off. In the other, a response arrives with stop_reason set to pause_turn. How should the loop handle them?
Show answer and explanation
Answer:
When max_tokens cuts off a response in the middle of a tool_use block, the tool input is incomplete, so the request should be retried with a higher max_tokens to get the full tool use. pause_turn means a server-tool loop (such as web search) hit its iteration limit; the turn is not finished, and you continue it by sending the assistant content back as-is.
- B is wrong: guessing at repaired JSON risks running a tool with wrong arguments, and pause_turn is not a completed turn. - C is wrong: a "continue" message does not repair a truncated tool_use block, and discarding the paused response throws away progress instead of continuing it. - D is wrong: filling defaults invents arguments, and pause_turn is not used for pending client tool calls; those produce stop_reason tool_use.
Reference: Handling stop reasons