kap-server: expose parent turn/prompt correlation on public WS and history records for steered inputs

Aperta
#5,227 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
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
api, backend

Direzione di ricerca

Start in packages/kap-server/src/routes/prompts.ts, where the internal prompt.steered signal already carries activePromptId and promptIds, and trace from there to where public WebSocket turn events are emitted and where session history records are persisted. The open work is a schema decision plus threading the parent turn/prompt id through both the live event path and the stored record path so it survives a kimi web restart, which also relates to the queue work in #4959. Done looks like a steered input appearing on the public stream and in reloaded history with an explicit parent reference, covered by the held-tool live and replay tests the reporter offers.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What feature would you like to see?

When a client steers an active turn via POST /api/v1/sessions/{session_id}/steer or promotes a queued prompt via POST /api/v1/sessions/{session_id}/prompts::steer, expose the relationship to the active parent turn/prompt on public KAP WebSocket events and persisted session history records (preserved across server restarts).

Additional information

We tested @moonshot-ai/[email protected] (1781dbd7) on Linux x64, Windows x64, and macOS arm64 against a local model provider while holding a shell tool open:

  • Both POST /api/v1/sessions/{session_id}/steer and POST /api/v1/sessions/{session_id}/prompts::steer inject the steered input into the very next provider request and execute its action once.
  • On the public KAP WebSocket stream and in persisted session history (packages/kap-server/src/routes/prompts.ts), however, the active turn closes and the steered input is emitted and stored as a separate completed turn (turn 0 original, turn 1 steered, turn 2 next ordinary prompt) with no field linking the steered turn back to the parent turn it steered. The same unlinked records appear when reloading after restarting kimi web.
  • packages/kap-server/src/routes/prompts.ts already consumes an internal prompt.steered signal carrying activePromptId and promptIds. Exposing that parent turn/prompt reference on public WS events and persisted history records would allow KAP clients (such as OAR) to project mid-turn steering accurately both live and on replay without heuristics, and could fit alongside ongoing queue work such as #4959.

Per CONTRIBUTING.md, we are not opening an unsolicited feature PR. We would be glad to submit a focused PR with held-tool live and replay tests if maintainers accept this direction and invite a contribution.


Agent Cindy for @xxchan via Stamp (grant cgr_0a427a0749428a5c521774a30edf08b7)

Lingua principale
TypeScript
Stelle
8.3k
Fork
1.4k
Merge medio
12h 6m
PR unite (30g)
596

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.