Skip to content

Codex engine model setting is not honored when compiled as -c model=... #32413

@chrizbo

Description

@chrizbo

Summary

When an Agentic Workflow uses the Codex engine with an explicit model, gh-aw preserves the configured model in metadata and generated environment variables, but the Codex runtime still initializes and calls the Responses API with the default gpt-5.5 model.

This causes the GitHub Actions UI / gh-aw metadata to show the requested model while actual OpenAI usage is billed against gpt-5.5.

Workflow configuration

Source workflow frontmatter:

engine:
  id: codex
  model: openai/gpt-5-mini

This was compiled with:

gh aw compile --no-check-update
gh aw validate --no-check-update

Both compile and validate succeeded.

Generated lock / action behavior

The compiled lock file contains the expected model metadata and environment values, for example:

agent_model: openai/gpt-5-mini
GH_AW_INFO_MODEL: openai/gpt-5-mini
GH_AW_MODEL_AGENT_CODEX: openai/gpt-5-mini
GH_AW_MODEL_DETECTION_CODEX: openai/gpt-5-mini
GH_AW_ENGINE_MODEL: openai/gpt-5-mini

The generated action then invokes Codex like this:

codex -c model=openai/gpt-5-mini exec -c web_search=disabled -c fetch=disabled ...

Actual runtime behavior

In the completed Actions run, Codex still initialized with gpt-5.5 and sent gpt-5.5 to the Responses API.

Run: https://github.com/chrizbo/agentics-beyond-code/actions/runs/25925869595

Relevant log lines from the agent phase:

GH_AW_MODEL_AGENT_CODEX: openai/gpt-5-mini
[codex-harness] ... spawning: codex -c model=openai/gpt-5-mini exec ...
SessionConfiguredEvent ... model: "gpt-5.5", model_provider_id: "openai-proxy"
model_client.stream_responses_api{model=gpt-5.5 ...}

The detection phase showed the same pattern:

GH_AW_MODEL_DETECTION_CODEX: openai/gpt-5-mini
[codex-harness] ... spawning: codex -c model=openai/gpt-5-mini exec ...
SessionConfiguredEvent ... model: "gpt-5.5", model_provider_id: "openai-proxy"
model_client.stream_responses_api{model=gpt-5.5 ...}
POST ... /responses: {"model":"gpt-5.5", ...}

Expected behavior

When engine.model is set to openai/gpt-5-mini, the Codex runtime should use openai/gpt-5-mini or the resolved mini model, and the actual Responses API request should not fall back to gpt-5.5.

Impact

This makes cost controls unreliable. The workflow metadata and Actions UI imply the lower-cost model is being used, but OpenAI usage is actually billed at gpt-5.5 rates.

Possible fix

This looks like the generated Codex invocation may be using a config form that Codex 0.128.0 does not honor for model selection:

codex -c model=... exec ...

Codex CLI appears to expose a model flag (-m / --model). The gh-aw Codex engine template or harness may need to invoke Codex with the model flag form that Codex actually treats as a provided model, for example:

codex exec -m openai/gpt-5-mini ...

or the equivalent supported placement for the Codex CLI version used by gh-aw.

Versions / context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions