[Bug]: Kimi integration rewrites the whole config.toml, dropping comments and reshaping `[[hooks]]` into an inline array
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 }].
- Lingua principale
- TypeScript
- Stelle
- 16.9k
- Fork
- 1.3k
- Merge medio
- 1g 4h
- PR unite (30g)
- 814
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lidge-jun/opencodex
-
bug gui platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
lidge-jun/opencodex#9172 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log lineForse già presa @EnesKartal l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lidge-jun/opencodex#9057 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersForse già presa @sedoll l’ha presa 6 giorni fa. Apertacatalog provider provider-compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
lidge-jun/opencodex#9037 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
lidge-jun/opencodex#9171 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
account-pool enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lidge-jun/opencodex
Issue simili
-
manually bump balena-preload to ^19.0.6Forse già presa @shaunmulligan l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 66/100
balena-io/balena-cli#3200 ·
I maintainer di solito rispondono entro 1 giorno
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMForse già presa @olegius88 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melgarafael/DeskcommCRM#5340 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
I maintainer di solito rispondono entro 1 giorno