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

Abierto
#5,227 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
TypeScript
Estrellas
8.3k
Forks
1.4k
Merge medio
12 h 6 min
PR fusionados (30 d)
596

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MoonshotAI/kimi-code

Todos los issues de MoonshotAI/kimi-code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.