Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug: codex module discards config that Codex writes into the managed block on restart

Aperta
#1,218 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

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

bug
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
  1. Create a workspace that uses the module (5.4.2), and let it start.
  2. In Codex, install a plugin that has hooks and trust them. Codex writes [hooks.state."<plugin>:hooks/hooks.json:..."] tables to config.toml, inside the managed block.
  3. Restart the workspace.
  4. 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

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 coder/registry

Tutte le issue di coder/registry

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.