Repository navigation
Conversation
…nxianglei#7112) cordis dispatches internal/config as waterfall('internal/config', fiber, next): the first argument is the event name, so no this is bound (thisArg null) and the listener receives (fiber, next). Reading this.entry always yielded undefined, so every covered entry was recorded as unnamed-entry, sawFactoryPreset never latched, and PR ranxianglei#5994's ranxianglei#5248 restore could never fire. Tests dispatch through a real cordis Context; the existing mock hosts call the captured middleware directly, which is why the defect stayed green.
this (#7112)this (#7112)
These three files invoked the captured internal/config middleware as mw.call(entryLike, null, next), passing the entry name as `this`. That is not how cordis dispatches (thisArg is null, the fiber is the first argument), so the mocks were asserting a binding the host never produces — which is why ranxianglei#7112 shipped green. Move the entry-like object to the first parameter; the assertions themselves are unchanged.
|
CI 修复( 本地:typecheck ✅ / 24 用例 ✅ / build ✅ / unused-exports ✅。 |
…missed (ranxianglei#7112) 8461f55 moved the entry-like object to the first parameter in most mock calls but left two issue3662 sites still passing it as `this` (mw.call(PRESET_SELF, null, next)) — they only stay green because their assertions are name-independent, so the broken binding survives exactly where a future name-keyed branch (e.g. ranxianglei#5994's ranxianglei#5248 restore) would be exercised. Move those two calls to the real binding and rename the identifiers that now lie (PRESET_SELF/self/raw → the fiber they carry), so the mocks cannot silently drift back to the pre-ranxianglei#7112 convention.
本 PR 已被 #5994 覆盖,独有价值只剩测试约定修复#5994 的 head 本 PR 仍有 #5994 目前缺的部分: 那 14 处改动已经写进 #5994 的评论里(含逐行 diff),可以照抄: 建议
如果更希望保留本 PR 作为测试修复的载体(例如 #5994 想只做运行时那一行),说一声,我把运行时那两行从这个分支撤掉,只留测试改动。 |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。在途同属 dsh 车道的 [PR] 7116(#7113 compaction-basic override 告警)、7117(#7111 post-load reconcile)、5994(GitHub #5994 #5248 restore)目标各不相同;其中 #5994 与本 PR 触碰同一个 middleware,存在合入顺序交互(见下)。 标签:bug、p1(接手时已有)、dsh、scope/wiring(我补)。 八问
我的验证
一个要留意的点(非阻塞)新增用例用真实 cordis Context 派发,验证了绑定(fiber 是第一参、 判定可合(合并动作仍归人工)。修复正确、安全、测试有牙;CI 待全绿(目前无失败);唯一保留项(fiber 形状)属验证关切而非正确性阻塞,且安全降级。 |
回答「C 还是 A」,并更正你 C 方案的一个前提结论:我按 C 走,C 我同意。 但 C 的成本描述已经过时——#5994 不再红 4 个 shard。 事实更正:#5994 的测试约定缺口已被补上你 05:44 的核对(「#5994 文件清单不含 issue3354/4147,正因缺其而红 4 shard」)在当时成立,现在不成立了:你的
所以 C 的代价「#5994 需一次 rebase 去重」还在,但「#5994 rebase 后 4 红转绿」这个收益已经不是收益——那 4 红已经没人了。 本 PR 侧事实
两个选项的现状(都由你拍)
边界:关 PR、动 #5994 分支都是 owner 动作。我不投票替你做决定,只把成本对齐。 |
…ads (#7196) #7115 changed the internal/config listener to read the entry name from the fiber argument (cordis dispatches waterfall('internal/config', fiber, next) with this=null), but this pre-existing #6770 fixture still passed the entry as `this` — so entryNameOf(null) degraded to "unnamed-entry" and the assertion failed on every OS/Node. Pass the entry object as the first argument, matching how cordis actually dispatches (and how tests/issue7112-config-hook-fiber drives it).
Closes #7112.
What & why
registerCompactionDisable'sinternal/configmiddleware read the entry name fromthis:cordis dispatches that waterfall as
waterfall('internal/config', fiber, next)(vendor/cordis/src/fiber.ts:678) — the first argument is the event name, soevents.ts:163resolvesthisArg = nulland the listener receives(fiber, next). Measured in a real host during one boot:internal/configcalled 163 times,this === null163 times, whilefiber.entry.optionswas readable 163 times.Consequences of the dead accessor:
entry: "unnamed-entry", andsawFactoryPresetnever latched — the boot note that tells users whether the preset plane was covered was therefore permanently wrong;rawName === DSH_COMPACTION_BASIC_PACKAGEnever true), so that PR cannot fix [PR] Four-lane shared startup lifecycle wrap-up: dsh adopts lane mutual exclusion guard, thick lifecycle retained in place (# | 四车道共享启动生命周期收尾:dsh 采用车道互斥守卫,厚生命周期保留原地(#5241 阶段 1 / PR-1d) #5248 as written.The rewrite itself is name-independent since #4147 (structural match), so disabling native compaction kept working — this is a diagnostics-and-branching defect, not a compression regression.
Fix
Read the name from the first argument, and expose it as the single entry point for future name-keyed code:
The middleware signature loses one parameter (
_rawwas already the fiber; keeping three would shiftnext).Tests
tests/issue7112-config-hook-fiber.test.tsdispatches through a real@deepseek-ai/cordisContext — the existing mock hosts call the captured middleware directly, which is exactly why this defect stayed green.thisisnullandentryNameOf(fiber)still yields the name;@deepseek-ai/dsh-agent-presetandsawFactoryPreset === true;sawFactoryPreset === false(positive + negative, per the gate discipline);undefined;Negative control (reverting only the accessor line, keeping the helper): the two telemetry tests fail, the other three pass.
Pre-flight
npm run typechecknode --import tsx --test(issue7112+issue3354+issue3662)npm run builddist-import-annotations: OK,dist-external: OK)Merge order vs #5994
Both touch the same middleware. If this lands first, #5994 needs a one-line rebase onto
entryNameOf(fiber)for its added branch; if #5994 lands first, this PR is the supplement that makes its branch reachable. Either order leaves the other correct once rebased — I noted this on #5994 as well.Not in scope
No config surface change, no version bump, no docs change (the mechanism is unchanged; only the accessor is).