Skip to content

fix(provider): object-root union schemas for all openai-compatible backends - #260

Merged
LeXwDeX merged 2 commits into
devfrom
fix/tool-schema-root
Aug 14, 2026
Merged

fix(provider): object-root union schemas for all openai-compatible backends#260
LeXwDeX merged 2 commits into
devfrom
fix/tool-schema-root

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Generalize the implicit-root anyOftype: "object" normalization from DeepSeek-only id matching to the whole @ai-sdk/openai-compatible transport.
  • Root cause (reproduced live): GLM via local-proxy receives the workflow tool's root-anyOf function schema with no root type, and silently emits empty tool arguments — the model retried 5x, every call decoded as got {}. DeepSeek had the identical failure and was fixed in fix(provider): promote DeepSeek schema compatibility #259; GLM and other relays were outside the guard.
  • Keep every union branch; only declare the shared object type at the root.

Evidence

  • ProviderTransform.schema output for glm-5.3 (@ai-sdk/openai-compatible): root type implicit before, object after; 10 branches preserved both ways.
  • New test: "OpenAI-compatible transports (GLM relay) also get the object-root union".

Test plan

  • bun test test/tool/workflow-provider-schema.test.ts — 9 pass
  • bun typecheck — clean

fix(provider): promote DeepSeek schema compatibility
…ckends

The DeepSeek-only guard missed GLM and other OpenAI-compatible relays,
which silently emit empty tool arguments for implicit-root anyOf function
schemas. Generalize the fix to the @ai-sdk/openai-compatible transport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant