Repository navigation
feat(kap-server): link tool_call items to the task they run as - #4789
Conversation
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb4becebc9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review
|
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
7dd1daa to
07521cf
Compare
07521cf to
f65c4e9
Compare
MoonshotAI#4663 and MoonshotAI#4789 now describe the recorded-event fold that serves the pinned bundle: task links come from persisted TaskStarted records, and the feed no longer rebuilds from the model-context view. MoonshotAI#4730 moves from partial to ported (record-driven items seal once, with the recorded reasoning duration), and MoonshotAI#4772's probe follows the feed suite it now lives in. MoonshotAI#4893 is unblocked: `kap.conversation` stages its replay, publishes once after rehydration, and gates live dispatch only while a mutable participant restores. The PLAYBOOK note on the release-branch commits carries the correction for MoonshotAI#4888 for the same reason.
Requirement or Bug
工具调用条目(
tool_call)不带它对应的任务 id。任务这边有parent_tool_call_id指回工具调用,但只对还在task.list里的任务有用。后台任务比启动它的工具调用活得更久:它结束后,或者在服务端崩溃后失联(lost),重新订阅时就不在task.list里了。工具卡片找不到它的task_id,也就没法发task.watch查最终状态和输出。客户端现在只能用正则从工具输出文本里抠
task_id:(code-appuseKimiWebClient.ts的bashTaskIdOf),这依赖输出文案,很脆弱。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
task.started:一开始就在后台启动的任务,或者前台任务被转到后台的那一刻。这正好就是需要靠工具调用找回任务的情况。前台运行中的工具,客户端照旧通过task.list里任务的parent_tool_call_id找到它;用户把它转到后台时,task_id就会出现在工具调用上。让引擎也持久化前台任务,会改变会话恢复和失联提醒的语义,这次不做。task.started是持久化的记录,所以历史读取和实时推送走同一条路径。实时推送时,正在运行的工具调用会收到item.updated { set: { task_id } };如果工具调用已经结束,会随item.ended一起带上。server-api.md(中英)的tool_call字段说明补上task_id。Behavior Changes and Affected Users
task_idtask_iditem.task_id,读不到才退回输出文本task_idtask.list的parent_tool_call_id关联item.updated,只含task_id受影响模块:
packages/kap-server的对话协议、对话 feed 与 fold。apiSurface快照没有变化。测试(
test/services/conversation.test.ts):TaskStarted,订阅方收到item.updated { task_id }。code-app bump 子模块后,可以删掉客户端从输出文本里找
task_id的兜底。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset. 不写:现有客户端已经能通过输出文本找到任务,用户看不到变化。gen-docsskill, or this PR needs no doc update.