Skip to content

Feature: forward extra args (custom model_provider / profile) to every codex launch #418

Open

Description

@klmklmnb

Problem

Today the plugin only forwards --model and --effort to Codex, and the app-server is always spawned as a bare codex app-server (see plugins/codex/scripts/lib/app-server.mjs). There is no way to pass Codex global overrides such as:

  • -c model_provider=<id> to select a custom provider
  • --profile <name>
  • other -c key=value config overrides

The only workaround is editing ~/.codex/config.toml / .codex/config.toml, which is awkward when you want a plugin-specific provider (e.g. routing the plugin through a LiteLLM/proxy provider) without changing your global Codex defaults.

Proposed solution

Add a CODEX_PLUGIN_CC_ARGS environment variable. When set, its value is tokenized (shell-style) and prepended to every codex invocation the plugin makes — the app-server runtime spawn and the availability checks. For example:

export CODEX_PLUGIN_CC_ARGS='-c model_provider=litellm'

results in the plugin running codex -c model_provider=litellm app-server.

This keeps the change opt-in, requires no per-command flags, and reuses Codex's own config-override surface.

Notes

  • Read at runtime start; a session that already has a shared runtime needs a fresh session for new values to take effect.
  • I have an implementation ready and will open a PR referencing this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions