#Codex Harness w/ other models?

1 messages · Page 1 of 1 (latest)

neat mango
#

im trying to figure out how to have my main agent use the codex harness but still be able to switch to other models like minimax 2.7 via /models in telegram. Currently using pi harness with openai oauth and minimax coding plan oauth

i also have another agent on the codex harness with gpt 5.5 but i dont need it to switch to other model providers so not having the same issue

brisk valveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

obtuse mantleBOT
#

Quick sanity check first: what does openclaw --version show? Version matters a lot here.

But the shape you want is: don’t make the whole main agent “Codex harness.” Make the main agent’s default model an OpenAI model that auto-selects Codex, and leave other providers free to use PI.

Recommended config shape:

{
  plugins: {
    entries: {
      codex: { enabled: true }
    }
  },
  agents: {
    defaults: {
      model: "openai/gpt-5.5",
#
      models: {
        "openai/gpt-5.5": {},
        "minimax-portal/*": {}
      }
    }
  }
}

Then auth should be:

openclaw models auth login --provider openai-codex
openclaw onboard --auth-choice minimax-global-oauth
# or minimax-cn-oauth if you use the China endpoint
#

Important bits:

  • For Codex subscription auth, the model ref should still be openai/gpt-5.5, not openai-codex/gpt-5.5.
  • openai/* agent turns use the Codex app-server runtime by default when the codex plugin is enabled.
  • MiniMax Coding Plan OAuth uses provider id minimax-portal, so the chat model ref is like minimax-portal/MiniMax-M2.7.
  • If you have an allowlist at agents.defaults.models, /models in Telegram will only show/select what’s in that allowlist. Add minimax-portal/* or the exact minimax-portal/MiniMax-M2.7.
  • Avoid any provider/model runtime policy that forces agentRuntime: { id: "codex" } on MiniMax. Codex only makes sense for OpenAI/Codex app-server turns; MiniMax should fall back to PI.
  • After changing runtime/plugin config, restart the gateway and use /new or /reset in the Telegram chat before testing.

Docs: https://docs.openclaw.ai/plugins/codex-harness and https://docs.openclaw.ai/concepts/agent-runtimes

neat mango
#

im on 5.7

obtuse mantleBOT
#

Nice — on 5.7 this should be the newer runtime-split behavior, so the mixed setup should work.

The key correction is probably this:

Don’t configure the main agent as “PI harness” or “Codex harness” globally. Let runtime be selected per provider/model:

  • default OpenAI model ref → Codex runtime
  • MiniMax selected via /models → PI/runtime-compatible provider path

So check your config for any old/global runtime pin like:

agents: {
  defaults: {
    agentRuntime: ...
  }
#
}

or session/runtime override leftovers. Those are legacy-ish and can make this confusing. Run:

openclaw doctor --fix

Then make sure your model allowlist includes both the OpenAI model you use for Codex and MiniMax Coding Plan OAuth, e.g. provider-wide:

agents: {
  defaults: {
    model: "openai/<your-codex-model>",
#
    models: {
      "openai/*": {},
      "minimax-portal/*": {}
    }
  }
}

If you want to be stricter, use exact refs instead of *, but minimax-portal/* is usually nicer for /models in Telegram.

Then restart gateway and in Telegram do /new or /reset, then /models → pick MiniMax. If it still tries to run MiniMax through Codex, that means there’s likely an explicit agentRuntime: { id: "codex" } attached too broadly in agents.defaults.models or models.providers.

azure furnace
#

Thank you, I have the same question!

obtuse mantleBOT
#

Short answer: if the same agent needs to switch to MiniMax/other providers via /models, don’t set agentRuntime.id: "codex" globally on that agent.

Current recommended shape is:

{
  plugins: {
    entries: {
      codex: { enabled: true }
    }
  },
  agents: {
    defaults: {
      agentRuntime: { id: "auto" }
    },
    list: [
#
      {
        id: "main",
        default: true,
        model: "minimax-portal/MiniMax-M2.7"
        // or whatever your normal mixed-provider default is
      },
      {
        id: "codex",
        name: "Codex",
        model: "openai/gpt-5.5",
        agentRuntime: { id: "codex" }
      }
    ]
  }
}