Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 6ae5ad9 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: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee55c0e310
ℹ️ 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".
| export const toolCallStartedEventSchema = z.object({ | ||
| type: z.literal('tool.call.started'), | ||
| time: z.number().optional(), | ||
| origin: z.enum(['loop', 'shellCommand']), |
There was a problem hiding this comment.
Accept tool events from pre-origin IPC hosts
When a new klient connects to a host from the previous release, its tool.call.started, tool.updated, and tool.result payloads have no origin. Because validation defaults to enabled and these three schemas now require the field, EventHub rejects and drops every such event; unless the caller registered onError, tool lifecycle data silently disappears. Keep origin optional or normalize missing values as legacy events at the wire boundary so version-skewed IPC clients continue receiving tool events. The same issue occurs at lines 96 and 109.
AGENTS.md reference: AGENTS.md:L110-L112
Useful? React with 👍 / 👎.
|
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". |
* fix: resume sessions with removed default models (#4982) * fix(node-sdk): resume sessions with missing default model * fix(cli): check auth for the resumed session model * chore: add changeset for unavailable model recovery * fix(agent-core-v2): stop rebuilding mismatched session indexes (#4980) * fix(agent-core-v2): reject repeated model responses (#4977) * fix(agent-core-v2): reject repeated model responses * chore: add changeset for repeated model responses --------- Co-authored-by: 7Sageer <[email protected]> * fix(agent-core-v2): inline deferred tools without dynamic loading (#4971) * fix(agent-core-v2): record restored task notifications without model requests (#4949) (#4989) * fix(agent-core-v2): record restored task notifications without model requests - queue restored task notifications as prompt-only turns after loop initialization - preserve interrupted and queued turns during resume and fork - complete reconciliation before initialization and reset return to keep Wire reads ordered - run loop and container cleanup when reconciliation fails - surface restored notification persistence failures * chore: add changeset for restored task notifications * fix(agent-core-v2): restore overflow recovery after LLM retries (#4950) (#4990) * fix(agent-core-v2): restore step state after LLM retries * test(agent-core-v2): scope retry event to overflow regression * fix(config): allow sessions with invalid user config (#4951) (#4991) * fix(agent-core-v2): tolerate config read failures for permission rules * chore: add changeset for permission config recovery * docs: document permission config recovery * docs: qualify permission config recovery scope * fix(config): surface read error diagnostics * fix(config): allow sessions with invalid user config * fix(config): preserve valid values and replay diagnostics * fix(config): remove startup diagnostic replay * fix(agent-core-v2): ignore non-user prompts during Tower wake (#4952) (#4992) * fix(agent-core-v2): ignore non-user prompts during Tower wake * chore: add Tower notification fix changeset * fix(agent-core-v2): preserve slash prompts during Tower wake * fix(agent-core-v2): route foreground shell events by origin (#4954) (#4994) * fix(agent-core-v2): route foreground shell events by origin * test(agent-core-v2): expect tool event origins in snapshots * fix(klient): accept tool events from pre-origin hosts * fix(agent-core-v2): run external Stop hooks after turn completion (#4956) (#4995) * fix(agent-core-v2): run external Stop hooks after turn completion * chore: add changeset for external Stop hooks * docs: clarify post-turn Stop hook timing * fix(agent-core-v2): wait for subagent quiescence (#4953) (#4993) * fix(agent-core-v2): reject incomplete model streams (#5006) * fix(agent-core-v2): preserve choice-level OpenAI token usage (#5017) * fix(capability): confirm stopping WebBridge before Windows updates (#4999) * fix(capability): confirm stopping WebBridge before Windows updates * fix(capability): harden WebBridge update recovery * fix(capability): restore WebBridge after startup failure * fix(capability): wait for WebBridge process exit * fix(capability): handle WebBridge confirmation edge cases --------- Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> * chore: sync release 2.6.3 back to main * chore: finish release 2.6.3 backsync * chore: sync node-sdk lockfile importer * fix(sdk): preserve main core type dependencies * fix: complete release 2.6.3 backsync --------- Co-authored-by: Haozhe <[email protected]> Co-authored-by: 7Sageer <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]>
Requirement or Bug
普通前台执行
!命令时,TUI 可能重复显示命令,并在命令结束后继续显示月亮加载图标。这是 #4630 引入普通前台执行新链路后的回归;本 PR 以 #4948 的分支为 base,让前台 shell 输出只渲染一次并正确结束加载状态。Bug Reproduction Steps
! printf 'SHELL_ONCE_MARK\n'。$ printf 'SHELL_ONCE_MARK\n',并残留月相加载图标。Root Cause
ShellCommand 改用通用 ToolExecutor 后,一次执行同时产生普通
tool.call.started/tool.updated/tool.result和专用shell.*事件。TUI 把两组事件都当成独立渲染来源:普通事件创建 Bash 卡片,专用事件更新ShellRunComponent。普通tool.result还将livePane留在waiting,而 shell 完成路径只清理streamingPhase,因此月亮不消失。本 PR 是根本修复:在执行上下文和事件中显式标记来源,客户端按来源选择渲染路径,而不是隐藏执行事件或仅重置最终 UI 状态。
Code Changes
核心思路是新增
ToolExecutionOrigin = 'loop' | 'shellCommand',让同一套工具事件携带明确的触发方。Loop 继续按普通工具卡片渲染,ShellCommand 则由专用 shell UI 渲染。'loop'和'shellCommand';实际 Legacy Tool 上下文也携带来源。origin,klient 的 zod schema 同步并在旧 host 未提供来源时归一化为'loop',ACP replay 显式标记'loop'。setTurnId和livePane逻辑前识别'shellCommand',仅由专用shell.*事件驱动前台 shell UI。turnId=-1作为事件开关。tool.call.delta不增加该字段。建议先读
packages/agent-core-v2/src/tool/toolContract.ts和toolExecutorEvents.ts理解来源契约,再读toolExecutorService.ts的事件投影,最后读apps/kimi-code/src/tui/controllers/session-event-handler.ts的客户端分派。其余文件主要是两个生产入口、传输 schema 和对应测试适配。Screenshots / Recordings
以下文本来自同一 aimock
shell-commandplay 的真实运行。重点看旧实现重复的第二行$ printf ...和月相图标,在本 PR 中均已消失。本 PR 的 play 还验证了后续唯一一次模型请求只包含一组
<bash-input>、<bash-stdout>和用户追问,所有自动检查通过。Behavior Changes and Affected Users
!渲染与加载终态tool.result让月亮残留tool.call.started、tool.updated、tool.result没有执行来源origin: 'loop' | 'shellCommand';klient 对旧 host 缺失的origin归一化为'loop',既有字段和值不变'loop'事件继续走原路径,卡片、Task、detach、telemetry 不变受影响模块与覆盖:
$、单份输出、streamingPhase/livePane都为 idle 且月亮为空;真实 TUI play 覆盖同一用户场景。验证详情
corepack pnpm run build通过,构建生成的.d.ts已清理。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.