Skip to content

fix: support --model for codex sessions#128

Open
Asm3r96 wants to merge 1 commit intoopenclaw:mainfrom
Asm3r96:fix-codex-model-flag
Open

fix: support --model for codex sessions#128
Asm3r96 wants to merge 1 commit intoopenclaw:mainfrom
Asm3r96:fix-codex-model-flag

Conversation

@Asm3r96
Copy link
Copy Markdown

@Asm3r96 Asm3r96 commented Mar 12, 2026

Summary

  • apply Codex --model after session/new via session/set_config_option
  • normalize common Codex model aliases like GPT-5-2 to gpt-5.2
  • add tests and sync Codex-facing docs

Closes #49

Validation

  • used Codex to help develop this PR
  • tested locally against a real running Codex session and confirmed the requested model was applied
  • ran local tests with pnpm run test and they passed
  • did a manual human end-to-end check locally

Notes

  • pnpm run check in this environment still fails at the repo-wide coverage gate due to overall baseline coverage totals that are unrelated to this change

@dutifulbob
Copy link
Copy Markdown
Collaborator

Triage result

Human attention: ⚠️ Required
Recommendation: 🏁 escalate to a human
Human decision needed: ready for human landing decision

Quick read

This PR is a narrow bug fix for Codex model selection. It applies --model to Codex sessions after session/new via session/set_config_option, normalizes common aliases like GPT-5-2 to gpt-5.2, adds focused tests, and updates Codex-facing docs.

Intent

Make the existing --model flag actually work for Codex sessions, including on session creation, and accept common GPT-style model aliases users are likely to type.

Why

acpx was already threading model selection through Claude-style session metadata, but Codex ACP does not reliably honor that path. As a result, Codex sessions could stay on the default model even when the user passed --model. This PR addresses that Codex-specific gap directly in the session creation/config path.

Codex review

GitHub Codex review data for the current head was empty.

Local Codex review ran successfully and produced usable output. It reported two P2, non-blocking concerns:

  • prompt-time session recreation may still ignore --model in some reconnect/recreate paths
  • the new Codex model normalizer lowercases arbitrary model IDs, which could affect custom or case-sensitive IDs

No P0 or P1 findings remained, so autonomous review treated the PR as clear to continue.

CI/CD

Targeted regression validation reproduced and confirmed the fix:

  • passed on PR head
  • failed after local-only ablation of the code change
  • passed again after restoring the PR branch state

Targeted validation commands:

  • pnpm run build:test
  • node --test dist-test/test/cli.test.js dist-test/test/client.test.js dist-test/test/prompt-runner.test.js

CI status:

  • the PR workflow was initially approval-blocked
  • approval was applied successfully
  • the rerun completed green
  • remaining annotations were only non-blocking GitHub Actions deprecation warnings for pnpm/action-setup@v4

Merge status:

  • initial conflict check: clean
  • final conflict check: clean

Recommendation

Escalate to a human for landing judgment. The autonomous lane found the fix good enough, validation confirmed the regression and fix, CI is green, and no merge conflicts remain. The remaining decision is whether the non-blocking P2 Codex review notes should be addressed now or deferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --model and --allowed-tools flags for agent passthrough

2 participants