bug: codex module discards config that Codex writes into the managed block on restart
I maintainer di solito rispondono entro 2 giorni
@35C4n0r ci sta già lavorando.
Dal 29/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- tooling
Direzione di ricerca
Start with registry/coder-labs/modules/codex/scripts/install.sh.tftpl, especially populate_config_toml(), and trace how it replaces the managed block. Reproduce the Codex config/batchWrite placements described in the issue, then check that [hooks.state.*], project trust, and MCP server entries survive a workspace restart.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current Behavior
The coder-labs/codex module regenerates everything between # >>> coder-managed: codex module >>> and # <<< coder-managed: codex module <<< in config.toml on every workspace start. Codex also writes to config.toml while it runs, and those writes land inside the managed block, so the next start discards them.
The most visible case is hook trust. Codex runs a plugin's hooks only once they are trusted, and it records that trust as [hooks.state.*] tables. After every workspace restart, every plugin hook is untrusted again. Interactive sessions ask for trust again, codex exec skips the hooks without saying so, and clients that can't show the trust prompt never run them. Codex also writes hook trust itself when it installs or updates a plugin, so a plugin installed by default arrives trusted and loses that trust at the next restart.
The writes land in the block because of where Codex inserts new tables. When the file has no tables below the block, the end marker is the last line, and Codex inserts new tables ahead of it. When related tables already exist, Codex inserts the new table next to them, so a new [mcp_servers.*] table goes next to the module's own [mcp_servers.*] tables even when the file has content below the block. With Codex 0.165.0, through Codex's own config API (config/batchWrite on codex app-server):
| Codex writes | Where it lands |
|---|---|
[hooks.state.*] (hook trust) |
At the end of the managed block |
[projects."<path>"] (project trust) |
At the end of the managed block |
[mcp_servers.<name>] |
Next to the module's [mcp_servers.*] tables |
populate_config_toml() keeps content above and below the block and replaces the block wholesale.
Steps to Reproduce
- Create a workspace that uses the module (5.4.2), and let it start.
- In Codex, install a plugin that has hooks and trust them. Codex writes
[hooks.state."<plugin>:hooks/hooks.json:..."]tables toconfig.toml, inside the managed block. - Restart the workspace.
- Check
config.toml: the[hooks.state.*]tables are gone, and Codex reports the plugin's hooks as untrusted.
Expected Behavior
Configuration that Codex writes while it runs, such as hook trust, project trust and MCP servers, should survive a workspace restart.
- Lingua principale
- HCL
- Stelle
- 82
- Fork
- 172
- Merge medio
- 2g 22h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/registry
-
perplexica: deprecate or fixAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
coder/registry#1142 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Add a stale workflow for PRsAperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
coder/registry#1120 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Dependency DashboardAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
coder/registry#1195 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
coder/registry#1187 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
sharkymark/templates/docker-claude: workspaces start with an error because tmux is not installedAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
coder/registry#1186 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di coder/registry
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lewis6991/gitsigns.nvim#1607 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
all-contributors/cli#587 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-butler-finding chore
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
jordansmall/spindrift#6218 ·
I maintainer di solito rispondono entro 1 giorno
-
Add 'upm' tag on githubAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100