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

Đang mở
#5,227 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

Ngôn ngữ chính
TypeScript
Star
8.3k
Fork
1.4k
Merge trung bình
12 giờ 6 phút
Pull request đã merge (30 ngày)
596

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MoonshotAI/kimi-code

Tất cả issue của MoonshotAI/kimi-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.