Roo-Code/packages
Enrico Carlesso 03fb47c27f feat: migrate xAI provider to Responses API with reusable transform utilities
Migrate the xAI provider from the deprecated Chat Completions API to the
Responses API, add grok-4.20 as the new default model, and introduce shared
transform utilities for Responses API that other providers can adopt.

New shared utilities (src/api/transform/):
- responses-api-stream.ts: processResponsesApiStream() handles core
  Responses API stream events (text, reasoning, tool calls, usage) and
  createUsageNormalizer() provides configurable token/cost extraction.
  Designed for reuse by openai-native, openai-codex, or any future
  Responses API provider.
- responses-api-input.ts: convertToResponsesApiInput() converts directly
  from Anthropic message format to Responses API input format, avoiding
  the intermediate Chat Completions conversion step. Handles input_text,
  input_image, function_call, and function_call_output mappings.

xAI provider (src/api/providers/xai.ts):
- Switch from client.chat.completions.create() to client.responses.create()
- Use shared transform utilities for stream handling and input conversion
- Enable reasoning traces via include: ["reasoning.encrypted_content"]
- System prompt via instructions field, store: false for privacy
- completePrompt() also migrated to Responses API

Model updates (packages/types/src/providers/xai.ts):
- Add grok-4.20 as the new default model (2M context, $2/$6 pricing)
- Remove grok-4.20-beta-0309-reasoning and grok-4.20-beta-0309-non-reasoning
2026-03-19 16:10:54 -07:00
..
build Custom tool calling (#10083) 2025-12-21 12:43:06 -08:00
cloud feat: update cloud settings refresh interval to one hour (#11749) 2026-02-25 21:05:56 -08:00
config-eslint Upgrade to ESLint 9 + share eslint config across workspaces (#3815) 2025-05-21 21:30:21 -07:00
config-typescript Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
core feat(cli): add session resume/history and upgrade command (#11768) 2026-02-26 13:55:46 -08:00
evals Fix spelling/grammar and casing inconsistencies (#11485) 2026-02-24 14:22:22 -07:00
ipc feat: add DeleteQueuedMessage IPC command (#11464) 2026-02-18 10:42:48 -07:00
telemetry fix(condense): remove custom condensing model option (#10901) 2026-01-22 20:06:04 -05:00
types feat: migrate xAI provider to Responses API with reusable transform utilities 2026-03-19 16:10:54 -07:00
vscode-shim Some cleanup in ExtensionHost (#10600) 2026-01-10 02:29:33 -08:00