Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ACP mode: agent keeps emitting updates for terminals the client no longer has after session resume (Zed drops them, replies/plan updates lost)

Aperta
#3,959 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Ambito
api, backend

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

  1. In Zed, run an ACP thread with Kimi; have the agent execute shell commands / spawn background tasks (agent-side terminals get created).
  2. Restart Zed while the Kimi session persists under ~/.kimi-code/sessions/.
  3. Resume the same thread from history.
  4. 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 ACP fs/read_text_file bridge even when they don't exist, producing Resource not found warnings 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MoonshotAI/kimi-code

Tutte le issue di MoonshotAI/kimi-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.