fix: idle timeout 忽略 Hook 阻塞时间 & Banner 增加终止按钮#247
Merged
Conversation
- 120s idle timeout 现在会在权限审批、AskUserQuestion、ExitPlanMode 等 Hook 等待用户响应期间暂停计时,避免误判为连接挂起触发重试 - AskUserBanner 和 ExitPlanModeBanner 底部增加"终止"按钮,解决这两个 Banner 替换输入区域后用户无法中止会话的问题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
背景
PR #237 引入的 120s idle timeout 没有考虑 Hook 阻塞时间。
lastActivityAt只在 SDK 事件到达时更新,而 Hook 阻塞期间 SDK generator 被挂起无法产生事件,导致用户在弹窗上停留超过 120s 后会话被强制重试。实现
后端(agent-orchestrator.ts)
sendMessage()闭包内新增hookPending布尔变量try/finally包裹设置状态hookPending === true时重置计时器并跳过超时判定前端(AskUserBanner.tsx、ExitPlanModeBanner.tsx)
stopAgent(sessionId)Test plan
🤖 Generated with Claude Code