--- name: xai-compat version: 1.0.0 description: Keep agent requests and tool loops compatible with xAI chat/responses semantics, reasoning summaries, and streaming behavior. tags: [xai, compatibility, streaming, tools, reasoning] requires: [edit_agent_config, run_command] --- # xai-compat Use this skill when provider is `xai` or when debugging xAI tool/reasoning behavior. ## Baseline configuration 1. Ensure: - `provider = "xai"` - `rest_base_url = "https://api.x.ai/v1"` 2. Prefer `reasoning_mode = "trace"` for observability when summaries are sparse. 3. Keep `stream = true` for tool-call visibility and progressive diagnostics. ## Tool calling expectations - xAI supports OpenAI-compatible function tools on chat completions. - `parallel_tool_calls` can be enabled; process all returned tool calls before continuing. - Keep tool schemas explicit and bounded. ## Reasoning expectations - Reasoning models may expose `reasoning_content` summaries, but availability can vary by model/endpoint. - In trace mode, rely on local process lines even when no reasoning summary deltas arrive. ## Debug checklist 1. Verify provider/base URL in `~/.agent/config.json`. 2. Run with `reasoning_mode=trace`. 3. Check for tool-call chunks and usage tokens in stream output. 4. If reasoning deltas are absent, treat this as provider/model behavior and continue with trace-level progress lines.