Skip to content

[Feature]: Adapt Codex namespace tools for xAI/Grok Responses #696

Description

@Transparent0

Feature area

Request forwarding / API compatibility

Problem

Problem

When Codex Desktop calls grok-4.5 through CliRelay xAI OAuth, it posts to /v1/responses with tools[].type = "namespace".

Grok Build rejects the request with HTTP 422:

Failed to deserialize the JSON body into the target type: unknown variant `namespace`

Claude Code works with the same xAI credentials because it uses the Anthropic Messages route instead. The failure reproduces across two xAI OAuth accounts, so it is not tied to a single account or model availability.

Proposed solution

Please add xAI-specific Responses compatibility for Codex namespace tools:

  1. Flatten namespace child tools into qualified top-level function names before forwarding to Grok.
  2. Restore the original namespace/name when converting Grok function calls back to Codex Responses output.
  3. Keep the existing Codex/OpenAI GPT path unchanged.

This should be a provider-boundary adaptation rather than removing namespace tools globally.

Use case

Codex Desktop users who route Grok Build through CliRelay need normal coding tools and MCP/connectors. Without this compatibility, every Codex request containing a namespace tool is rejected before the model runs.

Are alternatives acceptable?

Yes, a simpler alternative is fine

Panel version

v0.4.11

Backend version

v0.4.11

Extra context

Upstream reference implementations:

No credentials, tokens, cookies, or private request payloads are included in this report.

Safety check

  • I have not included API keys, auth files, cookies, tokens, or other secrets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiRequest forwarding and API compatibilityarea:model-routingModels, routing, channel groups, and fallbackenhancementNew feature or requestsecuritySecurity-sensitive report or hardeningtriagedReviewed by the issue triage agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions