[Bug]: Kimi integration rewrites the whole config.toml, dropping comments and reshaping `[[hooks]]` into an inline array
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start by tracing the Kimi integration's read and write path that uses Bun.TOML.parse and renderToml; inspect the before and after snapshots in integrations/snapshots/kimi/. Check how the DSH integration uses sourcePreservingYaml for comparison. Done means Kimi overwrite and disable operations update only OpenCodex-owned keys while preserving comments, [[hooks]] tables, and the rest of the file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- OpenCodex 2.100.8 (macOS 27.2.1)
- Kimi Code CLI 2.8.0
- Orca 1.4.277 manages a hooks block in the same
~/.kimi-code/config.toml
What happened
Each Kimi overwrite or disable operation (both appear in ~/.opencodex/integrations/journal.jsonl) reads config.toml with Bun.TOML.parse and writes the whole document back with renderToml. The rewrite has three side effects:
- All comments are lost, including the
# >>> orca-managed-kimi-hooks … >>>/<<<markers that another tool uses to find the block it owns. - Arrays of tables are flattened.
renderTomltreats any non-record value as a scalar, so the 9[[hooks]]tables become one top-level inline array:hooks = [{ event = "SessionStart", … }, …]. That is still valid TOML, but no other tool would expect that layout. - Key order and formatting change throughout the file, not just in the
providers.opencodex/models."opencodex/…"entries the integration owns.
The integration's own pre-write snapshots in integrations/snapshots/kimi/ show the before and after: the snapshot before the overwrite has the marker block and 9 [[hooks]] tables; the snapshot before the disable (taken 4 seconds later) has an inline hooks = [...] line and no comments.
Downstream effect: Orca no longer finds its markers, reinstalls its hooks block, and the file ends up with hooks defined twice. Kimi then fails to load the config (Cannot mutate immutable namespace ('hooks',)), and every Kimi call fails until someone fixes the file by hand. This happened twice in four days (one overwrite, then one overwrite + disable).
Expected
Edit only the keys the integration owns and preserve everything else byte for byte. The DSH integration already does this through sourcePreservingYaml; Kimi's TOML could use the same approach:
- Use a format-preserving TOML edit (a comment- and layout-preserving TOML library, or targeted text splicing of the
[providers.opencodex]table and the[models."opencodex/…"]tables). - At minimum,
renderTomlshould emit arrays of tables as[[name]]sections rather than inline arrays, and keep top-level comments.
Repro
- Put a comment and an array of tables in
~/.kimi-code/config.toml:
# keep me
default_model = "kimi-code/k3.1-pro"
[[hooks]]
event = "Stop"
command = "echo hi"
timeout = 10
- Enable, refresh, or disable the Kimi integration in OpenCodex.
- The comment is gone and the hook is now
hooks = [{ event = "Stop", command = "echo hi", timeout = 10 }].
- Ngôn ngữ chính
- TypeScript
- Star
- 16.9k
- Fork
- 1.3k
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 814
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 lidge-jun/opencodex
-
bug gui platform
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
lidge-jun/opencodex#9172 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log lineCó thể đã có người làm @EnesKartal đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
lidge-jun/opencodex#9057 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersCó thể đã có người làm @sedoll đã nhận 6 ngày trước. Đang mởcatalog provider provider-compatibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
lidge-jun/opencodex#9037 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
lidge-jun/opencodex#9171 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
account-pool enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của lidge-jun/opencodex
Issue tương tự
-
manually bump balena-preload to ^19.0.6Có thể đã có người làm @shaunmulligan đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 66/100
balena-io/balena-cli#3200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMCó thể đã có người làm @olegius88 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
melgarafael/DeskcommCRM#5340 ·
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 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày