Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Agent tool ignores requested model and always runs default (gpt‑5.2‑codex) #532

@carljuneau

Description

@carljuneau

What version of Code is running?

0.6.50

Which model were you using?

Requested: claude-opus-4.5 and gemini-3-pro via agent.create Actual: gpt-5.2-codex (per agent logs)

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell 7.5.4 (pwsh.exe)

What steps can reproduce the bug?

  1. Ensure ~/.code/config.toml has Claude/Gemini agents enabled (or defaults).
  2. Call agent.create with a non‑GPT model, e.g. models=["claude-opus-4.5"] or models=["gemini-3-pro"].
  3. Inspect .code/agents//result.txt: it reports model: gpt-5.2-codex / provider: openai.

Minimal repro snippet:
┌ text ─────────────────────────────────────────────────────────┐
│ agent.create({ models: ["claude-opus-4.5"], write: false }) │
│ # result.txt shows: model: gpt-5.2-codex │
└───────────────────────────────────────────────────────────────┘

What is the expected behavior?

The agent should run with the requested provider/model, or fail with a clear error if it can’t.

What do you see instead?

The agent runs on the default model (gpt-5.2-codex) and ignores the requested model list.

Additional information

Tried agent.create with models=["claude-opus-4.5"] and models=["gemini-3-pro"] → agent logs still show model: gpt-5.2-codex (did not switch).

  • Verified CLIs: claude --version and gemini --version succeed.
  • Set explicit CLI paths in ~/.code/config.toml for Claude/Gemini agents.
  • Added model flags in ~/.code/config.toml (--model opus, --model gemini-3-pro).
  • Claude direct CLI via wrapper scripts/run-subagent.ps1 → worked (Claude OK).
  • Gemini direct CLI via wrapper → failed (ModelNotFoundError for gemini-3-pro).
  • coder exec -c model_provider=gemini → failed (provider not found in Code CLI).
  • Internal /code via coder exec --auto → still GPT; no Claude/Gemini dispatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions