Skip to content

Tool name is undefined in messages after executing a tool that needs approval #532

@idonov

Description

@idonov

TanStack AI version

"@tanstack/ai": "^0.14.0"

Framework/Library version

"@tanstack/ai-anthropic": "^0.8.3", "@tanstack/ai-client": "^0.8.0", "@tanstack/ai-react": "^0.8.0"

Describe the bug and the steps to reproduce it

Steps to reproduce:

  1. Call a tool that needs approval
  2. Approve call and wait for successfull response
  3. Add any new message and call model again

Result: An error happens because one of the tool-call parts in messages has toolName:undefined.

[tanstack-ai:errors] ❌ anthropic.chatStream fatal { error: BadRequestError: 400 Failed to call LLM service: invoking wrapper: http response error StatusCode: 400, ValidationException: messages.1.content.1.tool_use.name: String should have at least 1 character

I am using the Anthropic adapter.
Not sure if related, but I am also experiencing tool response data missing to the LLM after the approval but during streaming the response(on a new user message the response is there). The model receives a placeholder data object telling him the user approved the tool call, so if the tool call failed and returned an error the model has no idea and responds DONE. On sending a new message the response is there and the model will realise the error.
Looks like until the tool call stream is done the first placeholder response message is used and the actual part with the actual tool call response is skiped.

Debug logs from the chat logging the reproduction steps from above:
[2026-05-06T15:49:47.170Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 run started {} [2026-05-06T15:49:47.171Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 iteration=0 {"iteration":0} [2026-05-06T15:49:47.176Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=1 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1","messageCount":1,"toolCount":10} [2026-05-06T15:49:47.176Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=1 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1"} [2026-05-06T15:49:51.202Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_start {"chunk":{"type":"message_start","message":{"model":"claude-opus-4-6","id":"msg_bdrk_01UGc1962SMzEr466tpBXxzE","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3746,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":22}}}} [2026-05-06T15:49:51.203Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=RUN_STARTED {"chunk":{"type":"RUN_STARTED","runId":"anthropic-1778082591201-euy9pc","threadId":"thread-1778082587170-5w6zk6y","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201}} [2026-05-06T15:49:51.203Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_start {"chunk":{"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","name":"testApproval","input":{}}}} [2026-05-06T15:49:51.203Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}}} [2026-05-06T15:49:51.204Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_START {"chunk":{"type":"TOOL_CALL_START","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","toolCallName":"testApproval","toolName":"testApproval","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"index":0}} [2026-05-06T15:49:51.204Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"","args":""}} [2026-05-06T15:49:51.602Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"message"}}} [2026-05-06T15:49:51.603Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"{\"message","args":"{\"message"}} [2026-05-06T15:49:51.603Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"Thi"}}} [2026-05-06T15:49:51.603Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"\": \"Thi","args":"{\"message\": \"Thi"}} [2026-05-06T15:49:51.618Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"s is a test "}}} [2026-05-06T15:49:51.618Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"s is a test ","args":"{\"message\": \"This is a test "}} [2026-05-06T15:49:51.620Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"of th"}}} [2026-05-06T15:49:51.620Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"of th","args":"{\"message\": \"This is a test of th"}} [2026-05-06T15:49:51.626Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e approv"}}} [2026-05-06T15:49:51.626Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"e approv","args":"{\"message\": \"This is a test of the approv"}} [2026-05-06T15:49:51.644Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"al flow."}}} [2026-05-06T15:49:51.644Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"al flow.","args":"{\"message\": \"This is a test of the approval flow."}} [2026-05-06T15:49:51.645Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"}"}}} [2026-05-06T15:49:51.645Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_ARGS {"chunk":{"type":"TOOL_CALL_ARGS","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"delta":"\"}","args":"{\"message\": \"This is a test of the approval flow.\"}"}} [2026-05-06T15:49:51.645Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_stop {"chunk":{"type":"content_block_stop","index":0}} [2026-05-06T15:49:51.645Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TOOL_CALL_END {"chunk":{"type":"TOOL_CALL_END","toolCallId":"toolu_bdrk_01JzeZm3rkSWStSoEzoqGb4c","toolCallName":"testApproval","toolName":"testApproval","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"input":{"message":"This is a test of the approval flow."}}} [2026-05-06T15:49:51.646Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_delta {"chunk":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3746,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":62}}} [2026-05-06T15:49:51.646Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=RUN_FINISHED {"chunk":{"type":"RUN_FINISHED","runId":"anthropic-1778082591201-euy9pc","threadId":"thread-1778082587170-5w6zk6y","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082591201,"finishReason":"tool_calls","usage":{"promptTokens":3746,"completionTokens":62,"totalTokens":3808}}} [2026-05-06T15:49:51.647Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_stop {"chunk":{"type":"message_stop","amazon-bedrock-invocationMetrics":{"inputTokenCount":3746,"outputTokenCount":62,"invocationLatency":3719,"firstByteLatency":3261}}} [2026-05-06T15:49:51.673Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 iteration=0 {"iteration":0} [2026-05-06T15:49:51.674Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 run finished {"finishReason":"tool_calls"} [2026-05-06T15:49:54.511Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 run started {} [2026-05-06T15:49:54.512Z] [DEBUG] 🔧 [tanstack-ai:tools] 🔧 phase=before name=testApproval {"name":"testApproval","args":{"message":"This is a test of the approval flow."}} [2026-05-06T15:49:54.513Z] [DEBUG] 🔧 [tanstack-ai:tools] 🔧 phase=after name=testApproval {"name":"testApproval","result":{"status":"SUCCESS","message":"Approved and executed: This is a test of the approval flow."}} [2026-05-06T15:49:54.513Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 iteration=0 {"iteration":0} [2026-05-06T15:49:54.519Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=4 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1","messageCount":4,"toolCount":10} [2026-05-06T15:49:54.519Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=4 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1"} [2026-05-06T15:49:56.414Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_start {"chunk":{"type":"message_start","message":{"model":"claude-opus-4-6","id":"msg_bdrk_015T6H7qkBpYgNuhrb7jhBPW","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3839,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":6}}}} [2026-05-06T15:49:56.414Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=RUN_STARTED {"chunk":{"type":"RUN_STARTED","runId":"anthropic-1778082596414-172ic6","threadId":"thread-1778082594511-1r2x0ir","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414}} [2026-05-06T15:49:56.415Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_start {"chunk":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}} [2026-05-06T15:49:56.415Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"✅ **Test approval"}}} [2026-05-06T15:49:56.415Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_START {"chunk":{"type":"TEXT_MESSAGE_START","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"role":"assistant"}} [2026-05-06T15:49:56.415Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":"✅ **Test approval","content":"✅ **Test approval"}} [2026-05-06T15:49:56.457Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" completed"}}} [2026-05-06T15:49:56.458Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" completed","content":"✅ **Test approval completed"}} [2026-05-06T15:49:56.479Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" successfully"}}} [2026-05-06T15:49:56.479Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" successfully","content":"✅ **Test approval completed successfully"}} [2026-05-06T15:49:56.531Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!**\n\nThe"}}} [2026-05-06T15:49:56.531Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":"!**\n\nThe","content":"✅ **Test approval completed successfully!**\n\nThe"}} [2026-05-06T15:49:56.585Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" approval"}}} [2026-05-06T15:49:56.586Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" approval","content":"✅ **Test approval completed successfully!**\n\nThe approval"}} [2026-05-06T15:49:56.637Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" flow worked"}}} [2026-05-06T15:49:56.638Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" flow worked","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked"}} [2026-05-06T15:49:56.694Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" as expected —"}}} [2026-05-06T15:49:56.694Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" as expected —","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected —"}} [2026-05-06T15:49:56.742Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the action"}}} [2026-05-06T15:49:56.742Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" the action","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action"}} [2026-05-06T15:49:56.796Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" was approved and executed"}}} [2026-05-06T15:49:56.796Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" was approved and executed","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed"}} [2026-05-06T15:49:56.872Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". The"}}} [2026-05-06T15:49:56.872Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":". The","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The"}} [2026-05-06T15:49:56.924Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" tool"}}} [2026-05-06T15:49:56.924Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" tool","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool"}} [2026-05-06T15:49:56.952Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" ech"}}} [2026-05-06T15:49:56.952Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" ech","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool ech"}} [2026-05-06T15:49:57.008Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"oed back the test"}}} [2026-05-06T15:49:57.010Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":"oed back the test","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test"}} [2026-05-06T15:49:57.060Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" message"}}} [2026-05-06T15:49:57.061Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" message","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test message"}} [2026-05-06T15:49:57.113Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" confirming the approval mechanism"}}} [2026-05-06T15:49:57.113Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" confirming the approval mechanism","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test message confirming the approval mechanism"}} [2026-05-06T15:49:57.165Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" is functioning"}}} [2026-05-06T15:49:57.166Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" is functioning","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test message confirming the approval mechanism is functioning"}} [2026-05-06T15:49:57.220Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" properly"}}} [2026-05-06T15:49:57.220Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":" properly","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test message confirming the approval mechanism is functioning properly"}} [2026-05-06T15:49:57.271Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_delta {"chunk":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}}} [2026-05-06T15:49:57.271Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_CONTENT {"chunk":{"type":"TEXT_MESSAGE_CONTENT","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"delta":".","content":"✅ **Test approval completed successfully!**\n\nThe approval flow worked as expected — the action was approved and executed. The tool echoed back the test message confirming the approval mechanism is functioning properly."}} [2026-05-06T15:49:57.327Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=content_block_stop {"chunk":{"type":"content_block_stop","index":0}} [2026-05-06T15:49:57.328Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=TEXT_MESSAGE_END {"chunk":{"type":"TEXT_MESSAGE_END","messageId":"anthropic-1778082596414-19toe","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414}} [2026-05-06T15:49:57.432Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_delta {"chunk":{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3839,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":45}}} [2026-05-06T15:49:57.433Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=RUN_FINISHED {"chunk":{"type":"RUN_FINISHED","runId":"anthropic-1778082596414-172ic6","threadId":"thread-1778082594511-1r2x0ir","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082596414,"finishReason":"stop","usage":{"promptTokens":3839,"completionTokens":45,"totalTokens":3884}}} [2026-05-06T15:49:57.434Z] [DEBUG] 📥 [tanstack-ai:provider] 📥 provider=anthropic type=message_stop {"chunk":{"type":"message_stop","amazon-bedrock-invocationMetrics":{"inputTokenCount":3839,"outputTokenCount":42,"invocationLatency":2645,"firstByteLatency":1600}}} [2026-05-06T15:49:57.455Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 iteration=0 {"iteration":0} [2026-05-06T15:49:57.456Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 run finished {"finishReason":"stop"} [2026-05-06T15:50:05.407Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 run started {} [2026-05-06T15:50:05.408Z] [DEBUG] 🔁 [tanstack-ai:agentLoop] 🔁 iteration=0 {"iteration":0} [2026-05-06T15:50:05.412Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=7 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1","messageCount":7,"toolCount":10} [2026-05-06T15:50:05.413Z] [DEBUG] 📤 [tanstack-ai:request] 📤 activity=chat provider=anthropic model=anthropic.claude-opus-4-6-v1 messages=7 tools=10 stream=true {"provider":"anthropic","model":"anthropic.claude-opus-4-6-v1"} [2026-05-06T15:50:07.561Z] [ERROR] ❌ [tanstack-ai:errors] ❌ anthropic.chatStream fatal {"error":{"status":400,"headers":{},"requestID":"73e24d65-f74d-4867-8d8f-703738ffc999","error":{"message":"Failed to call LLM service: invoking wrapper: http response error StatusCode: 400, ValidationException: messages.3.content.0.tool_use.name: String should have at least 1 character","request_id":"73e24d65-f74d-4867-8d8f-703738ffc999","details":"invoking wrapper: http response error StatusCode: 400, ValidationException: messages.3.content.0.tool_use.name: String should have at least 1 character","error":{"message":"Failed to call LLM service: invoking wrapper: http response error StatusCode: 400, ValidationException: messages.3.content.0.tool_use.name: String should have at least 1 character","type":"invalid_request_error"},"type":"error"}},"source":"anthropic.chatStream"} [2026-05-06T15:50:07.562Z] [DEBUG] 📨 [tanstack-ai:output] 📨 type=RUN_ERROR {"chunk":{"type":"RUN_ERROR","model":"anthropic.claude-opus-4-6-v1","timestamp":1778082607562,"message":"400 Failed to call LLM service: invoking wrapper: http response error StatusCode: 400, ValidationException: messages.3.content.0.tool_use.name: String should have at least 1 character","code":"400"}}

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

No example

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions