Skip to content

Status line reports api-key (env: OPENAI_API_KEY) even when codex runtime is authenticated via ChatGPT #91099

Description

@ukstem

Version: OpenClaw 2026.5.28 (e932160)
OS: Debian Trixie, ARM64 (Raspberry Pi 4), Node 22

Summary:
The agent status output (Telegram/CLI) shows api-key (env: OPENAI_API_KEY) for the OpenAI Codex runtime even after all API-key sources have been removed and the embedded codex runtime is authenticated via ChatGPT login.

Steps to reproduce:

  1. Configure the codex runtime to use a ChatGPT login (device-auth) so codex-home/auth.json has auth_mode: chatgpt with no OPENAI_API_KEY field.
  2. Remove OPENAI_API_KEY from: the gateway EnvironmentFile, the openai:default profile in auth-profiles.json, and the OPENCLAW_SERVICE_MANAGED_ENV_KEYS list in the gateway unit.
  3. Restart the gateway. Confirm CODEX_HOME=<codex-home> codex login status returns "Logged in using ChatGPT".
  4. Run a status check.

Expected: Status reflects ChatGPT auth.
Actual: Status still prints api-key (env: OPENAI_API_KEY).

Notes: Actual auth is correct (verified via codex login status against the runtime's CODEX_HOME, and codex-home/auth.json showing auth_mode: chatgpt). The label appears to derive from the presence of OPENAI_API_KEY in OPENCLAW_SERVICE_MANAGED_ENV_KEYS / env-name detection rather than the resolved runtime auth mode — i.e. a reporting bug, not an auth bug.

Do not include any real API keys, tokens, or the user's username. After posting, return the issue URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions