fix(mesh): keep the existence check when filtering host sessions out of search - #11261
fix(mesh): keep the existence check when filtering host sessions out of search#11261yiliang114 wants to merge 1 commit into
Conversation
…of search #11225 replaced 'if (item)' with 'if (item?.sourceType !== MESH_HOST...)'. The optional chain yields undefined when the read found nothing, and undefined !== 'mesh', so a session that vanished between the search hit and this read now enters the branch and is added as an undefined summary. It fails tsc, which is why every build on the branch is red, and it would have been a real regression even if it had compiled: the guard it replaced existed to drop exactly that case. Both conditions, in this order.
|
Thanks for the PR! Template: all required headings present ✓ (the Problem: observed, and I confirmed it independently rather than taking the description's word for it. The base branch's own CI at
That is the only Direction: aligned. This isn't a style preference — the branch does not compile without it, and the parent delivery PR #11206 sits behind it. CHANGELOG: no direct reference, which is expected for an unreleased feature branch. Size: not applicable. Approach: right scope. Both conditions, existence first, nothing else touched. I did consider whether the mesh-host filter belongs further down — inside the content search, so host-session hits never come back at all. But Risk: no elevated risk signals (no match against the revert-correlated path list). Moving on to code review. 🔍 中文说明感谢贡献! **模板:**必需标题齐全 ✓(缺 **问题:**是已观测到的 bug,而且我独立核实过,没有只采信 PR 描述。目标分支自身在
整个 job 日志里只有这一条 **方向:**对齐。这不是代码风格偏好——没有这一行分支根本编译不过,父交付 PR #11206 也被它挡住。CHANGELOG:无直接对应条目,未发布的特性分支属于正常情况。 **规模:**不适用。 **方案:**范围合适。两个条件、存在性在前,其它一律没动。我确实考虑过把 mesh host 过滤下推到内容检索里,让 host session 的命中根本不返回;但 **风险:**无升级风险信号(未命中与 revert 相关的路径清单)。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewThe change is correct and it is the minimal one. One correction to the description, which doesn't change the fix: a vanished session would not have been "added to the map as an undefined summary". Non-blocking, and pre-existing rather than this PR's doing: nothing pins the TestingUnattended CI run — I did not build, run, or check out anything from this PR. Everything below is quoted from CI logs read through the API. The load-bearing part is a lane that is easy to miss. Before — branch head After — this PR's head Two attribution notes so the signal isn't over- or under-read. First, the red Test / Lint / Integration / Serve A/B results on Not verified: lint and unit tests on Sandboxed verification would settle the one thing CI cannot: Checks on the reviewed commit.
中文说明代码审查 改动正确,而且已经是最小改动。 对描述做一处更正(不影响这个修法):session 消失时并不会"以 undefined summary 的形式进 map"。 非阻塞、且属于既有问题而非本 PR 引入: 测试 本次是无人值守的 CI 运行——我没有构建、运行或 checkout 这个 PR 的任何东西。以下全部是通过 API 读到的 CI 日志原文。 关键在一个容易被忽略的 lane。 Before——分支头 After——本 PR 头 两处归属说明,避免把信号读过头或读不够。第一, 未验证: 沙箱验证可以补上 CI 补不了的那一环: CI 表格:被审 commit 上的检查项。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 4/5 — the fix is proven by a real before/after on the only lane that compiles this tree; what keeps it off 5 is two named non-blocking gaps, not doubt about the change. My independent proposal from the title and the why-section alone was the same one-liner: put the existence check back and keep the mesh filter as a second conjunct. So there was nothing to argue about on approach. The alternative I went looking for — pushing the host-session filter down into What actually convinced me is that the central claim was checkable and I could check it. Reservations, none of them blocking:
One observation for the mesh branch rather than for this PR. #11225 merged with both Six months from now I'd thank whoever wrote the four-line comment rather than curse them — that is precisely the guard a later cleanup pass would otherwise fold back into an optional chain. Approving. 中文说明Confidence: 4/5 —— 在唯一会编译这棵树的 lane 上,这个修复有真实的 before/after 佐证;没给到 5 分是因为两个已点名的非阻塞缺口,而不是对改动本身有疑虑。 只看标题和"Why it's needed"时,我独立想到的方案就是这同一个一行改动:把存在性检查放回去,把 mesh 过滤作为第二个合取条件。所以方案层面没有可争的。我确实去找过另一条路——把 host session 过滤下推进 真正说服我的是:核心论断可核验,而且我核验了。 保留意见,均不阻塞:
有一点是给 mesh 分支的,不是给这个 PR 的。#11225 是在两个 半年之后,我会感谢写下那四行注释的人,而不是骂他——那正是日后一次清理会顺手折回 optional chain 里的守卫。批准。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
Qwen Code review did not complete successfully. Qwen review aborted with an API error before posting comments. A transient error is retried automatically; if you are seeing this, retry with |
|
Closing: superseded by work already on the mesh branch. |
What this PR does
One line: restores the existence check that #11225 folded into an optional chain in
session-list.ts.Why it's needed
It is why every build on the mesh branch is red.
tsc --buildfails onpackages/cli:Test, Lint & Static, and Integration Tests all fail at "Install dependencies", which runs the build, so nothing downstream of it has run since #11225 merged.
The change was
if (item)→if (item?.sourceType !== MESH_HOST_SESSION_SOURCE_TYPE). When the read finds nothing,item?.sourceTypeisundefined, andundefined !== 'mesh'is true — so the branch runs with no item at all. This would have been a regression even if it had compiled: a session that disappeared between the search hit and this read used to be skipped, and would now be added to the map as an undefined summary. The guard that was replaced existed for exactly that case.Fix: both conditions, in this order.
Reviewer Test Plan
How to verify
Expect it to pass. On the branch without this commit it fails at the line above.
Evidence (Before & After)
Before:
tsc --buildfails, so Test / Lint / Integration never start. After: the build proceeds.Tested on
Environment (optional)
Checked with
tsc --noEmiton the single file; the full workspace build is CI's to confirm.Risk & Scope
Linked Issues
Parent delivery PR: #11206. Regression from #11225.