Feature request: let the interactive TUI answer approvals and questions through KAP, like Desktop and kimi web

Open
#5,508 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start by tracing the interactive TUI session lifecycle, its pending interaction handling, the existing interactions routes, and registration under server/instances/. The issue specifies a loopback server, the existing token, and product: "kimi-code-cli", with an optional config key. Done means external clients can list and answer the TUI session’s pending interactions through those routes, while the native panel remains usable and the first answer wins.

Written by the indexing model from the issue text.

Description

What feature would you like to see?

Let the interactive TUI (kimi) answer pending approvals and questions through KAP, the same way Kimi Code Desktop and kimi web / kimi rc already do.

When Desktop or kimi web hosts a session, an external tool can list its pending interactions with GET /api/v1/sessions/{id}/interactions and answer one with POST /api/v1/sessions/{id}/interactions/{interaction_id}. I build Vibe Island, a macOS notch panel for coding agents, and we use this to show approve / reject / answer buttons there next to the native card. Whichever side answers first wins, and the other side gets 40902. It works well.

The TUI has no equivalent:

  • It doesn't start a server or register anything under server/instances/.
  • Its pending interactions live only in its own process, so the Desktop server returns an empty list for a session the TUI is running. :takeover moves the lock, not the pending approval.
  • PermissionRequest hooks are fire-and-forget, so a hook can't answer either.

The only thing an external tool can do today is type keys into the terminal, which has no request identity and can land in the wrong place.

Proposal: while a TUI session is running, expose only the existing interactions routes (GET .../interactions, POST .../interactions/{interaction_id}) on a loopback server, using the same token. Register it in server/instances/ with product: "kimi-code-cli". The native TUI panel stays exactly as it is, and the first answer wins, as on Desktop. Opt-in behind a config key is fine.

External tools could then use one client for Desktop, kimi web and the TUI.

Additional information
  • Related: #1326 and #2960 (let hooks decide approvals), #2736 (attach to a live session).
    • This request is narrower. It adds no new protocol and no new decision semantics; it reuses the KAP interaction schema.
    • The answer is bound to the exact pending request (interaction_id is the same approval_<uuid> as PermissionRequest.id), which is the binding concern raised in #1326.
    • It doesn't touch prompts, shell or files.
  • Tested on macOS with Kimi Code Desktop 1.5.0 (core 2.8.0) and Kimi Code CLI 2.7.3.
Dominant language
TypeScript
Stars
8.3k
Forks
1.4k
Avg merge
12h 6m
Merged PRs (30d)
596

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MoonshotAI/kimi-code

All issues in MoonshotAI/kimi-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.