fix: 收到 result 后立即跳出消息循环,避免 idle timeout 误报#258
Merged
Conversation
问题:SDK 返回 result 消息后,如果有 background task 仍在运行, for-await 循环不会结束,导致 idle timer 继续倒计时最终触发超时。 实际查询已经成功完成,不应该报超时。 修复:用 labeled break 在收到 result 后立即跳出循环, 并调用 q.close() 确保子进程不泄漏。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
I'll analyze this and get back to you. |
Contributor
|
I'll analyze this and get back to you. |
问题:urhox-bench 的 .claude/settings.local.json 包含完整的 bash 命令 白名单(git/npm/npx/gh 等),但 SDK 只传了 ['user', 'project'], 'local' 未包含,导致这些权限不生效。SDK 弹窗请求授权时飞书 bot 无法交互,报 "Stream closed"。 修复:settingSources 加入 'local',优先级:user < project < local。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Claude finished @lishuceo's task in 4m 52s —— View job Code Review — PR #258Verdict: ✅ Approved — correct, minimal fix that matches SDK semantics. AnalysisThe root-cause diagnosis is accurate. The fix is idiomatic per the SDK type definitions:
Minor observations (non-blocking)
Summary
Solid fix. The two notes above are optional hardening, not blockers. |
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
result消息后用 labeled break 立即跳出for await循环q.close()确保子进程不泄漏问题
urhox-bench · feat/p0-4-opus-baseline频繁报Query idle timeout after 600s with no activity。根因:SDK 返回
result后,如果有 background task 仍在运行,for-await循环不会自然结束。原来的break只跳出了switch,循环继续等待下一条消息,idle timer 持续倒计时直到触发超时——但实际查询已经成功完成。修复
break→break messageLoop(labeled break 跳出整个 for-await)q.close()确保即使有 background task,子进程也能干净退出Test plan
🤖 Generated with Claude Code