bug: codex module discards config that Codex writes into the managed block on restart
メンテナーはふだん 2 日以内に返信
@35C4n0r がすでに取り組んでいます。
2026年10月29日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- HCL
- スター
- 82
- フォーク
- 172
- 平均マージ
- 3日 8時間
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/registry のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
coder/registry#1142 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 68/100
coder/registry#1120 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Dependency Dashboard対応中かも @phorcys420 が 2 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
coder/registry#1195 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
coder/registry#1187 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
sharkymark/templates/docker-claude: workspaces start with an error because tmux is not installedオープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
coder/registry#1186 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
bug good first issue help wanted workshop
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
EclipseFdn/open-vsx.org#15057 ·
メンテナーはふだん 1 日以内に返信
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackers対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンagent-butler-finding bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
jordansmall/spindrift#6238 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
midudev/better-claude#42 ·
メンテナーはふだん 1 日以内に返信
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
MetricsHub/metricshub-community#1472 ·
メンテナーはふだん 1 日以内に返信