opencode
opencode copied to clipboard
gpt5.2 can not use tool call
Description
AI_TypeValidationError: Type validation failed: Value: {"id":"chatcmpl-DA8EwctrvVTROgoDH5iNKQNyJublr","object":"chat.completion","created":1768234868,"model":"gpt-5.2-pro-2025-12-11","system_fingerprint":null,"choices":[{"delta":{"content":"我来直接用 opencode 的终端在该目录上统计文件数(分别给出“仅当前目录”和“含子目录”两种)。","reasoning_content":"","reasoning":"","role":"assistant","tool_calls":[{"id":"fc_0f8bca84f2bce1940069651fbe6f988195a92c21863e7f1395","type":"function","function":{"name":"bash","arguments":"{\"command\":\"powershell -NoProfile -Command \\\"$p='D:\\\\codex-workspaces\\\\Cursor\\\\logs\\\\20260112191206TP105779863040719752408801F'; if(!(Test-Path -LiteralPath $p)){Write-Error ('Path not found: ' + $p); exit 2}; $non=(Get-ChildItem -LiteralPath $p -File -Force).Count; $rec=(Get-ChildItem -LiteralPath $p -File -Force -Recurse).Count; Write-Host ('non_recursive_files=' + $non); Write-Host ('recursive_files=' + $rec)\\\"\",\"description\":\"Count files in logs directory via PowerShell\",\"timeout\":120000,\"workdir\":\"D:\\\\codex-workspaces\\\\Cursor\"}"}}]},"logprobs":null,"finish_reason":null,"index":0}],"usage":{"prompt_tokens":26722,"completion_tokens":612,"total_tokens":27334,"prompt_tokens_details":{"cached_tokens":0,"text_tokens":0,"audio_tokens":0,"image_tokens":0},"completion_tokens_details":{"text_tokens":0,"audio_tokens":0,"reasoning_tokens":395},"input_tokens":0,"output_tokens":0,"input_tokens_details":null,"output_tokens_details":null,"claude_cache_creation_5_m_tokens":0,"claude_cache_creation_1_h_tokens":0}}. Error message: [{"code":"invalid_union","errors":[[{"expected":"number","code":"invalid_type","path":["choices",0,"delta","tool_calls",0,"index"],"message":"Invalid input: expected number, received undefined"}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input: expected object, received undefined"}]],"path":[],"message":"Invalid input"}]
Plugins
No response
OpenCode version
1.1.5
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response