[Bug]: Kimi integration rewrites the whole config.toml, dropping comments and reshaping `[[hooks]]` into an inline array
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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 }].
- 主要言語
- TypeScript
- スター
- 16.9k
- フォーク
- 1.3k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 814
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lidge-jun/opencodex のほかの issue
-
bug gui platform
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
lidge-jun/opencodex#9172 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log line対応中かも @EnesKartal が 4 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lidge-jun/opencodex#9057 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offers対応中かも @sedoll が 6 日前に担当しました。 オープンcatalog provider provider-compatibility
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
lidge-jun/opencodex#9037 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug cli
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
lidge-jun/opencodex#9171 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
account-pool enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
lidge-jun/opencodex の issue をすべて見る
似ている issue
-
manually bump balena-preload to ^19.0.6対応中かも @shaunmulligan が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 66/100
balena-io/balena-cli#3200 ·
メンテナーはふだん 1 日以内に返信
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOM対応中かも @olegius88 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melgarafael/DeskcommCRM#5340 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
メンテナーはふだん 1 日以内に返信