Skip to content

fix(fold-xai): use Chat Completions for xAI tool calls - #10

Merged
K-Mistele merged 2 commits into
mainfrom
fix/xai-chat-completions
Aug 20, 2026
Merged

fix(fold-xai): use Chat Completions for xAI tool calls#10
K-Mistele merged 2 commits into
mainfrom
fix/xai-chat-completions

Conversation

@K-Mistele

Copy link
Copy Markdown
Contributor

Summary

  • Switch fold-xai from @effect/ai-openai (Responses API) to @effect/ai-openai-compat (Chat Completions API)
  • xAI's /v1/responses endpoint has incomplete streaming support for tool calls — the stream hangs when Grok tries to call tools, leaving the session stuck with no assistant response
  • fold-opencode already handles this by routing grok models through Chat Completions; this applies the same fix to the direct xAI OAuth provider
  • Bumps default model from grok-4.5 to grok-4.6 (released Aug 12)

Test plan

  • bun vitest run in packages/fold-xai — 3/3 tests pass
  • bun --bun run typecheck --filter @humanlayer/fold-xai — clean
  • Manual: start a fold session with xAI provider and verify tool calls (read/edit/bash) complete instead of hanging

🤖 Generated with Claude Code

K-Mistele and others added 2 commits August 19, 2026 17:28
xAI's Responses API (/v1/responses) has incomplete support for streaming
tool calls, causing the stream to hang when Grok tries to call tools.
Switch fold-xai from @effect/ai-openai (Responses API) to
@effect/ai-openai-compat (Chat Completions API), matching the approach
fold-opencode already uses for grok models.

Also bumps the default model to grok-4.6.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HumanLayer-Session: https://app.dev.codelayer.gg/sessions/01a01c8a-7828-7f4b-b361-efcd6a9501f1
@K-Mistele
K-Mistele merged commit 3b1f144 into main Aug 20, 2026
5 checks passed
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