Skip to content

[Compatibility] xai/grok-4.6 can skip Codex edit tools until explicitly reminded how to use tools #2048

Description

@goodwilliam0126

Client or integration

Codex App

Provider or upstream service

xAI (xai/grok-4.6)

OpenCodex version

2.25.0

I also observed the same class of behavior on 2.22.0; upgrading to 2.25.0 did not resolve it.

Endpoint or capability

/v1/responses — Codex tool use / file editing (apply_patch / code-mode edit helpers)

Current behaviour

xai/grok-4.6 can understand that a code change is required and say that it is going to modify the project, but then fail to actually invoke an editing tool or change the file.

The notable part is that the same session often recovers immediately after a follow-up such as:

Check how to use the available tools and continue.

After that reminder, Grok starts calling the appropriate tool(s) and performs the edit normally.

This makes the failure look less like a missing tool or a provider error and more like a tool-affordance / tool-guidance problem: the model appears capable of using the edit path once reminded how to use the available tools.

The behavior is intermittent rather than a hard 400/500 failure. A turn can complete successfully from the proxy's perspective while the requested file modification never happens.

Expected behaviour

When Codex advertises an editing path to xai/grok-4.6, the model should receive sufficiently accurate tool semantics/guidance to use that path without requiring the user to restate how tool usage works.

For a request that clearly requires a file modification, Grok should either:

  • invoke the advertised edit tool / code-mode helper and perform the edit; or
  • return an explicit recoverable tool error explaining why it cannot.

It should not simply claim that it will modify the file and then finish without any edit/tool call.

Minimal redacted request or reproduction

1. Run OpenCodex 2.25.0 and use Codex App with model xai/grok-4.6.
2. Open a normal code repository.
3. Ask Grok to make a concrete source-code change that requires editing one or more files.
4. Observe a failing run where Grok explains/plans the modification but no edit tool is invoked and the file remains unchanged.
5. In the same thread, send a follow-up equivalent to:
   "Check how to use the available tools and continue."
6. Observe that Grok then invokes the editing path and successfully modifies the file.
7. Verify with git diff that the file changed only after the tool-use reminder.

A larger or multi-step edit may reproduce more reliably than a trivial one-line change.

Actual response or error

No provider HTTP error is required to reproduce this.

Failing turn:
- model says it will perform the requested modification
- no effective edit tool call is made
- target file remains unchanged
- turn may otherwise complete normally

Follow-up after reminding the model to inspect/use its tools:
- edit/tool calls begin immediately
- requested file modification succeeds
- git diff shows the change

Upstream documentation

xAI function calling documentation:
https://docs.x.ai/developers/tools/function-calling

OpenCodex already has an internal investigation specifically for xai/grok-4.6 edit-tool affordance:
https://github.com/lidge-jun/opencodex/blob/main/devlog/_plan/260817_cursor_toolcall_decode/030_phase3-xai-apply-patch-affordance.md

That investigation notes that the Codex freeform/custom apply_patch contract is translated through the xAI openai-chat path, and that some of the original freeform contract is lost. It also correctly notes that a simple live probe succeeded, so this report is intended to provide a real failing user case rather than claim that the existing hypothesis is already proven.

Suggested mapping or implementation notes

The existing Phase 3 investigation looks relevant, but this report does not assume its proposed root cause is definitive.

Useful next checks may be:

  • capture the actual outgoing tool catalog/instructions on a failing xai/grok-4.6 turn;
  • compare the failing turn with the immediately succeeding turn after the user says to inspect tool usage;
  • distinguish top-level freeform apply_patch from code-mode tools.apply_patch / nested edit helpers;
  • test a larger or multi-file edit rather than only a one-line probe;
  • verify whether the model receives different tool guidance after continuation/history replay.

The most useful signal is that the model can perform the edit in the same conversation immediately after a tool-usage reminder.

Additional context and attachments

This is specifically the xai/grok-4.6 provider path in Codex App, not cursor/grok-4.6.

The issue remained reproducible after upgrading from OpenCodex 2.22.0 to 2.25.0, so Cursor-specific fixes such as #1673 / #1832 do not explain this case.

If needed, I can provide a redacted OpenCodex request/log capture from a failing run and the immediately succeeding run after the tool-usage reminder.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on a concrete Codex client requirement and xAI's documented function-calling interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoWaiting on reporter for a concrete spec or reproductionproviderProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions