ACP mode: agent keeps emitting updates for terminals the client no longer has after session resume (Zed drops them, replies/plan updates lost)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start at the kimi acp session/load handling and trace how terminal IDs are retained and emitted after a client reconnects. Reproduce by resuming a session under ~/.kimi-code/sessions/ in Zed, then verify that terminals are re-created or stale terminal updates are pruned so replies and plan updates continue reaching the client.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Repository to file at: https://github.com/MoonshotAI/kimi-code/issues/new
Summary
When Kimi Code runs as an ACP agent inside Zed (kimi acp), restarting the editor and resuming the previous thread leads to a persistent stream of failed session updates on the client side. Zed logs show, every ~20–60 seconds for the whole life of the resumed session:
ERROR [agent_servers::acp] Failed to handle session update for SessionId("session_f8adf072-..."):
Error { code: -32603, message: "Internal error",
data: "Terminal with id `7cf4c5dd-90ca-4408-a013-bc01993b1259` not found" }
Because Zed drops the failed update entirely, users lose live content: parts of agent/subagent replies never appear, tool-call statuses freeze, and the ACP Plan panel stops checking off completed entries (e.g. stuck at "4/8" while the agent has actually finished the tasks). The data itself is intact in Kimi's session store — reopening the thread after a restart displays the "missing" replies.
Environment
- Kimi Code CLI: 0.43.1 (latest per CDN as of 2026-09-16)
- Client: Zed v1.20.2 (Flathub flatpak), ACP custom agent server:
command = "kimi", args = ["acp"] - OS: Fedora Linux (KDE), x86_64
Steps to reproduce
- In Zed, run an ACP thread with Kimi; have the agent execute shell commands / spawn background tasks (agent-side terminals get created).
- Restart Zed while the Kimi session persists under
~/.kimi-code/sessions/. - Resume the same thread from history.
- Keep working: errors fire continuously and parts of the UI stream are lost.
Expected behavior
On session/load (or when a client reconnects), the agent should re-establish terminal state with the client — re-create terminals, or stop emitting terminal updates for IDs the client has never created in its current lifetime. Live updates should reach the client regardless of restarts.
Actual behavior
The agent keeps sending updates referencing terminal IDs from before the client restart. The client cannot resolve them and discards each such update, so replies and plan updates silently vanish until the user starts a brand-new thread.
Client log evidence (Zed side): 275 occurrences in the current log file, 494 in the rotated one, spanning multiple days (2026-09-19 → 2026-09-21), all against the same resumed SessionId.
Additional notes
- Minor: the agent probes
AGENTS.md/ temp output files through the ACPfs/read_text_filebridge even when they don't exist, producingResource not foundwarnings client-side. Not harmful, but could be checked locally first. - User-side workaround: always start a new thread after a Zed restart; never resume threads that had background tasks/terminals.
Possible fix direction
Track terminal IDs per client connection; on session/load either re-announce/re-create live terminals or prune terminal references that predate the connection.
- Lingua principale
- TypeScript
- Stelle
- 7.7k
- Fork
- 1.3k
- Merge medio
- 13h 11m
- PR unite (30g)
- 298
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 MoonshotAI/kimi-code
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MoonshotAI/kimi-code#4097 ·
I maintainer di solito rispondono entro 1 giorno
-
手机竖屏显示状态下输入框的扩展按钮没有显示Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MoonshotAI/kimi-code#4040 ·
I maintainer di solito rispondono entro 1 giorno
-
顶栏字体不随字体大小缩放bugApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MoonshotAI/kimi-code#4039 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
MoonshotAI/kimi-code#4010 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MoonshotAI/kimi-code#4008 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MoonshotAI/kimi-code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
siyuan-note/siyuan#20040 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RunestoneInteractive/rs#1574 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
remotion-dev/remotion#11901 ·
I maintainer di solito rispondono entro 1 giorno
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionApertabug need repro packages:discord.js
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
discordjs/discord.js#11645 ·
I maintainer di solito rispondono entro 3 giorni
-
🐞 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sitecore/content-sdk#641 ·
I maintainer di solito rispondono entro 2 giorni