bug: codex module discards config that Codex writes into the managed block on restart
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- tooling
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- HCL
- Star
- 82
- Fork
- 172
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/registry
-
perplexica: deprecate or fixĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
coder/registry#1142 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Add a stale workflow for PRsĐang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
coder/registry#1120 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Dependency DashboardĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
coder/registry#1195 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
coder/registry#1187 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
sharkymark/templates/docker-claude: workspaces start with an error because tmux is not installedĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
coder/registry#1186 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của coder/registry
Issue tương tự
-
Add a just recipe that runs the workflow linters locallyCó thể đã có người làm @sgamelin đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/go-containerregistry#2491 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
gofish-graphics/gofish-graphics#1252 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stranded-follow-up sweep trusts any issue whose body carries the marker as the tracking issueĐang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nightgauge/nightgauge#2688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4860 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày