Browse Source
When a tool-call is in 'approval-responded' state with approved=true but hasResult=false (approval executed but result not yet available in approvalToolResults), the code was pushing a tool-call part to the assistant message without a corresponding tool-result in the tool message. This caused providers (e.g. deepseek) to reject the prompt with 'Tool result is missing for tool call' or 'Invalid prompt: The messages do not match the ModelMessage[] schema'. Fix: only push tool-approval-request (not tool-call) when hasResult=false. Also clean up approval-requested branch to only include required fields (type, approvalId, toolCallId) per AI SDK schema. Co-authored-by: CodeFree <codefree@chinatelcom.cn>feat/agent-independence
2 changed files with 4 additions and 14 deletions
Binary file not shown.
Loading…
Reference in new issue