Skip to content

[PR] fix(window): size a child conversation from its parent's runtime-info - #4683

Closed
Maziar123 wants to merge 16 commits into
ranxianglei:masterfrom
Maziar123:2026-10-25_side-window-inherit
Closed

Maziar123 wants to merge 16 commits into
ranxianglei:masterfrom
Maziar123:2026-10-25_side-window-inherit

Conversation

@Maziar123

@Maziar123 Maziar123 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Client-minted child conversations look up their own id, find nothing, and get sized by the registry peek — capped at the built-in standard window for tier-gated families (#1321). The client mints these ids for work on the parent's own route+model and never re-declares the negotiated tier, so the child is a legitimate 1M request sized at 200K:

  • src/server/handle.ts:744 resolves runtimeWindow from pluginRuntimeInfoForConversation(runtimeConversationId(headers, parsed, sessionHeader));
  • that lookup was a bare Map.get + model-equality guard (src/plugin.ts:603), so <parent>:side:<snowflake>, <parent>:side:conversation:<key> and <parent>:sub:<id> (omp's shapes) always miss;
  • the ladder then reaches peekWindow = capRegistryWindowByStandard(model, peekRegistryContext(...), hasTierEvidence) (handle.ts:769), with no tier evidence on the wire → 200,000.

Consequence in the field: ~174K of recap context compressed toward a 150K headroom target, 30 s grace, committed SSE headers, then preflight aborted (the client disconnected during preflight compression); not forwarding — the summarizer spend is paid and the turn is lost.

Change

pluginRuntimeInfoForConversation (src/plugin.ts) strips one known child suffix per pass and returns the nearest ancestor report, keeping the model-equality guard at whichever level answers:

  • direct hit wins and is model-gated exactly as before (no behaviour change for normal ids);
  • a parent entry for a different model is not inherited — a child on another model keeps today's miss;
  • stripping is bounded (4 passes) and anchored (:side:<id>, :side:conversation:<key>, :sub:<id>); sid-parent2:side:x, sid-parentx and sid-parent:side: stay misses.

No new config key, no ladder re-ordering, no change to capRegistryWindowByStandard.

Test evidence

node --import tsx --test tests/side-window-inherit.test.ts — drives the real ladder (startServer + fake upstream + x-acp-session, asserting metadata.effectiveContextLimit):

case before after
parent request 1,000,000 1,000,000
<parent>:side:<id> 200,000 1,000,000
<parent>:side:conversation:<k> / <parent>:sub:<id> 200,000 1,000,000
parent reports a different model 200,000 200,000
unknown parent / prefix lookalike 200,000 200,000

Before the fix: 2 of 5 fail; after: 5 of 5 pass.

node --import tsx --test tests/runtime-info.test.ts — 5 new unit cases in the same direction (child inherits window + maxOutput; nested :side:→:sub:; wrong-model parent; direct hit wins; no prefix false hits). Before the fix: 2 fail / 32 pass; after: 34/34.

Related suites, all green: tests/issue1321-tier-window-cap.test.ts, tests/issue1569-window-stamp-and-anchor.test.ts, tests/issue2481-dsh-runtime-context.test.ts, tests/configured-window-outranks-registry.test.ts, tests/plugin-agent.test.ts, tests/side-request-isolation.test.ts (131 tests, 0 failures). tsc --noEmit clean.

Risk

  • Truthfulness of the inherited window: a child that silently switched route or model is still sized by the parent — but the model-equality guard covers the model axis, and a route switch without a runtime-info re-report was already mis-sized by the parent lookup today.
  • Inherited maxOutput: the same lookup feeds two output-ceiling readers: the fallback-output resolution in src/server/handle.ts:2244-2245 and resolveKnownOutputCeiling in src/server.ts:1886-1887 (the [bug] 长会话频繁「达到输出token上限」:restore 回落到被污染的 high-water,0.1.175 未声明 output 时仍能复现 #1840 restore floor). In both, a child now inherits the parent's reported cap instead of falling through to the launcher/route/registry chain. That is the intended semantics (same route + model) and the unit case covers it.
  • Ephemeral-turn volume: :side: ids are minted per turn, but nothing is cached per child (the lookup is pure string stripping against the 32-entry conversation table), so there is no new growth path.

Fixes #4682

…ranxianglei#4682)

Clients mint child conversation ids for work that runs on the parent's own
route+model — omp opens idle-recap ephemeral turns as
`<sessionId>:side:<snowflake>` (plus a `:side:conversation:<key>` variant) and
subagents as `<sessionId>:sub:<id>` — and register runtime-info only under the
parent uuid. The window ladder looked the id up literally, so a child missed
the report and fell through to the registry peek, where a tier-gated family is
capped at the built-in standard 200K without tier evidence (ranxianglei#1321). A session
that reported 1M therefore had its own recap turns sized at 200K: preflight
compressed ~174K of context toward a 150K headroom target, committed early SSE
headers, and the client gave up while the summarizer was still running.

pluginRuntimeInfoForConversation now strips one client-minted child suffix at a
time and resolves the nearest reporting ancestor (bounded to 4 strips), keeping
the model-equality gate at whichever level answers: a child on a different
model inherits nothing, and a direct hit is never overridden by a parent.

tests/side-window-inherit.test.ts drives the real ladder — a `:side:` child of
a 1M-reporting parent budgets 1_000_000 (200_000 before the fix) — and
tests/runtime-info.test.ts carries the unit-level cases.

Docs: TECHNICAL-NOTES(+zh) records the child-id resolution and the
CHANGELOG carries the incident shape.
@ranxianglei ranxianglei changed the title fix(window): size a child conversation from its parent's runtime-info [PR] fix(window): size a child conversation from its parent's runtime-info Oct 25, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

收到,正在审。

**查重: 不重复。**按「side conversation / runtime-info / window inherit」与「:side: + #1321 cap」两组关键词检索了 open+closed 的 issue 与 PR,无其他条目处理同一机制(子会话 id 查不到父级 runtime-info 而落 registry cap);在途 PR 中也没有第二个动 pluginRuntimeInfoForConversation 的(#4681 同为 @Maziar123 但属 thinking-signature 域)。#4682 是本 PR 对应的 bug 报告,属正常修复关联。

标签: bug / omp / scope/wiring / p2(缺陷修复:子会话被按 200K 定窗而非父会话上报的窗口;现场证据全部指向 omp 自造子 id;改动域是请求管道窗口解析;p2 = 主会话不受影响、仅大上下文下 side/subagent 回合丢轮,有绕行)。

审核进行中:独立读 diff、回归面清点、本地定向验证、CI 红分片归因(当前 head 上 7 个 test 分片红,需判定继承性还是本 PR 引入)。结论按八问体例随后补上。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审核结论:代码可合,当前红是 master 继承红(非本 PR 引入)

独立做了四件事:逐行读 diff、清点回归面、本地定向验证(含「回退修复看测试是否变红」的有牙性验证)、拉取全部 7 个红分片日志与 master 自身最新红运行的日志做失败测试名逐一比对。

一、代码审查(主关)

改动只在 src/plugin.ts 一处函数(pluginRuntimeInfoForConversation,src/plugin.ts:619)+ 两个新正则/常量(src/plugin.ts:607-608)。我核过的要点:

  • 精确命中路径字节级不变:先查原 id,命中即按原逻辑 model 门控返回——正常 plugin id 零行为变化;
  • 剥离语义保守且 fail-soft:锚定后缀(:side:<id> / :side:conversation:<key> / :sub:<id>),每轮剥一层、最多 4 层,取最近上报祖先;祖先条目 model 不匹配时直接落空(不再继续往上剥)——宁可退回旧阶梯也不误继承,这个取舍正确;
  • 无状态增长:pluginRuntimeByConversation 仍是 32 条目 FIFO(src/plugin.ts:572-574),查找是纯字符串剥离 + ≤4 次 Map.get,子 id 本身永不入库;
  • 无内部交互:全仓 grep 确认没有任何 src 组件自造 :side:/:sub: 形态 id(KDD#9 的 dsh persona fork 用 |sub: 管道符分隔,不触碰本正则);改动不涉及 lane-guard 符号、不动窗口阶梯顺序、不动 capRegistryWindowByStandard;
  • 双模式推理:proxy 模式(无 plugin 头)表里根本无条目,恒 undefined,零影响;plugin 模式即修复目标。

二、回归面清点(逐项结论)

既有行为 结论
普通 id 的精确 lookup 保持(32 个既有 runtime-info 用例本地全绿)
未知 id / 前缀形似 id(sid-parentx、${PARENT}2:side:x、空尾段) 保持落空(负例有用例钉住)
窗口阶梯顺序 / #1321 tier cap 不变
maxOutput 兜底(handle.ts:2233) 有意变更(PR 已披露):child id 从父条目继承上报 cap,不再落模型表。同 route+model 下上报值即真值,语义成立
maxOutput 兜底第二调用点(server.ts:1878,fallback-output resolver) 同一 helper 自动获得相同语义——PR 风险节只点了 handle.ts:2233,这处属同向变更,行为一致,提示作者知晓即可,不构成问题
status 端点 runtimeInfo 展示(plugin.ts:1858) child 会话从显示 null 变为显示继承的上报条目,与实际定窗一致,属改善
内存 / 缓存 / 游标 / 去重键 不受影响(无新状态;prefix cache 不涉窗口解析)

三、测试有效性(质量关)

不是假测试,有牙且能兜底:

  • e2e 走真实 startServer + fake upstream,断言 metadata.effectiveContextLimit 的具体数值(1M vs 200K),不是恒真断言;
  • 我独立复验了有牙性:把 src/plugin.ts 临时换回 base 版本跑新测试,恰好 4 个用例变红(2 个 e2e case + 2 组单测),与作者声明的 before 数据吻合;恢复后 39/39 绿;
  • 本地定向跑了 PR 点名全部相关套件:side-window-inherit + runtime-info + issue1321-tier-window-cap + issue1569-window-stamp-and-anchor + configured-window-outranks-registry(57/57)+ plugin-agent + side-request-isolation(109/109),共 166 用例 0 失败;
  • 文档面:CHANGELOG(Unreleased/Fixed,zh,体例合规)+ TECHNICAL-NOTES en/zh 同步更新,中英内容对齐。

四、CI 红归因(关键发现:100% 继承红)

head 1fafccf 上 7 个红 test 分片,我下载了全部日志并提取失败测试名,再与 master 自身最新 push 运行(ac844fa,run 40189242801,failure) 的 6 个红分片日志比对——PR head 上失败的每一个测试名在干净 master 上同样失败,无一例外:

  • storage-render golden (chat/anthropic/responses/google) ×4
  • HTTP fork revision and originals survive a new proxy process
  • storage engine: full-mode restart is invisible ... ×4
  • storage engine: rollback contract ... / corrupt index.db degrades (#2771)
  • cold load recovers the pre-fix orphan freeze ...
  • default probing finds the repository tree from the TS source layout

这正是 #4599 记录的 born-red 簇(storage/golden/fork 家族);其修复载体 PR #4606 已关闭未合并,所以 master 至今红着。另查证:origin/ci-fixes 哨兵分支与 master 完全同 sha(0 领先),没有可 merge 进来的修复——红无法从 PR 侧消除。本 PR 侧证据齐全:static-gates(双 OS,typecheck+kernel/pi-subagents 套件+build)、mysql-contract、全部 10 条 e2e lane 均绿;按政策不为 CI 开新 issue、不在自己分支追继承红。

五、结构化八问

  1. 是什么问题:客户端为复盘回合/子代理自造子会话 id,但 runtime-info 只按父 uuid 注册,窗口阶梯查不到 → 合法 1M 请求被按 200K 预算,preflight 压缩途中客户端放弃、整轮丢失。
  2. 什么原因导致:runtime-info 会话表是字面 id 精确 Map.get,不认识「子 id 是父 id 的后缀派生」这一客户端事实;[bug] window resolution: registry 1M advertisement outranks built-in 200k standard window for claude native without context-1m beta header #1321 的 tier cap 在无 tier 证据时把 registry peek 压到标准窗,放大了查空的代价。
  3. 影响范围与严重程度:仅 plugin 模式宿主中会自造子 id 的车道(现场为 omp);主会话不受影响,触发条件 = 大上下文路由 + side/subagent 回合,后果是该回合丢失 + 摘要费用照付。p2。
  4. 怎么修复的:lookup 层按已知后缀逐级剥离(≤4 层)取最近上报祖先,model 门控在命中的那一层执行;精确命中优先、不匹配即落空回旧阶梯。修在决策点而非症状拦截。
  5. 是否有回归问题:无。上表逐项过;唯一行为变化(maxOutput 对 child id 继承父值)已披露且语义成立。
  6. 是否破坏缓存:否,无缓存/游标/去重键接触。
  7. 是否改了设计方向:否,runtime-info 协议与窗口阶梯结构不变,只补了「子 id 解析」这一缺省规则(en/zh 文档已同步记录)。
  8. 是否引入新配置:否。

收工判定

代码与测试:可合(无需返工,无重构项)。合并动作被 master 继承红阻塞:等 #4599 簇在 master 转绿后,作者把分支 sync 一次重触发即可(现在 sync 也只会再红一遍,不建议提前动)。PR 描述小瑕疵一条:风险节漏列 server.ts:1878 这个 maxOutput 第二调用点(同向变更,不影响判定)。

@Maziar123

Maziar123 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Merged master bcbd1a3d into the branch (new head e9fa49c8, no conflicts). The branch's only kernel/ change was a lockfile version line, and that diff is gone after the merge: against master the PR now touches 6 files (CHANGELOG.md, TECHNICAL-NOTES.md, TECHNICAL-NOTES.zh-CN.md, src/plugin.ts, tests/runtime-info.test.ts, tests/side-window-inherit.test.ts), nothing under kernel/ and no lockfile, so kernel-guard should pass without a declaration.

On the merged head:

  • npm run typecheck: exit 0
  • node scripts/check-unused-exports.mjs: clean
  • node --import tsx --test over side-window-inherit, runtime-info, issue1321-tier-window-cap, issue1569-window-stamp-and-anchor, configured-window-outranks-registry, plugin-agent, side-request-isolation: 166/166 pass (same set as your review run)

Description updated per the review: the Risk section now names both maxOutput readers, src/server/handle.ts:2244-2245 and resolveKnownOutputCeiling in src/server.ts:1886-1887.

@Maziar123
Maziar123 force-pushed the 2026-10-25_side-window-inherit branch from a148ab9 to e9fa49c Compare October 27, 2026 15:43
ci-check added 2 commits October 28, 2026 01:49
…tream teardown

PR ranxianglei#4683 CI (windows-latest/node22) failed the proxy-json abort test after the 3s poll budget elapsed (closed=0). The teardown path is correct (client-abort -> fetch AbortController; exit-matrix contract 'client disconnects while awaiting the buffered JSON -> upstream request destroyed') and the three SSE siblings passed in the same shard, so this is async-propagation latency on a loaded runner, not a regression from this PR. Double the poll budget 30->60 (3s->6s) uniformly across all four abort variants as tolerance headroom; behavior unchanged.
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

本轮状态汇总(承接我上一轮对 e9fa49c8 的核验):CI 在 windows-22 shard 上红了一次(tests/wire-exit-matrix.test.ts 的 abort x proxy-json 断言超时),平台自动修复车道(ci-worker)已介入并推了新 head 9dd31d2。我对分支上新增的两个 commit 做了独立核验:

新增 commit 逐一对账

  1. ed9f528ac(merge master):第二父提交 9b6ec2345 确认是 master 祖先;它带进来的 [PR] fix(#4894): arm the direct-fallback oversize guard on dsh not-ready sends #4904 四个文件(dsh-native / native-intercept / 两个测试)与 master 逐字节一致——纯 master 内容合入,无冲突解决漂移。
  2. 9dd31d2(flake 修复):diff 恰好只有 tests/wire-exit-matrix.test.ts(+4/-4)——四个 abort 用例的轮询上限 30→60(3s→6s),零产品代码。与修复评论声明完全吻合。
  3. PR 对 master 的有效 diff 现在是 7 个文件:原 6 个 + wire-exit-matrix,+255/-10;仍无 kernel/、无 lockfile。

**flake 判定的独立意见:同意。**同一 shard 里四个同型 abort 用例(openai/anthropic/responses/json)只挂了最慢的 json 变体(中止发生在缓冲期,要取消一次未完成的 buffered read),其余三个全过——单点时序抖动特征成立。修法只放宽观测预算、不动任何产品行为/阈值/输出格式;断言仍有牙(真出现「socket 永不销毁」回归会在 ~6s 内失败,只是检出慢一拍)。本地在新 head 复跑 tests/wire-exit-matrix.test.ts:7/7 pass。

CI 现状:新 head 的运行已启动(镜像缓存读:25 项检查全部排队/刚起,0 failed)。注意一点:自动修复车道在本轮后已达 24h 配额上限(floor 14),若新运行再有红,将需要 owner 决策而非自动接单——届时我会先做归因再上报。

判定:分支侧完整且干净(原修复本体未动 + 一个有牙性保持的测试时序修)。等 test 矩阵出结果:全绿即 ready-to-merge(合并动作留给你);有红我再归因。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] Merged origin/master into 2026-10-25_side-window-inherit (pushed ed9f528, clean — no conflicts); branch is now up-to-date with master and all checks pass on head 9dd31d2 (17 success / 13 skipped). mergeable_state: blocked now reflects only the pending human review/merge, not CI. (ai: vllm-qwen/qwen3.8-27b)

ranxianglei pushed a commit that referenced this pull request Oct 27, 2026
Unblocks PR #5004's test (windows-latest, 22, 2) red on head da25207:
three abort cells (proxy-openai-sse / proxy-responses-sse / proxy-json)
asserted closed=0 after exhausting the flat 3s (30x100ms) poll on a
loaded Windows runner -- the same signature already recorded under #4599
for #4982/#4774/#4683 (rerun green / in-branch budget bump). Sibling
cell abort x proxy-anthropic-sse passed in 176ms on the same shard and
every other windows/ubuntu shard ran this file green on the same head,
so this is runner load, not a code regression; the PR's diff touches
none of these paths.

Labeled CI-unblock commit; duplicates #4683's pending identical change --
drop this commit when rebasing if #4683 lands first.
ranxianglei pushed a commit that referenced this pull request Oct 27, 2026
…ndows runners

PR #5009 CI (windows-latest/node22, leg 2/5) failed the proxy-openai-sse and
proxy-anthropic-sse abort tests after the 3s poll budget elapsed (closed=0),
twice (original run + rerun-failed-jobs); the two lighter siblings
(proxy-responses-sse, proxy-json) passed in the same shard, and this file is
green on both ubuntu legs at this head and locally (standalone 2/2). This PR
does not touch the teardown path (no src changes in the head's second commit;
#4998's lane-decision change is inert for plain-proxy traffic —
compressReachable short-circuits on !pluginMode), so this is async-propagation
latency on a slow Windows runner, not a regression from this PR.

Identical 4-line diff to in-flight PR #4683 (head 9dd31d2); if #4683 merges
first, drop this commit on rebase. Documented flake family: #4599 floors
350/352/358/363/365.
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b) Merged master b08fbf3 into the branch — sole conflict was additive in CHANGELOG.md (both entries kept); pushed as f531f8f. PR now mergeable=true, state=blocked (awaiting human review only), CI running on the new head.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b) Re-synced master 58e61a3 (84 commits incl. the #4986 digest fix and fork-recovery rework) into the branch — sole conflict again additive in CHANGELOG.md (both entries kept); typecheck green locally; pushed as 980c5b9. PR now mergeable=true, state=blocked (awaiting human review only), CI running on the new head.

@Maziar123

Maziar123 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

The current red roll-up is a cancelled CI matrix, not an executed test failure. The GitHub job records show mysql-contract and gate with conclusion: cancelled and empty steps[]; the test jobs were cancelled before producing a result.

I requested a rerun of the cancelled workflows, but GitHub reports that rerunning them requires repository admin rights. Please rerun the workflows for head f368bcf1 (or trigger them with a maintainer update). A fresh completed matrix is still required; I am not treating the cancellation as either a pass or a code failure.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Cancelled matrix rerun + master sync — outcome after this round's actions:

  1. Rerun done (your ask): the two cancelled runs on head f368bcf1 — CI (run 41207520292, the test matrix) and e2e-dsh-plugin-lane (run 41207520323) — have been rerun using repository-owner credentials (rerun API returned 201, both now queued/running). The other 9 runs on that head already completed success, so once these two finish you'll have a fresh completed matrix for f368bcf1. I agree with your framing: the cancellation is neither a pass nor a code failure.

  2. Merge-guard sync: GitHub reports no actual conflict (mergeable: true, state only behind) — master moved ~166 commits past the PR base. I merged origin/master (dec393f43) into the PR head locally: zero conflicts, typecheck clean, targeted suites green (side-window-inherit + runtime-info + issue1321-tier-window-cap + plugin-agent = 122/122). Effective diff vs master unchanged: the original 6 files.

  3. One wrinkle you should know about: the PR head now lives in your fork (Maziar123:2026-10-25_side-window-inherit; the account redirects to chidea), and direct git push to that fork branch is rejected (permission denied) even though maintainer_can_modify is true — likely the account rename broke the association. So I pushed the synced tree to the main repo instead: branch ranxianglei/billion-context:2026-10-25_side-window-inherit @ e6a46387c (= your f368bcf1 + master, nothing else). If you want the fork branch itself current, merging e6a46387c into it is conflict-free (it already contains everything on your side). Not blocking: with zero conflicts the PR is mergeable against latest master as-is, and the rerun above gives the required fresh matrix on the current head.

State after push: PR open, mergeable: true, awaiting CI reruns + human merge.

@Maziar123

Maziar123 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

The requested rerun has now completed with real test failures rather than cancellations. Run 41207520292, attempt 2, failed three shards:

  • Ubuntu 22 shard 2
  • Ubuntu 24 shard 2
  • Windows 22 shard 3

All three fail the same two web-i18n checks: the English cfg.q_pack_ai_p1 catalog entry lacks the {need} placeholder, and the dead-key scan rejects cfg.q_pack_base_blank. Those files are outside this PR’s six-file diff.

Current master contains the #5345 catalog-guard fix for exactly these failures. I also verified that the relevant catalog/test files do not differ between dec393f43 and current master, so the synced tree at e6a46387c already includes that fix; the failing rerun used the older fork head f368bcf1.

Please use the synced tree for the next full CI run or merge it into the PR branch before rerunning. The separate e2e-dsh-plugin-lane rerun succeeded, and the earlier 122/122 targeted side-window result remains valid, but neither makes the full matrix on f368bcf1 green.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Synced tree now carries the next full CI run — done as requested.

  1. Your diagnosis confirmed. The web/i18n catalog + test files are byte-identical between my synced tree and current master (the #5345 fix series — {need} placeholder in EN cfg.q_pack_ai_p1, dead-key gate taught the live call shapes — is in). I ran the web-i18n suite locally on the synced tree: 10/10 pass. The red shards on f368bcf1 are inherited master staleness, not this PR's code — agreed, that matrix result is void as a signal about this diff.

  2. Resynced to the newest master and dispatched the full matrix. Master moved again since my last sync (dec393f43 → d244ffff2, +17 files, none touching this PR's six-file diff), so I merged it into the synced tree as well: new head 678f3013, pushed to branch ranxianglei/billion-context:2026-10-25_side-window-inherit (fast-forward of my earlier e6a46387c). Effective diff vs master is unchanged: the original 6 files. Then I triggered the CI workflow via workflow_dispatch with full=true on that branch — run 41601197297 is queued (full 12-leg test + 4 static matrix). That is your "next full CI run on the synced tree".

  3. The one thing I still cannot do: move the PR's own head. It points at your fork branch (Maziar123:2026-10-25_side-window-inherit → account now redirects to chidea), and direct git push there is rejected (permission denied) even though maintainer_can_modify is true — the rename appears to have broken that association. Two ways out, either is fine:

    • You sync the fork branch (one command from your side): fetch https://github.com/ranxianglei/billion-context.git branch 2026-10-25_side-window-inherit (678f3013) into your fork branch and push — it merges conflict-free (it already contains everything on your side), and the PR head then gets its own green full matrix automatically; or
    • A human merges the PR as-is: with zero conflicts, GitHub's 3-way merge of head f368bcf1 into current master yields exactly the same content as the synced tree (this PR touches none of the files master changed since), so the stale-red checks on f368bcf1 are purely inherited — the owner can also bypass branch protection if the required-checks gate objects.

State after this round: PR open, mergeable: true; synced branch 678f3013 with full-matrix run 41601197297 in flight; e2e-dsh-plugin-lane already green on f368bcf1; targeted suites (side-window-inherit / runtime-info / tier-window-cap / plugin-agent) 122/122 and web-i18n 10/10 locally on the synced tree. Awaiting the matrix result and human merge.

…erit

# Conflicts:
#	TECHNICAL-NOTES.md
#	TECHNICAL-NOTES.zh-CN.md

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: vllm-qwen/qwen3.8-27b)

Independent review of head 6a291748f (fresh base: contains current master tip except 3 newer docs-only Japanese-README commits with zero file overlap; effective diff vs origin/master is exactly the 6 files, +251/−6).

What I verified myself

  • Read the full diff line-by-line at head; the core change is confined to pluginRuntimeInfoForConversation plus two constants/one regex in src/plugin.ts.
  • Inventoried all four consumers of the helper: window ladder (src/server/handle.ts:832), fallback maxOutput (src/server/handle.ts:2546), resolveKnownOutputCeiling (src/server.ts:2176), and the /__bili/status runtimeInfo display (src/plugin.ts:2041) — the last is additive observability only (a child session now shows the inherited entry, consistent with how it is actually sized).
  • Window-ladder order, capRegistryWindowByStandard and the #1321 tier-cap logic: untouched.
  • Regex edges traced by hand and pinned by tests: sid-parentx / ${PARENT}2:side:x / empty tail / non-matching segments all stay misses; nested ids strip level-by-level (bounded 4 passes, strictly shortening, no loop risk); KDD#9 persona keys use |sub: (pipe) — no collision with :sub:.
  • Both-modes reasoning (§6): the conversation-table branch runs only when the x-bili-plugin header is absent (the agent table wins exclusively when present), so pluginMode behavior cannot change; plain proxy clients with no runtime-info entry get undefined exactly as before.
  • Test teeth: I temporarily reverted the helper to its pre-fix body in a local worktree and re-ran the two new suites — the inheritance cases went red exactly as claimed; after restoring, everything green. The e2e asserts concrete metadata.effectiveContextLimit values (1M vs 200K) through real startServer + fake upstream + x-acp-session, not tautologies.
  • Locally green on head: side-window-inherit 5/5, runtime-info 34/34, related window/plugin suites 133 pass, tsc --noEmit clean.
  • CHANGELOG entry sits under [Unreleased] → Fixed; TECHNICAL-NOTES en/zh updated in parity. No new config/env surface, no kernel/ or lockfile touch, no as any/@ts-ignore.
  • CI: 0 failures observed on this head (mirror cache), lane reports the matrix green; the targeted local runs above corroborate.

Regression inventory (existing behaviors touched by this diff)

Behavior Verdict
Exact-hit lookup for normal ids preserved (checked first, model-gated exactly as before)
Unknown / prefix-lookalike ids preserved miss (negative cases pinned in tests)
Window ladder order & #1321 tier cap unchanged
maxOutput fallback for child ids intentional change, disclosed in the PR Risk section (both readers named): child inherits the parent's reported cap instead of falling to the model table — same route+model, semantics hold
/__bili/status runtimeInfo display additive observability: child shows the inherited entry (matches actual sizing)
Memory / caches / cursors / dedup keys untouched (read-only lookups; 32-entry table unchanged)

No blocking findings; nothing required a spot-fix.

结构化八问

  1. 是什么问题:客户端(omp)为复盘回合/子代理自造子会话 id(<parent>:side:<id> 等),但 runtime-info 只按父 uuid 注册——字面 Map.get 查空后落 registry peek,#1321 的 tier cap 在无 tier 证据时把窗口压到标准 200K,合法 1M 请求被按 200K 预算,preflight 压缩途中客户端放弃,整轮丢失且摘要费用照付。
  2. 什么原因导致:runtime-info 会话表只做字面 id 精确匹配,不认识「子 id 是父 id 的后缀派生」这一客户端事实;#1321 的无证据 cap 放大了查空的代价。
  3. 影响范围与严重程度:仅会自造子 id 的 plugin 宿主(现场为 omp);主会话不受影响。触发条件 = 父会话已上报大窗口的路由 + side/subagent 回合;后果 = 该回合丢失 + 已付费摘要。p2。
  4. 怎么修复的:在 lookup 决策点按已知后缀锚定剥离(≤4 层)取最近上报祖先,model 门控在命中层执行;精确命中优先、祖先 model 不匹配即整体落空回旧阶梯。修的是解析规则本身,不是症状拦截。
  5. 是否有回归问题:无。上表逐项清点过;唯一行为变化(child id 的 maxOutput 继承父值)已在 PR 风险节披露且语义成立。
  6. 是否破坏缓存:否——纯只读查找,无缓存/游标/去重键接触。
  7. 是否改了设计方向:否,runtime-info 协议与窗口阶梯结构不变,仅补上「子 id 解析」这一缺省规则(en/zh 文档已同步记录)。
  8. 是否引入新配置:否。

Verdict: APPROVE. Correct and minimal, tests toothed and regression-pinning, no open findings. Ready to merge whenever you are — the merge action itself stays yours.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Review done: APPROVE posted (review 5823107232) on head 6a291748f — independent end-to-end pass over the diff, all four helper consumers, regex edges, both compression modes, CHANGELOG/docs placement; test teeth re-verified locally by reverting the fix and watching the new suites go red; CI 0-failed. No open findings, nothing to spot-fix. Ready-to-merge — the merge action stays with you.

@ranxianglei

Copy link
Copy Markdown
Owner

这个方案是不是有问题?会冲突吗?另外看最新的master 有msgid+sessionid解决方案

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

逐条查了最新 master(a52c300f),三个问题分开答:

1. 方案有没有问题?
没有根本问题。核心是保守失败语义:任何疑点(模型不等 / 祖先无登记 / 深度超 4 / 剥完为空)一律返回 undefined 走原路径——最坏只是不命中,拿不到错的窗口。模型相等门 + 直接命中优先 + 严格缩短的正则(无死循环)。与 KDD#9 persona key 也不撞(那边是竖线 |sub:,这边是冒号 :sub:)。测试有牙:e2e 断言的是真实 ladder 落点(effectiveContextLimit),修前红、修后绿。
唯一的让步:这是对客户端铸的 id 做形状推断,而 house 风格偏好原生标识。但 issue 的最小复现钉死了「两个请求携带同样的 model/route/tier,只有 conversation id 不同」——父 UUID 前缀是线上唯一可用的 child→parent 信号,没有更原生的标识可取。omp 侧的正确修法(按实际 conversation 逐个注册 runtime-info)在客户端手里,我们控制不了。

2. 会冲突吗?

  • git 层:PR head 落后 master 的几个 commit 全是 docs-only(含日文 README),与本 PR 的 6 个文件零重叠,mergeable=true,合并时一次 merge 即平。
  • 语义层:与 msgid+sessionid 体系正交,不冲突。两者在不同层:身份 ladder 裁决「给定 session id 下这个请求属于哪个 conversation」;本 PR 裁决「这个 conversation id 适用哪份窗口配置」。它不碰 session key、统一存储、消息引用、身份判定 ladder。将来身份体系若引入跨会话关联,这段逻辑届时冗余可删,不阻塞那个方向。

3. 关于「最新 master 有 msgid+sessionid 解决方案」
具体查过:身份判定 ladder(src/session-resolve.ts resolveSessionOrder,设计记录见 docs/session-identity-resolution.md)六档全部在同一个 session id 内运作——msgid 末档(#5719 tryMsgIdRescue,src/session-resolve.ts:369)执行 readStoredMsgIds(rawId),只读该 id 自己 key 下的账本行,re-anchor 也回同一个 rawId,从不把一个 session id 映射到另一个。而 child 请求带着全新的 id <parent>:side:<x> 进来,first-sight 就以自己的 id 占主车道;父 runtime-info 在父 uuid key 下——两本账通过 msgid/sessionid 机制相遇不了。KDD #17 的五个消费方(统一存储 / session-resolve / 结算 membership / 增量车道 / 水位尾连续性)里也没有 window/runtime-info 消费方。
一句话:msgid+sessionid 解决的是「同一 id 下是哪个会话」,本 PR 填的是「这个 id 由那个 id 派生」——后者是 master 当前的空白。我也扫了 11-01 以来的全部提交并 grep src/:没有已存在的基于 msgid 的 child→parent 窗口继承实现,也没有其他在途 issue/PR 走另一条路。

如果你指的是某个具体 commit/PR,给我编号我立刻核对。我的判断维持:APPROVE 有效,这是当前 proxy 侧唯一可行的修法,建议按现状合并;需要的话我可以在 PR body 补一句「身份体系获得跨会话关联后可退役本启发式」。

ranxianglei pushed a commit that referenced this pull request Nov 12, 2026
…flict sync)

Resolves 2 conflicts, both in test files:
- tests/wire-exit-matrix.test.ts: take master's awaitUpstreamTeardown
  helper (from #4683, now merged) over this branch's inline 6s poll loop —
  same intent (slow-runner teardown budget), helper is the converged shape.
- tests/lane-decisions-matrix.test.ts: union — master's extended ROWS type
  (location/onlyWires from #5527) + this PR's omp row pinning observed
  reachability (toolless omp round goes silent, #4998).

Typecheck clean; targeted suites green (lane-decisions-matrix,
wire-exit-matrix, plugin-nudge-injection, issue4344-mcp-dialect: 129/129).
@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6482 (merged) — closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][wiring] :side: child conversations resolve the registry/#1321 cap instead of the parent's runtime-info window

2 participants