Repository navigation
[PR] fix(dsh): discover seeded forks through request-scoped session lookup - #4424
abworks-dev wants to merge 4 commits into
Conversation
|
ework |
ranxianglei#4449 added tests/codex-mcp-shell.test.ts and tests/codex-plugin-version-sync.test.ts; both match the SPAWN_RE tripwire but were never registered in scripts/live-files.mjs, so every CI test shard dies at startup before running a single test (red master since 751c354, inherited by all open PRs). Concurrency review required by the tripwire: - codex-mcp-shell.test.ts spawns node MCP-server children over stdio only — no port binding, temp dirs only; - codex-plugin-version-sync.test.ts execFileSyncs sync-codex-plugin-version.mjs against mkdtemp fixtures — no ports. Both are safe under --test-concurrency 4; their zone bands stay unused. Appended per the append-only slot rule in live-files.mjs. Verified by replicating run-ci-tests.mjs's full-set tripwire scan locally. No bili behavior change.
Covers the one untested branch of the C10b scoped fallback: an ambient initiator that is present but whose session is already cleared (mid-dispose) must take the same request-scoped agents.get(sid) path as a missing one and resolve the exact child when found. The missing-initiator shape was already pinned by the existing cases; this closes the bidirectional pair of the 'session === undefined' branch.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 同族相关条目:#3011(跟踪主 issue)、#4266(p1 伞 issue,你已定「下个版本统一解决」)、#4215(已关闭的复现实例)、#4223(C10a 兄弟面——只加诊断日志,机制不同)。本 PR 是 C10b(请求作用域查找)这一具体机制面,没有其他 PR 实现同一面。 标签: bug + dsh + scope/wiring + p1(症状与 #4266 同族:fork 继承丢失 → 零折叠重放 → 大会话 413 循环,按「会话恢复/继承类」口径定 p1)。 方向关(需要你拍板)本 PR 实现的是 C10b 路线②:ambient 为空时,通过可选宿主 API 八问
代码审查(独立复审)
行为变更披露(旧→新)Seeded fork child 在 ambient initiator 缺席时的处置:旧 = 静默不采纳(重放父会话全部未压缩历史,大会话陷入 413 循环);新 = 经请求作用域 CI master 红(已顺手修掉,查重:无)PR head 最初全红(11 个 test shard 全挂)——根因不在本 PR:master 上的 #4449(codex 插件)新增了两个会 spawn 进程的测试文件但没登记进 验证证据
判定代码本身可合:机制正确、门完整、测试有牙、无回归、CI 全矩阵绿。剩余两件事都不是代码问题:① C10b 路线②等你拍板(方向关);② 与 #4223 的合并顺序协调(建议先 #4223,本 PR rebase 跟进)。合并动作由你执行(agent 不合 PR):#4424 |
…import, type result as possibly-undefined
Summary
Fix the scoped-identity fork-discovery blind spot reported in #4215 (category G; related canonical tracking #3011). This is the behavioral C10b counterpart to the log-only C10a PR #4223, not a replacement for its diagnostics.
In v0.1.204, attributionOf() can correctly identify a model dispatch from the llm/stream request scope while forkChildOf() still reads only currentInitiator(). When that ambient agent is absent, a seeded fork child silently skips adoption and replays its unfolded history. Large histories can then enter repeated local 413 rejection.
Change
The host lookup is already available in the inspected DSH runtime; no new host API, configuration, kernel change, persistence format, or wire transformation is introduced. This only enables the existing snapshot/match/fork admission protocol to run. Parent snapshot validation and prefix checks are unchanged in both plugin and proxy modes.
Regression evidence
Boundaries / review
Human review requested because this touches session binding. No auto-merge or release requested. Coordinate with #4223 because it changes the same discovery helper. This PR fixes only the request-scoped discovery gap; unavailable/opaque parent snapshots, retroactive CHILD_CONFLICT, and interrupted-preflight recovery remain separate #3011/#4215 family work. It does not claim that every historical incident necessarily took this gate. No real transcripts, databases, local recovery scripts, credentials, session IDs, or business data are included.