fix(web): handle legacy session summaries#751
Merged
tiann merged 1 commit intoMay 31, 2026
Conversation
There was a problem hiding this comment.
Findings
- No issues found.
Summary
- Review mode: initial
- Full diff reviewed. No high-confidence correctness, security, regression, data-loss, performance, or maintainability issues found in the modified lines.
- Residual risk: focused web test could not be run in this automation environment because
bunis not installed on PATH.
Testing
- Not run (automation):
bun --cwd web vitest run src/lib/sessionAttention.test.tsfailed withbun: command not found.
HAPI Bot
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.
变更概述
Cannot read properties of undefined (reading 'includes')的崩溃。classifySessionAttention()对缺失的pendingRequestKinds做兼容兜底,并对backgroundTaskCount使用默认值。pendingRequestKinds的回归测试。原因
会话列表的详细状态会调用
classifySessionAttention()。该函数默认summary.pendingRequestKinds一定存在并直接调用.includes();但 Web 端可能遇到旧 Hub、缓存数据或旧格式 session summary,字段缺失时就会进入 ErrorBoundary 并显示:影响范围
验证结果
C:\Users\junes\.bun\bin\bun.exe run --cwd web vitest run src/lib/sessionAttention.test.tsC:\Users\junes\.bun\bin\bun.exe run --cwd web tsc --noEmitgit diff --check风险/回滚
Reviewer notes
pendingRequestKinds缺失时是否应保持 Web 端兼容;当前处理与已有 count 字段的?? 0思路一致。