Repository navigation
fix(kap-server): drop the partial reply of a retried step - #4855
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 36a2adb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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: |
Merged
6 tasks done
Grapedge
added a commit
that referenced
this pull request
Nov 12, 2026
* fix(agent-core-v2): truncate oversized skill content (#4834) * fix(kap-server): bind the main agent when a session is created (#4839) * fix(kap-server): bind the main agent when a session is created * fix(kap-server): reject a profile on prompt submissions * fix(kap-server): reject a profile change through the session profile * fix(kap-server): wait for model configuration before binding a new session * fix(agent-core-v2): deduplicate restored task notifications (#4836) * fix(agent-core-v2): deduplicate restored task notifications * chore: add notification replay fix changeset * fix(agent-core-v2): preserve task notifications after prompt-only crashes * fix(agent-core-v2): complete prompts before ending turns * test: align lifecycle snapshots with prompt completion order * fix(agent-core-v2): settle all prompts during turn finalization * fix(kap-server): drop reserved metadata keys from session profile updates (#4842) * fix(kap-server): drop reserved metadata keys from session profile updates * fix(kap-server): keep stored reserved metadata keys on profile updates * docs: split and rewrite the server API reference (#4841) * docs: split and rewrite the server API reference * docs: redirect old server API anchors to the split pages * docs: describe profile metadata as a replacement * docs: mark question responses as answered-only * fix(kap-server): avoid heartbeat timeout after scheduling stalls (#4823) * fix(kap-server): avoid heartbeat timeout reaping after stalls or clock jumps * fix(kap-server): grace heartbeat window for short scheduling stalls * fix(kap-server): treat only clearly late heartbeats as scheduling stalls * fix(kap-server): time heartbeats on a monotonic clock and drain queued input before reaping --------- Co-authored-by: Kimi Code (Grok Bot) <[email protected]> * fix(kap-server): undo a turn only once when requests race (#4846) * docs: describe heartbeat stall handling (#4849) * docs: describe heartbeat stall handling * docs: explain the monotonic clock in the heartbeat notes * fix(agent-core-v2): acquire session lock before loop restoration (#4848) * fix(agent-core-v2): acquire session lock before loop restoration * chore: add session lock lifecycle changeset * fix(agent-core-v2): hold session lock through loop restoration - add an operation-scoped lease to the session run gate - hold it across loop initialization, reset, and pending drains - cover idle timeout and release ordering * fix(agent-core-v2): keep the output of stopped tool calls (#4854) * fix(kap-server): drop the partial reply of a retried step (#4855) * fix(agent-core-v2): dedupe historical tool schemas (#4862) * fix(agent-core-v2): dedupe historical tool schemas * chore: add duplicate tool schema changeset * fix(agent-core-v2): preserve first tool schema declaration * fix(agent-core-v2): remind on changed tool schemas * fix(agent-core-v2): block stale tool schema calls * fix(agent-core-v2): normalize registry schemas in pending checks * fix(agent-core-v2): import registry tool metadata type * fix(agent-core-v2): preserve abort handling during validation * fix(agent-core-v2): refine validation hook preparation * fix(agent-core-v2): make validation hooks synchronous * fix(agent-core-v2): preserve tool result notes on fork (#4867) * fix(agent-core-v2): preserve tool result notes on fork * chore: add fork tool result note changeset * fix(agent-core-v2): scope tool result note restoration to forks * fix(agent-core-v2): normalize inherited tool result notes * fix(agent-core-v2): isolate fork note restoration * feat(tui): sweep running titles toward text and add KIMI_CODE_TUI_ANIMATION_FPS (#4843) (#4870) * chore: sync web dist from code-app (#4871) code-app: 8ab17294e031323186d357d121c5360b8353900e Co-authored-by: kimi-agent-bot <[email protected]> * ci: release packages (#4835) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: sync web dist from code-app code-app: 5835391dac3a2b9e0c65ffbd418f0d6042a7adb2 --------- Co-authored-by: Haozhe <[email protected]> Co-authored-by: qer <[email protected]> Co-authored-by: Kimi Code (Grok Bot) <[email protected]> Co-authored-by: grapedge <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirement or Bug
模型回复流到一半断开、自动重试成功后,Web / 桌面端会同时显示失败那次的半截回复和重试的完整回复,开头重复,例如「Affected: eu-west Affected regions are eu-west and us-east.」。
#4630 之后,重试请求不再带上那段半截回复,模型会从头作答,所以这个问题在本版变得必然出现。这个 PR 在重试开始时删除失败那次的回复,界面只保留重试的结果。
Bug Reproduction Steps
Affected: eu-west后断开连接;让自动重试返回完整回复。Root Cause
content.part,然后以finishReason: 'error'结束这个 step。step.begin。${stepUuid}:${block},所以重试产生的是新条目,旧条目一直保留,实时推送和重新加载都是两条相邻的assistant_message。在 #4630 之前也是两条,但当时重试请求末尾带着半截回复,模型多半会接着写,拼起来是通顺的。#4630 改成从干净的请求重试之后,模型看不到半截回复,就会重答。
本 PR 在会话投影层根本修复,不改 loop 的重试语义。
Code Changes
step.end/step.begin记录,不依赖不落盘的TurnStepRetrying。所以实时推送和重新加载的结果一致,已有的会话日志重新加载时也会被修正。step.begin,最后一次的半截回复照旧保留。item.removed是已有的事件,客户端按item_id通用处理,不需要改。文档里这个事件的说明同步更新(中英文)。Behavior Changes and Affected Users
item.removed,重新加载时不再出现)item.removed受影响的客户端:desktop 与 web(会话 API)。TUI 和 print 模式不走会话投影,不受影响。
已知的小代价:
测试覆盖(
conversation.test.ts):item.started→item.ended→item.removed(旧条目)→item.started(新条目),分页结果里只剩新条目。去掉修复后,这两条测试失败。
验证
packages/kap-server全量:1379 条通过,1 条跳过;typecheck 通过。assistant_message;item.removed,实时和重新加载都只剩重试结果。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.