Codex sandbox template seeds MCP gateway config with keys Codex does not recognize (type, headers)

Aperta Adatta ai principianti
#721 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker
Ambito
tooling

Direzione di ricerca

Trova il template della sandbox codex-docker che inizializza ~/.codex/config.toml e ispeziona le relative impostazioni [mcp_servers.mcp-gateway]. Confronta le chiavi con codex mcp add --help oppure verificale usando codex mcp get mcp-gateway. Il lavoro è completato quando il template usa impostazioni accettate, l'avviso scompare e l'header Authorization configurato compare sotto http_headers.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

platform/macos
Bug report

Bug description

The codex-docker sandbox template seeds ~/.codex/config.toml with two MCP keys that the bundled Codex CLI does not recognize. Codex prints this on every start:

Codex is ignoring 2 unrecognized configuration settings. Check for typos or deprecated settings.
  user (/home/agent/.codex/config.toml): `mcp_servers.mcp-gateway.headers` is ignored.
  user (/home/agent/.codex/config.toml): `mcp_servers.mcp-gateway.type` is ignored.

The seeded block is:

[mcp_servers.mcp-gateway]
type = "http"
url = "http://mcp-gateway.docker.internal/mcp"
[mcp_servers.mcp-gateway.headers]
Authorization = "Bearer proxy-managed"

Two separate problems:

  1. type is not a Codex key. Transport is inferred from url, so this one is merely redundant.
  2. headers is the wrong key name. Codex uses http_headers (see codex mcp add --help, which lists --bearer-token-env-var and the http_headers / env_http_headers / http_headers_helper fields). Because the table is ignored, the Authorization header is never sent to the gateway:
$ codex mcp get mcp-gateway
mcp-gateway
  enabled: true
  transport: streamable_http
  url: http://mcp-gateway.docker.internal/mcp
  bearer_token_env_var: -
  http_headers: -
  env_http_headers: -
  http_headers_helper: -

codex mcp list likewise reports Auth: Unsupported.

In practice the gateway answers with or without the header (POST /mcp returns 200 either way, so the sandbox egress proxy appears to handle auth), which makes this cosmetic today. It would stop being cosmetic for any gateway that actually enforces the bearer token, and the per-start warning is confusing because it points at a file the user did not write.

Renaming the table to http_headers and dropping type clears the warning and makes the header take effect:

$ codex mcp get mcp-gateway
  http_headers: Authorization=*****

Reproduction steps

sbx create --name codex-repro codex .
sbx exec codex-repro sh -c 'sed -n "/mcp_servers/,\$p" ~/.codex/config.toml'
sbx exec codex-repro codex exec --skip-git-repo-check "hi"   # prints the warning
sbx exec codex-repro codex mcp get mcp-gateway               # http_headers: -

Expected

The template writes MCP settings using the key names the bundled Codex version accepts, so no unrecognized-setting warning is printed and the configured Authorization header is actually applied.

Platform

macOS

Version information
sbx version: v0.46.0 991967dc90ce0d9a440cd1df1bdf3e395c5a2693
image: docker/sandbox-templates:codex-docker
codex-cli (in sandbox): 0.149.1
Docker Engine: 29.8.1
Host: macOS, Apple Silicon
Sandbox OS: Ubuntu 26.4.0, linux-aarch64
Diagnostics ID

No response

Lingua principale
Nessun dato sulla lingua
Stelle
53
Fork
24
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di docker/desktop-feedback

Tutte le issue di docker/desktop-feedback

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.