You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bundled @ai-sdk/openai-compatible is a pre-3.0.0 copy — still throws "Expected 'function.name' to be a string" (fix exists upstream; interim plugin) #52462
Custom @ai-sdk/openai-compatible providers still abort turns with AI_InvalidResponseDataError: Expected 'function.name' to be a string. whenever the server opens a streaming tool_calls delta with function.name: null (common on DashScope token-plan with Qwen models; also vLLM qwen3_xml and some llama.cpp configs).
The upstream SDK has been fixed — vercel/ai#18440 → PR #18445. Verified by grepping published tarballs: the throw string ships in 1.x/2.x (sampled 1.0.0, 2.0.0, 2.0.7) and is gone from 3.0.0 onward (checked 3.0.0, 3.0.62); behaviorally confirmed by feeding the malformed stream to [email protected]'s doStream (no throw, correct buffered tool-call).
But opencode 1.18.34's compiled binary still contains the pre-fix code (/$bunfs/root/chunk-*.js: if(((w=F.function)==null?void 0:w.name)==null) throw new r({data:F,message:"Expected 'function.name' to be a string."})).
The prior reports point at each other and all closed — #26412 (duplicate), #24137 ("file against vercel/ai" — which then fixed it), #31295 (duplicate). Request: bump the bundled @ai-sdk/openai-compatible to a post-3.0.0 version. Same pattern as PR #49689, which bumps @ai-sdk/mistral "to unbreak streamed tool calls".
Plugins
toolcall-guard (my interim workaround — https://github.com/nazerim/toolcall-guard, MIT, plugin-only): fetch-wrapped stream guard, outbound history scrubber (replayed ChatML tokens re-arm the provider's parser every turn), and auto-continue for turns the provider silently truncates with a clean finish_reason:"stop". Without it (opencode run --pure) the repro throws.
OpenCode version
1.18.34. Local error history spans 1.18.16 (2026-08-12), 1.18.26 (2026-09-27 → 10-01) and 1.18.34 (2026-10-01); #26412 reports the identical throw on 1.14.41.
Steps to reproduce
Deterministic, synthetic SSE server — no real API key needed:
git clone https://github.com/nazerim/toolcall-guard &&cd toolcall-guard
SCENARIO=late PORT=8787 node test/toolcall-guard-server.mjs &
OPENCODE_CONFIG=$PWD/test/toolcall-guard-test.opencode.json \
opencode run --pure --auto -m guardtest/guardtest-model "say hi MARKER7788"# → Error: Expected 'function.name' to be a string.
Drop --pure with plugins/toolcall-guard.js installed and the same stream is repaired (tool executes, turn survives).
Screenshot and/or share link
n/a — deterministic CLI repro above; error + stack land in the opencode log.
Please use the Bug Report issue template and include the report in its required Description field; the current body uses custom sections rather than the required template format.
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Thanks for updating the report. It still does not use the Bug Report issue template: the body has custom sections but no required Description field. Please update it with the Bug Report template and put the concise problem description and reproduction context in that field. The needs:compliance label remains until then.
Coinbase.wallet/0xb9b7a70a785629f9914f46f2e649eb6120663666
Custom @ai-sdk/openai-compatible providers still abort turns with AI_InvalidResponseDataError: Expected 'function.name' to be a string. whenever the server opens a streaming tool_calls delta with function.name: null (common on DashScope token-plan with Qwen models; also vLLM qwen3_xml and some llama.cpp configs).
The upstream SDK has been fixed — vercel/ai#18440 → PR #18445. Verified by grepping published tarballs: the throw string ships in 1.x/2.x (sampled 1.0.0, 2.0.0, 2.0.7) and is gone from 3.0.0 onward (checked 3.0.0, 3.0.62); behaviorally confirmed by feeding the malformed stream to [email protected]'s doStream (no throw, correct buffered tool-call).
But opencode 1.18.34's compiled binary still contains the pre-fix code (/$bunfs/root/chunk-*.js: if(((w=F.function)==null?void 0:w.name)==null) throw new r({data:F,message:"Expected 'function.name' to be a string."})).
The prior reports point at each other and all closed — #26412 (duplicate), #24137 ("file against vercel/ai" — which then fixed it), #31295 (duplicate). Request: bump the bundled @ai-sdk/openai-compatible to a post-3.0.0 version. Same pattern as PR #49689, which bumps @ai-sdk/mistral "to unbreak streamed tool calls".
Plugins
toolcall-guard (my interim workaround — https://github.com/nazerim/toolcall-guard, MIT, plugin-only): fetch-wrapped stream guard, outbound history scrubber (replayed ChatML tokens re-arm the provider's parser every turn), and auto-continue for turns the provider silently truncates with a clean finish_reason:"stop". Without it (opencode run --pure) the repro throws.
OpenCode version
1.18.34. Local error history spans 1.18.16 (2026-08-12), 1.18.26 (2026-09-27 → 10-01) and 1.18.34 (2026-10-01); #26412 reports the identical throw on 1.14.41.
Steps to reproduce
Deterministic, synthetic SSE server — no real API key needed:
git clone https://github.com/nazerim/toolcall-guard &&cd toolcall-guard
SCENARIO=late PORT=8787 node test/toolcall-guard-server.mjs &
OPENCODE_CONFIG=$PWD/test/toolcall-guard-test.opencode.json \
opencode run --pure --auto -m guardtest/guardtest-model "say hi MARKER7788"# → Error: Expected 'function.name' to be a string.
Drop --pure with plugins/toolcall-guard.js installed and the same stream is repaired (tool executes, turn survives).
Screenshot and/or share link
n/a — deterministic CLI repro above; error + stack land in the opencode log.
Activity
github-actions commentedon Oct 1, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Oct 1, 2026
Thanks for updating the report. It still does not use the Bug Report issue template: the body has custom sections but no required Description field. Please update it with the Bug Report template and put the concise problem description and reproduction context in that field. The needs:compliance label remains until then.
github-actions commentedon Oct 1, 2026
Thanks for updating the report. It now meets the Bug Report requirements.
0xsarawut-eth commentedon Oct 1, 2026
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊