Skip to content

[Bug]: Invalid arguments error with Venice provider using xAI/Grok models (grok-4.1-fast) #34955

@Rutimka

Description

@Rutimka

Bug type

Regression (introduced by #32080)

Summary

The fix in #32080 strips unsupported JSON Schema keywords for xAI models, but the isXaiProvider() detection does not cover the Venice provider. When Venice serves xAI/Grok models (e.g. grok-4.1-fast), the provider string is venice — which contains neither xai nor x-ai — so the schema cleaning is skipped and requests fail with the same error.

[agent/embedded] embedded run agent end: ... error=Invalid arguments passed to the model.

Steps to reproduce

  1. Configure OpenClaw with Venice as provider and a Grok model as primary:
"agents": {
  "defaults": {
    "model": {
      "primary": "venice/grok-4.1-fast"
    }
  }
}
  1. Send any agent request.

Expected behavior

Request succeeds (same as with other models on Venice).

Actual behavior

Invalid arguments passed to the model — identical to the OpenRouter/xAI failure fixed in #32080.

Root cause

isXaiProvider() in src/agents/schema/clean-for-xai.ts only checks for:

  • provider string containing xai or x-ai
  • openrouter + model prefix x-ai/

It does not handle the case where Venice proxies xAI/Grok models. The model ID on Venice is just grok-4.1-fast (no x-ai/ prefix), so neither heuristic matches.

Suggested fix

Extend isXaiProvider() to also detect Venice + Grok model IDs, similar to the existing OpenRouter branch:

// Venice proxies xAI/Grok models; model IDs start with "grok-"
if (provider === "venice" && modelId?.toLowerCase().startsWith("grok-")) {
  return true;
}

OpenClaw version

2026.3.2 (main)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions