kimi-code/packages/klient/test
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
..
e2e feat(kap-server): push approvals and questions as interaction frames (#4428) 2026-10-27 12:43:12 +08:00
helpers feat(tui): unify skill prompts and steering (#4165) 2026-10-13 12:17:14 +08:00
contract-parity.ts feat(agent-core-v2): support api_key_env for provider credentials (#3762) 2026-09-17 22:02:53 +08:00
contract.test.ts feat: declare dynamically_loaded_tools for official models and add per-server MCP deferred disclosure (#3667) 2026-09-14 19:42:56 +08:00
facade.test.ts fix(agent-core-v2): reconnect MCP servers automatically after transient failures (#4283) 2026-10-27 11:24:42 +08:00
ipc.test.ts feat(agent-core-v2): add the unified MCP management plane (#3002) 2026-08-22 18:22:37 +08:00
memory.test.ts refactor(agent-core-v2): replace interaction DI services with a global human singleton (#3644) 2026-09-08 17:39:16 +08:00