Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 0fc0c57 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: fa6ffb5c30
ℹ️ 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".
| if (this.agentCtx.agentId !== 'main') return; | ||
| if (!this.isActive) return; | ||
| if (event.agentId !== this.agentCtx.agentId) return; | ||
| if (event.origin.kind !== 'user') return; |
There was a problem hiding this comment.
Preserve user-initiated slash commands during Tower wakes
When a Tower inbox wake is active, this literal kind !== 'user' check also ignores human-originated submissions whose origins deliberately use other kinds. For example, AgentPluginCommandService.activate() submits a plugin_command with trigger: 'user-slash', and direct skill activation similarly uses skill_activation with trigger: 'user-slash'; previously either submission canceled the background wake, whereas now a plugin command remains queued behind it and a direct skill activation no longer follows the normal user-interruption path. Please distinguish background origins from all user-initiated origins rather than accepting only the user kind.
AGENTS.md reference: AGENTS.md:L110-L112
Useful? React with 👍 / 👎.
* 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
Tower 用户没有主动停止任务时,后台通知仍可能让唤醒轮次进入用户取消路径,使 TUI 显示用户中断、Desktop 显示“已手动终止”,后续通知与轮询也可能停摆。
本 PR 让 Tower 只把真实用户提交识别为唤醒轮次的抢占信号,同时保留后台通知的正常投递与队列推进。
Bug Reproduction Steps
tower_inbox唤醒轮次。PromptSubmitted,Tower 以Aborted by the user取消当前唤醒轮次;没有真实用户 continuation 时,Loop 还可能进入不自动续跑的中断态。Root Cause
Loop runtime 迁移(#4630)后,普通用户、Task、cron 和 injection 都会经过统一的 Prompt 投影并发布
PromptSubmitted,但事件没有携带已有的PromptOrigin。Tower 的唤醒抢占订阅只检查 agent 与 turn,因此把所有来源都当成真实用户,并固定使用用户取消原因。这是根本修复,不是修改状态文案或绕过取消结果:事件显式携带来源,Tower 在取消前按来源作出判断。
Code Changes
保留所有来源的提交事件,在事件生产端透传完整
origin。Tower 的抢占入口接受普通用户、user-slash 的 skill activation 与 plugin command,排除后台通知和模型触发的 skill activation。PromptSubmittedEvent与PromptSubmittedPayload使用同一个必需PromptOrigin字段;该事件非 durable,不涉及旧 Wire 记录迁移。PromptQueued、PromptStarted、Task 状态、Tower roster 和真实用户取消/重新唤醒逻辑均不变。另附 CLI patch changeset。Behavior Changes and Affected Users
prompt.submitted载荷origin覆盖情况:Prompt 生命周期测试校验用户与 Task 的来源以及三个队列项全部启动;Tower 测试覆盖 Task/injection/model-tool skill 不取消,普通用户及两类 user-slash 均取消,并保留后续重新唤醒;Loop、Plan、Tool、Config 快照覆盖新增事件字段。两轮全仓类型检查与标准构建均通过。远程 Linux 测试因 SSH 主机密钥校验失败未能执行,Desktop/真实 Tower 端到端场景也未执行。
验证详情
2 failed / 214 passed,分别复现事件缺少来源和 Task/injection 触发用户取消。216/216通过。387/387通过,本地合计603/603。agent-core-v2typecheck、全仓corepack pnpm run typecheck、全仓corepack pnpm run build均通过。0 errors / 8 个既有 import warnings。1 failed / 1 passed,修改后2/2,完整 Tower 文件183/183;该轮全仓 typecheck 与 build 通过,两个改动文件 lint 为0 errors / 1 个既有 import warning。Checklist
gen-changesetsrules.