codex exec >= 0.144.0: no shell tool exposed when config uses a custom model_provider and omits `model`

Open
#34,758 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Reproduce with the default.config.toml custom model_provider configuration and the codex exec command, comparing versions before and after 0.144.0. Trace default-model resolution and command_execution tool exposure when the top-level model key is absent. Done means the nonce command produces a command_execution item without requiring model, while explicit-model configurations remain unaffected.

Written by the indexing model from the issue text.

Description

bug CLI config custom-model exec

Summary

Since codex-cli 0.144.0 (0.143.0 is the last good version — bisected across 0.140.0 / 0.142.5 / 0.143.0 ✅ vs 0.144.0 / 0.144.4 / 0.144.6 / 0.145.0 ❌), codex exec exposes no shell/exec tool to the model when config.toml uses a custom model_provider (an OpenAI-compatible proxy, wire_api = "responses") and does not set a top-level model key — i.e. when the CLI resolves its own default model.

The session still works — the model answers — but it cannot run any commands. Asked to run a command, it replies e.g. "I can't run shell commands in this session because no shell execution tool is available". Notably, for predictable commands it sometimes fabricates the output instead (it claimed to have run echo hello-from-shell and printed the expected text; a random-nonce file test proved no tool existed), which makes the failure easy to miss in automation.

Repro

$CODEX_HOME/default.config.toml:

model_provider = "custom"

[model_providers.custom]
name = "Custom OpenAI-compatible proxy"
base_url = "https://<your-openai-compatible-endpoint>/v1"
env_key = "CUSTOM_API_KEY"
wire_api = "responses"
openssl rand -hex 12 > nonce.txt
codex login --with-api-key   # key on stdin
codex exec --profile default --dangerously-bypass-approvals-and-sandbox --json --skip-git-repo-check \
  'A file named nonce.txt exists in the current directory. Run a shell command to print its contents and paste the exact value.'

Actual (>= 0.144.0): no command_execution item ever appears in the --json stream; the agent reports no execution tool is available (or fabricates plausible output for predictable commands).

Expected (<= 0.143.0 behavior): a command_execution item runs cat nonce.txt and the correct nonce is returned.

Workaround / trigger isolation

Adding an explicit top-level model key fully restores the shell tool — even when it names the exact model the CLI resolves natively anyway (observed gpt-5.6-sol in the session file's turn_context):

model = "openai/gpt-5.6-sol"   # same model the CLI picks by default → tools work again

The single deciding variable is the presence/absence of the model key; reasoning-effort/verbosity settings don't matter. Explicit-model configs are unaffected on all versions tested.

Environment

  • codex-cli 0.144.0–0.145.0 (npm @openai/codex), macOS arm64 + Linux x64 (musl)
  • Custom model_providers entry, wire_api = "responses", API-key auth
  • Isolated CODEX_HOME (clean config; no plugins)

Happy to provide full --json transcripts of the good/bad versions if useful.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.