Tasks complete prematurely with custom model provider.

Resolved 💬 3 comments Opened Dec 12, 2025 by namasl Closed Dec 12, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.71.0

What subscription do you have?

None

Which model were you using?

gpt-oss-20b and gpt-oss-120b

What platform is your computer?

Linux 6.17.10-100.fc41.x86_64 x86_64 unknown

What issue are you seeing?

When using a custom model provider hosting gpt-oss-20b and gpt-oss-120b, the majority of requests in Codex run for a few seconds then stop, sometimes without any output. For example

› Perform a full code review. Don't skip any files.


• Explored
  └ List .
    Read __init__.py, file.py


› What did you find?

The first request "Perform a full code review. Don't skip any files." ran for about 15 seconds and stopped, only looking at a couple files. The follow-up question yields no response.

Some simple requests like "Create an empty file called r.txt" or "Delete the file r.txt" do complete successfully.

What steps can reproduce the bug?

Use a custom model provider, defining it in ~/.codex/config.toml

model = "openai/gpt-oss-20b"
model_provider = "rits"

[model_providers.rits]
requires_openai_auth = false
name = "RITS gpt-oss-20b"
base_url = "https://custom.url.com/gpt-oss-20b/v1"
wire_api = "chat"
env_http_headers = { "RITS_API_KEY" = "RITS_API_KEY" }

What is the expected behavior?

_No response_

Additional information

Performing similar actions when hosted locally with Ollama operate as expected (with codex --oss -m gpt-oss:20b).

View original on GitHub ↗

3 Comments

etraut-openai contributor · 8 months ago

This is model behavior, not the behavior of codex itself. The model behavior will obviously vary from one model to the next. The frontier coding models like gpt-5.1-codex-max are trained specifically for coding and are capable of completing much more complex coding tasks.

namasl · 8 months ago

Shouldn't gpt-oss-20b and gpt-oss-120b work well with Codex? Why would the behavior differ between locally hosted on Ollama and hosted on a remote endpoint (running vLLM)?

etraut-openai contributor · 8 months ago

The OSS models are significantly smaller and less capable than the frontier models, and they are not training specifically for coding tasks. They are capable of lightweight coding, but they are typically not great at larger tasks.

I'll also note that we don't recommend using the "chat" wire_api. We've announced that we will be removing support for it in the near future. Ollama doesn't yet support the newer (and recommend) "responses" wire API, but they're working on adding it. You could switch to LM Studio as a local oss model host. It supports the "responses" wire API.