kimi-code/docs/zh/reference
qer 461c6e92d5
feat(kap-server): push approvals and questions as interaction frames (#4428)
* feat(kap-server): push approvals and questions as interaction events

Replace event.approval.* / event.question.* with a single volatile
interaction event carrying the draft Interaction shape. Every subscriber
of a session receives it, including interactions raised by sub-agents
whose transcripts are subscribed. After each subscribe ack the server
sends the session's pending interactions to that connection, so clients
rebuild their list on (re)subscribe instead of relying on journal replay.

Map engine-cancelled questions to cancelled instead of answered.

* docs: describe the interaction event in the server API reference

* chore: add changeset for the interaction event

* feat(kap-server): flatten interaction frames and unify the response route

Send `interaction` as a flat, unsequenced frame `{ type, session_id, agent_id,
event_created_at, interaction_id, kind, status, ... }` outside the event
envelope, add approval `expires_at`, and register the frame in the WS schema
and AsyncAPI document.

Replace `POST /sessions/{sid}/approvals/{id}`, `POST /sessions/{sid}/questions/{id}`
and `:dismiss` with `POST /sessions/{sid}/interactions/{id}`, whose body is
discriminated by `kind` and whose result is `{ outcome, ended_at }`; dismissing a
question now succeeds with code 0. Error codes become 40404 (interaction not
found), 40902 (interaction ended) and 40001 (kind mismatch).

* chore: update the interaction changeset for the unified response route

* feat(kap-server): remove the pending approval and question list routes

Pending interactions now reach clients only through the interaction frames
sent after each subscribe ack, so drop GET /sessions/{sid}/approvals and
GET /sessions/{sid}/questions with their schemas, docs and harness helpers.
The wire helpers still used by the WS broadcaster and the snapshot route move
to protocol/interaction-wire.ts.

* chore: note the removed list routes in the interaction changeset

* fix(transcript): require the engine cancellation shape for cancelled interactions

* refactor(kap-server): derive interaction outcomes in one place
2026-10-27 12:43:12 +08:00
..
keyboard.md feat(tui): refine fullscreen docks and transcript cards (#4310) 2026-10-26 15:08:59 +08:00
kimi-acp.md refactor(acp): remove the legacy acp-adapter package (#3434) 2026-09-01 23:59:20 +08:00
kimi-command.md feat: import Claude Code and Codex sessions (#4342) 2026-10-26 13:48:16 +08:00
server-api.md feat(kap-server): push approvals and questions as interaction frames (#4428) 2026-10-27 12:43:12 +08:00
slash-commands.md feat: import Claude Code and Codex sessions (#4342) 2026-10-26 13:48:16 +08:00
tools.md fix(agent-core-v2): return a stopped subagent's partial output to the parent agent (#4430) 2026-10-26 21:43:37 +08:00