Skip to content

[PR] batch-4: 13 community fixes across dsh / claude / opencode / pi / egress (verbatim cherry-picks, authorship preserved) - #7196

Open
ranxianglei wants to merge 33 commits into
masterfrom
batch/community-batch-2026-11-19
Open

ranxianglei wants to merge 33 commits into
masterfrom
batch/community-batch-2026-11-19

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

batch-4: 13 community fixes across dsh / claude / opencode / pi / egress (verbatim cherry-picks, authorship preserved)

One batch PR carrying 13 independently-reviewed fixes from 8 community authors (issues #7111–#6826 era). Every PR was reviewed commit-by-commit against current master, all 13 got a SAFE verdict, and each is cherry-picked as-is with -x (original author, message, and content preserved — see 著作权 below). No design-level change is included; everything here is a scoped bugfix with a regression test.

What's in it

dsh lane (5)

PR Issue Fix (plain language)
#7115 #7112 dsh's config middleware read the entry name from this, but cordis dispatches string events with thisArg = null (verified in cordis 4.1.0 events.ts:163) — so the name-dependent branches (diagnostics + the #5994 basic-package restore) silently never ran. Reads from the fiber argument now, via the exported entryNameOf().
#7116 #7113 A later patch layer replacing the compaction-basic row's whole config silently re-arms dsh native auto-compaction (auto defaults to true) and a landed checkpoint destroys the fold base — with zero log. Boot-time alarm (one warn line, pure observability, fails safe on any loader-shape surprise).
#7117 #7111 The four web-preset rows gated on the biliBasicCompactionPolicy service were fail-closed: any missing gate service left all presets pending forever → agent-preset/not-found on session create while the host kept booting (triggers: subpath resolve failure, user toggling the gate row, interrupted install). Now fail-open: presets mount immediately and the always-on gate entry reconciles them post-load via entry.update() through the exact same overlay path as cold resolve. Losing the gate now costs the overlay (stock compaction + the #1729 wire-level refusal backstop), not the session.
#7066 #7065 llm/stream dispatches stamped their context-window headers from the session model instead of the dispatch's own model → cross-model dispatches sized against the wrong window. Per-dispatch modelTarget with a cold-refresh wait (2 s, unref'd; timeout = exact pre-fix bytes). #5614 boundary semantics and sid/msgIds scoping verified intact. ⚠️ Textually adjacent to open PR #6123 (dsh routing, still needs-decision): whichever lands second re-runs the llm/stream handler tests.
#7094 #7093 The claude SessionStart hook force-called process.exit(0) in finally after destroying stdin — a Windows+Node 24 libuv assertion crash (a #2943 sweep miss). Routes through the existing runSessionStartHook() natural-exit path with an unref'd 5 s backstop; non-Windows exit codes unchanged.

Egress metering / fuse (3)

PR Issue Fix (plain language)
#6840 #6828 A Responses-native host (dsh) sends the conversation under two top-level keys (input + messages); the #554 side-request guard meter counted both → 4.77× phantom total → fuse false-trip. The foreign protocol's field is now excluded, top level only, protocol-gated (absent protocol = old fail-closed behavior). Does not under-size the fuse: each upstream consumes exactly one shape.
#6860 #6844 DSH attaches ~8 MiB of model-hidden metadata (dsh_session_log, dsh_plugin_packages) as top-level fields, which the meter priced → ordinary requests 413'd at the fuse with 88% of the body in the hidden field. Exact top-level exclusion (nested same-name keys stay counted) + the doom receipt now names the field dominating the other bucket (otherTop[]). Landed after #6840 so both exclusions compose in src/preflight.ts.
#6961 #6959 Anthropic advisor replies record the summed iterations[] usage as context (two iterations = 488K recorded for a ~241K turn) → the ledger baseline lied → spurious nudge + fold. Now takes the last message iteration's input + cache reads; the billing ledger keeps the correct summed total.

Timeouts & failure loops (3)

PR Issue Fix (plain language)
#6912 #6910 The cold Codex catalog path had no deadline (only warm had 4 s) — a DNS/TCP stall on the models endpoint hung session setup up to ~12 min. Unconditional 4 s / 10 s deadlines, late responses discarded, cold timeout surfaces as a plain upstream failure (never a fabricated model list; warm timeout replays the offline cache).
#6905 #6903 external-summary: when all candidates fail, every compress attempt re-dispatched into the same wall (loop, #6903). Per-session breaker: 3 consecutive total failures on the same plan fingerprint → 4th call refuses at zero dispatch; recovers on any fingerprint change or 10-min decay; reuses the existing forced-cause plumbing.
#6911 #6909 Resident memory weights were never invalidated when session content was lazily spilled/released → eviction pressure misjudged. WeakSet sentinel (64 B) + invalidate at all 5 release sites + evict-oldest captures the pre-flush weight.

Detection (2)

PR Issue Fix (plain language)
#6841 #6829 pi-web-access 0.46 renamed its shared-proxy fetch marker (__piWebAccessSharedProxyFetch), so bili saw an unknown wrapper → the #1662 depth-1 cutoff re-anchored the inline origin to the oldest anchor → real-network ENOTFOUND on in-process traffic. Both markers recognized; inline-origin serving now also fires unconditionally inside a pi-web-access proxy scope, and the inline-origin check tightened from startsWith to exact origin (closes a latent sibling-domain bypass).
#6825 #6826 OpenCode V2 registered bili's ACP tools with permission: "allow" — in opencode that string is the action name rules match against, so name-based allow lists could never match (anomalyco/opencode#64051). Dropped; restrictive-ruleset users get the ask/prompt flow they actually configured, default users are untouched (* catch-all).

著作权 (authorship)

All 32 commits are verbatim cherry-picks with -x — original author, date, message, and (except the three mechanical conflict resolutions below) byte-for-byte content:

Author Commits PRs
resec 6 #7115, #7116, #7117
xiaoyanzi191 5 #6911, #6912
Saim Shafique (sx4im) 4 #6840, #6841, #6860
MorningStar (MorningStar0709) 2 #6825
许文超 (xwc2020-2) 1 #6905
xiaobaifly7 1 #7066
Sentryea 1 #7094
MohammadErfan Jabbari 1 #6961
ci-check (authors' CI bot) 11 sync/test/docs commits inside the PRs above

Merge commits from the PR branches' own upstream syncs were not cherry-picked (--no-merges); only the actual fix/test/doc commits came in, in original order.

The only three edits made during assembly (mechanical conflict resolutions, no semantic changes)

  1. src/agent/dsh-compaction-gate.ts / dsh-compaction-disable.ts — [PR] fix(dsh): alarm when the host-plane compaction-basic override is gone (#7113) #7116 and [PR] fix(dsh): replace the fail-closed preset gate with a post-load reconcile (#7111) #7117 both touch the always-on gate entry (7116 adds the boot alarm, 7117 adds the reconcile). Resolved by keeping both: one ctx.inject(["loader"]) callback runs reconcileLoadedPresets() then the host-plane warning; both exported helpers survive.
  2. src/preflight.ts (×2) — [PR] fix(server): exclude the foreign protocol's conversation field from the guard meter #6840 and [PR] fix: exclude model-hidden DSH fields from the measured body (#6844) #6860 both add top-level exclusions to the measured-body walks. Resolved by keeping both exclusion checks (foreign?.has(k) then MODEL_HIDDEN_BODY_KEYS.has(k)) in estimateRawBodyTokens and estimateRawBodyBreakdown; [PR] fix: exclude model-hidden DSH fields from the measured body (#6844) #6860's otherTop[] restructure composed with [PR] fix(server): exclude the foreign protocol's conversation field from the guard meter #6840's protocol parameter.

Both resolution sites are covered by the PRs' own regression tests, which pass on this branch.

Verification

After this merges

The 13 source PRs — #7115 #7116 #7117 #7066 #7094 #6840 #6860 #6961 #6912 #6905 #6911 #6841 #6825 — will have landed content identical to theirs; close (or merge, which will apply cleanly as no-ops) to avoid duplicate landings.

Fixes #7112, fixes #7113, fixes #7111, fixes #7065, fixes #7093,
fixes #6828, fixes #6844, fixes #6959, fixes #6910, fixes #6903,
fixes #6909, fixes #6829, fixes #6826.

Sentryea and others added 30 commits November 19, 2026 00:06
The claude-native-bootstrap hook destroyed stdin and then called process.exit(0) in the same tick, which triggers a libuv win async-handle close assertion on Node 24.15.0. Route it through runSessionStartHook so the event loop drains naturally, with the unref'd backstop only as a leak guard.

Refs #7093

(cherry picked from commit 128d8bf)
#2943)

Review addition for the Claude hook graceful-exit fix: the zcode lane already
carries a spawn-level 'real entry exits 0 promptly and does not hang' test in
this file; the claude lane had only the injectable-deps coverage plus manual
verification. Add the claude counterpart — spawn the real
src/claude-native-bootstrap.ts entry with BILLION_CONTEXT_PROXY set (plan
action "exit": earliest safe return, no proxy/config side effects) and assert
a prompt clean exit 0. Bounded by an 8s SIGKILL so the suite can never hang.

(cherry picked from commit 50a705b)
)

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 #5994's #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.

(cherry picked from commit a9973eb)
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 #7112 shipped green. Move the entry-like object to the first parameter; the assertions themselves are unchanged.

(cherry picked from commit 8461f55)
…missed (#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. #5994's #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-#7112 convention.

(cherry picked from commit f7059d7)
…#7113)

dsh replaces a patch row's whole config and compaction-basic defaults auto to true, so any layer applied after bili that restates id compaction-basic silently re-arms native auto-compaction; the first symptom is a landed checkpoint destroying the fold base. The gate entry now scans the composed loader tree once the loader is available (optional, never a hard dependency) and logs one loud line naming the offending row and the fix.

Detection is pure and covered both ways: healthy declaration silent, dropped auto reported, stock-disabled web row silent, unrelated rows ignored.

(cherry picked from commit d67fe40)
The type is only referenced inside the module; the repo's unused-exports gate rejects exported types with no external consumer.

(cherry picked from commit 81780db)
…it a cold window

headersFor stamped x-bili-plugin-model / -context-window for the model the
session header names (#2381), but an llm/stream dispatch can stream to a
different model: auxiliary calls (compaction, title, subagent) running on
another model carried the session model's numbers, so the proxy's exact-match
gate discarded the header channel and the request was sized against the
fallback window. The window resolve was also fire-and-forget, so a model's
first dispatch always went out with no window header.

The dispatch scope now carries the model the dispatch streams to
(GenerateOptions.provider + model, falling back to the session header
and the global default). A dispatch whose model has no cached window waits for
the in-flight resolve before its first fetch, bounded to 2s from the resolve's
start so a slow or hung resolver can never stall the stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ffbcdbf)
…ile (#7111)

cordis entry-level inject has no optional form, no timeout and no fallback, so gating the four Web presets on biliBasicCompactionPolicy meant any missing gate service left them pending forever: session creation failed with agent-presets/not-found while the host kept booting and serving its UI. Measured on dsh 0.2.2-rc.4: with the gate row disabled, resolve('standard') throws and four entries report pending.

The presets are no longer gated. The always-on gate entry reconciles the presets mounted before it activated (entry.update re-runs internal/config, so the overlay rewrites them exactly as on a cold resolve) and the loader is awaited in a child fiber, never injected hard. Losing the gate service now costs the overlay (stock compaction, wire guard #1729 as backstop), not the session.

Verified on a real host: gate disabled => resolve ok + zero pending; gate enabled => all four presets still carry disabled compaction-basic/command-compact rows.

(cherry picked from commit 9ec1e6f)
… gate)

Both types are referenced only inside their own module; the repo's unused-exports gate rejects exports with no external consumer.

(cherry picked from commit 23d42c3)
#7111 made the four Web presets fail-open, so disabling the
bili-compaction-gate entry no longer re-creates the pending-latch brick.
The real consequence is that native compaction stays ARMED while bili owns
the lane (no overlay to stand it down), which risks destroying the
compression substrate — the #1729 wire-level refusal is only the backstop.
Update the 'Disabling vs removing' section in both docs to say that instead
of the now-stale 're-creates the brick' claim.

(cherry picked from commit 18be132)
The 4000/10000 deadline literals are meaningful constants; name them to
match the file's MAX_BYTES/MAX_ENTRIES style. No behavior change.

(cherry picked from commit 96cf627)
The best-effort onLate cleanup runs after the round already settled
(deadline or caller abort); a failure there must not surface past the
settled outcome. Comment-only, no behavior change.

(cherry picked from commit 9b951ef)
…-fixes merge

The ci-fixes merge added the canonical module-map line (ref #6922, correct alphabetical position) while the PR branch already carried a botched duplicate (ref #6944, non-alphabetical position). Keep the canonical ci-fixes entry, drop the duplicate.

(cherry picked from commit 3a91f23)
⚠️ MODEL-FACING TEXT CHANGE
外部摘要失败回执明确说明服务恢复条件,避免诱导调用者反复更换范围。

将外部摘要全失败和无效配置接入现有连续失败保护;达到阈值后在派发前拒绝,配置、有效凭据、摘要长度设置变化或冷却到期可恢复,成功折叠清零。零派发的共享队列拥塞不计入服务失败。

Fixes #6903

Co-Authored-By: Claude Code <noreply@anthropic.com>
(cherry picked from commit 892c256)
… traffic off real DNS

pi-web-access 0.46 only sets __piWebAccessProxyFetch when the wrapped fetch
already has it, and marks its own wrapper with __piWebAccessSharedProxyFetch
instead. The fetch chain only knew the old name, so the #2435 coexistence
branch was unreachable and every install fell into the generic re-chain. The
#1662 escape then handed the rewritten INLINE_ORIGIN request to the oldest
live anchor, a real DNS lookup that dies ENOTFOUND, and only the first
occurrence is logged, so every later model call failed silently.

Recognize both markers in the depth-1 branch, the install guard, and the
marker the chain forwards, and never route pseudo-origin traffic to the
anchor: send it down the chain instead, where the hop stamp lets the inline
transport serve it in-process.

(cherry picked from commit 8895a2c)
…s proxy scope on (#6829)

With a pi-web-access proxy scope active, the wrapper sitting above the
inline link curls INLINE_ORIGIN URLs itself, so the #1662 depth-1 fix
never runs on that path and 0/2 inline-origin requests reach the engine
(scope OFF: 2/2). A second leak exists for requests inheriting a stale
dispatchDepth (#5614 shape), which skip dispatchBody entirely.

Fix (routing-only, no default/budget change):
- fetch-chain: exact-origin classifier isInlineOriginUrl (URL-parse;
  http only, exact hostname, default port, no credentials) and a
  classify-first check in patched — INLINE_ORIGIN requests run the
  link's own dispatch at a fresh depth 1 instead of being handed down
  the chain. The old depth-1 prefix route-down is removed.
- pi-inline: the serve logic is extracted as exported serveInlineOrigin
  (undefined when not installed or not an inline-origin URL); the link
  dispatch delegates to it.
- native-intercept: the dispatch's send is wrapped so every INLINE_ORIGIN
  send is served in-process via serveInlineOrigin; all other sends pass
  through untouched. Unconditional: bili cannot observe the wrapper's
  scope state from outside, so there is no signal to divert on.

Tests: three new regression tests in tests/pi-inline.test.ts (proxy-scope
ON/OFF, stale dispatchDepth, exact-origin classification) plus an updated
#6829 expectation (the wrapper never sees pseudo-origin traffic now);
11/11 pi-inline, 29/29 self-heal + #5614 neighbours.

Fixes #6829

(cherry picked from commit 2e97c3e)
#554 guard meter (#6828)

A dual-shape body carries the conversation under two top-level keys: the
lane's native field (messages[] on openai/anthropic, input[] on responses)
plus another protocol's field (a Responses-native host such as dsh sends
`input` alongside `messages`). The upstream bills only the native field, so
the protocol-blind meter counted the conversation twice and the egress fuse
false-tripped on the phantom total (1,815,699 measured vs ~380K billed,
4.77x), while preflight's protocol-aware estimate saw only ~135K and never
compressed.

Thread the lane's protocol through measuredOutbound and the preflight
measured-body doom tiers so the meter skips the foreign conversation fields
for that lane, top level only. Without a protocol the meter keeps its
fail-closed count-everything behavior.

Regression test: tests/issue6828-guard-meter-dual-shape.test.ts

(cherry picked from commit 1e3ebba)
…uard meter (#6828)

Review supplement to the PR: the egress fuse (relay) and the preflight
measured-body tiers were made protocol-aware, but sideRequestGuard() still
metered the raw body protocol-blind even though the lane protocol is a
parameter of the function. A dual-shape body's foreign conversation field
double-counted there too, false-blocking the compress/nudge side call —
the very request that would shrink the session.

- sideRequestGuard: pass the lane protocol to estimateRawBodyTokens
- regression test: a dual-shape body must not false-block the side request
  (verified red without the fix, green with it)

(cherry picked from commit 3d16a8a)
…te (#2170 lane-guard)

The lane-guard gate (#2170) requires that a change to
src/server/side-request.ts land alongside one of the dedicated side-lane
suites. The previous commit put the #6828 dual-shape regression in
tests/issue6828-guard-meter-dual-shape.test.ts (the meter's file), which
does not satisfy the gate. Move it to tests/side-request-isolation.test.ts,
the canonical home for sideRequestGuard tests.

(cherry picked from commit d143fbd)
The first commit inserted the MODEL_HIDDEN_BODY_KEYS declaration in the
middle of the #554 comment paragraph, orphaning the 'fails closed.' line
below the new const. Move the declaration (with its own complete comment)
after NON_TEXT_BODY_KEYS; no behavior change.

(cherry picked from commit 3aa825a)
…#6844)

Issue #6844 item 3: the measured-doom 413 lists four buckets, but 'other'
is a catch-all — attributing it took manual arithmetic (the incident's
88%-other body needed a body dump to identify dsh_session_log). Independent
of any exemption mechanism: the next unknown host-attached field will still
413, and the operator-facing message must say WHICH field is metered.

- estimateRawBodyBreakdown tracks per-top-level-field token counts for the
  other bucket in the same single walk (new RawBodyBreakdown.otherTop,
  descending; empty when other is empty; top-level arrays attribute to no
  field, as before).
- measuredBreakdownClause appends '(top field: <k> ~N)' when other is
  non-empty — all three 413 sites (egress fuse, preflight measured gate,
  fresh-session gate) inherit it.
- raw-body-walk-depth shape pin updated for the additive otherTop field.
- unit tests: per-field attribution + sum-to-bucket, hidden fields leave no
  attribution, clause naming + bare clause when other is empty.

(cherry picked from commit 2542369)
ci-check and others added 2 commits November 19, 2026 00:15
- a body whose mass is a model-hidden DSH top-level field (5M-char
  dsh_session_log, ~1.25M measured tokens vs the 1M floored bar) forwards
  to the upstream — the incident shape no longer 413s; the fuse is a meter,
  not a filter, so the field still rides byte-exact;
- an equally sized UNKNOWN top-level field still stops at the fuse (the
  exemption is a documented-field allowlist, not a hole — #3617 gate
  discipline) and the 413 names the dominating field.

(cherry picked from commit 9299436)
…ed usage

An advisor reply bundles several model calls (executor, advisor, executor) and
its top-level usage sums the executor calls, about twice the real context. bili
read that sum as the context size: in session ccda2ec4 it logged 488,488 tokens,
122% of a 400K window, when the context was about 241K, and fired emergency
nudges and preflight folds on it.

The reply's usage also lists each call in `iterations`. The context the next
request carries is what the last executor call read, so the usage paths (plugin
stream, proxy loop, non-streaming relay) now pass that number to
settleUsageReport, which uses it for lastInputTokens and the calibration pair.
Billing still counts the full sum. A one-call reply is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1c212cd)
@ranxianglei ranxianglei added the ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: batch/community-batch-2026-11-19 (ebd361e)

Latest build — install this exact version

npm install -g billion-context@0.0.10863-pr.7196.3dd1366

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
ebd361e billion-context@0.0.10863-pr.7196.3dd1366 build
ebb9725 billion-context@0.0.10845-pr.7196.1c2ca55 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr7196.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title batch-4: 13 community fixes across dsh / claude / opencode / pi / egress (verbatim cherry-picks, authorship preserved) [PR] batch-4: 13 community fixes across dsh / claude / opencode / pi / egress (verbatim cherry-picks, authorship preserved) Nov 18, 2026
@resec

resec commented Nov 18, 2026

Copy link
Copy Markdown

#7196 的 4 个红 shard 是同一个测试,根因是批次内两处调用约定冲突

结论:test (ubuntu 22/3, 24/3) + test (windows 22/5, 24/5) 全红,但只挂一个用例——
tests/issue6770-compaction-coverage-text.test.ts:70 → #6770: the argument-less default reads the live record the overlay writes。

+ actual   '1 preset entry rewritten (unnamed-entry×2)'
- expected '1 preset entry rewritten (preset-dsh-go-companion×2)'

根因:同一批次里两个提交对 internal/config 监听器的调用形态不一致。

  1. 8710905e4 fix(dsh): read the config hook's fiber argument instead of this (#7115) 把监听器改成 (fiber, next),并按 cordis 的 waterfall 语义认定 this 恒为 null(vendor/cordis/src/events.ts:163)。于是 entryNameOf(fiber) 只从第一个参数取 entry.options.name。
  2. 686d3d8d feat(dsh): surface compaction overlay coverage on the first routed request (#6770) 的测试 fixture 仍按旧形态注入名字:
mw.call({ entry: { options: { name: "preset-dsh-go-companion" } } }, null, () => cfg);

第一参数是 null → entryNameOf(null) 返回 undefined → 记录退化为 unnamed-entry。断言因此失败,且两 OS × 两 Node 版本稳定复现,不是 flake。

建议修法(一行 fixture):

mw.call(null, { entry: { options: { name: "preset-dsh-go-companion" } } }, () => cfg);

参照片内已绿的 tests/issue7112-config-hook-fiber.test.ts(fiberOf(name) 把 fiber 作为第一个参数传入)。若希望 fixture 与真实宿主更贴近,可用同样的 fiberOf helper 而不是手写对象字面量。

边界说明:ranxianglei/billion-context 的 #7196 分支属 owner 自有车道,resec 无写权限、也没有在该分支上改过任何文件;这里只给证据与最小修法。另外注意本批次里 ffc75459b 是对 #7117 的重写(非 verbatim cherry-pick),与 #7115 的 fiber 语义耦合,建议在合入前确认这两处口径一致。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — 这是本线程自己的 batch PR,无并列的第二个修复 PR 指向同一主题(已核对 open [PR] 行)。

Reviewed the batch at source (all 13 fixes read commit-by-commit against current master, not just the PR description), plus the assembly mechanics. Verdict: mergeable, with one process gap to close first (details below).

Assembly mechanics — verified

Per-fix verdicts (all SAFE, with teeth)

Each fix matches its description and ships a regression test that actually asserts the behavior (real cordis Context, mock timers, real advisor-reply numbers — not tautologies). Highlights:

⚠️ One gap to close before merge (process, not code)

#6905 carries a ⚠️ MODEL-FACING TEXT CHANGE that is in the commit message but NOT at the top of the PR body. AGENTS.md §7.3 requires model-facing text changes to be surfaced "at the very top of the PR body, before any other content." The new external-summary failure receipt ("COMPRESS CIRCUIT BREAKER … paused … resume after config/credentials change or 10 minutes …") is exactly the kind of string the model reads and acts on. The commit (39b125df5b) has it; the PR body doesn't.

I can't edit the PR body (it's yours), so: please add a ⚠️ MODEL-FACING TEXT CHANGE line at the very top of the PR body naming the #6905 receipt change. Everything else is clean.

CI state (verified live, mirror cache)

30 checks, 0 failed, 0 pending: 10 green = guard gates (gate×6, lifecycle-ledger-guard, config-surface-guard, plan, version-guard); 20 skipped = the actual test/static-gates/e2e lanes (skipped because the PR is labeled ci:full). So the full suite has not run yet — your "251 pass / 3 fail" is the local run; the authoritative green is the pending ci:full run. The 3 claimed-environmental failures (opencode-v2 activation ×2, #2443 tool-registration timeout) I could not independently confirm as master-reproducible without running the suite (node_modules absent here), so treat that as your claim pending CI.


结构化八问

  1. 是什么问题:一次性把 13 个已各自评审 SAFE 的社区修复(8 位作者)以 verbatim cherry-pick(-x,作者/日期/消息保留)汇成单个 batch PR 合入。
  2. 什么原因导致的:13 个独立缺陷各自独立(详见各 PR);本 PR 本身不引入新逻辑,只做装配 + 3 处机械冲突消解。
  3. 影响范围与严重程度:覆盖 dsh / claude / opencode / pi / egress 五条泳道。其中 3 处是有意的行为变更(见第 5 问),其余为缺陷修复;无 p1 级新风险——最重的 [PR] fix(dsh): replace the fail-closed preset gate with a post-load reconcile (#7111) #7117 是把「丢 gate 服务=会话创建失败」降级为「丢 gate 服务=丢 overlay(回退原生压缩)」,严格更宽松。
  4. 怎么修复的:装配层 = 32 个 -x cherry-pick(保留作者)+ 3 处机械冲突消解(gate 条目单回调串联 reconcile+alarm;preflight 两处 walk 叠加 foreign+model-hidden 双排除);不改动任何修复的语义。
  5. 是否有回归问题:已逐项清点 13 处触碰路径的既有行为,有意变更 3 处均已披露:①[PR] fix(dsh): replace the fail-closed preset gate with a post-load reconcile (#7111) #7117 preset 门控 fail-closed→fail-open(旧:丢服务→4 preset 永久 pending→agent-preset/not-found;新:立即挂载+gate 事后 reconcile,丢服务只损 overlay);②[PR] fix: avoid model list request hanging for a long time | fix: 避免模型列表请求长时间挂起 #6912 冷 Codex catalog 从无期限→10s 上限(超时=普通上游失败,非伪造模型列表);③[PR] fix(external-summary): stop repeated total failures and recover after repair #6905 外部摘要全失败 3 连→第 4 次零派发拒发(模型可见回执变更,需补 PR 顶部 ⚠️)。其余 10 处为纯缺陷修复,未触碰语义/阈值/时序/输出格式。高危模式(修 A 坏 B、fail-fast 变吞错)逐项过:无。
  6. 是否破坏缓存:无。[PR] fix: take an advisor reply's context from its last call, not the summed usage #6961 只改 lastInputTokens/校准对的取值口径(多调用 advisor 回复取最后一次调用),计费 inputTokens 仍计全量,缓存命中/失效策略未动;[PR] fix: fix memory accounting after session content release | fix: 修复会话内容释放后的内存计量 #6911 只改驻留权重失效时机,不碰缓存。
  7. 是否改了设计方向:无架构/边界/数据流转向;[PR] fix(dsh): replace the fail-closed preset gate with a post-load reconcile (#7111) #7117 的 fail-open 是既有 gate 机制的降级策略修正(疏:让丢服务不再砖会话),非新方向。
  8. 是否引入了新的配置:无新 env/config/默认值。[PR] fix: avoid model list request hanging for a long time | fix: 避免模型列表请求长时间挂起 #6912 的 4s/10s 是内部具名常量(WARM_DEADLINE_MS/COLD_DEADLINE_MS),非配置面。

收工判定:可合 —— 代码与装配全部干净、作者保留、基于当前 master、guard gates 全绿;合并前请先 ①在 PR 顶部补 #6905 的 ⚠️ MODEL-FACING TEXT CHANGE,②等 ci:full 全量跑绿。两处都满足即可合。

…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).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

@resec 诊断正确,我已独立验证并当场修复 + 推送到 PR 分支。

独立验证(不依赖你的描述,逐条核对):

已修复(顺手修,一行 fixture,commit ebd361e1a0,已 push 到 batch/community-batch-2026-11-19):

// 旧:名字塞 this(旧签名)
mw.call({ entry: { options: { name: "preset-dsh-go-companion" } } }, null, () => cfg);
// 新:名字作为 fiber 第一参数(与 cordis 真实派发 + tests/issue7112 一致)
mw.call(null, { entry: { options: { name: "preset-dsh-go-companion" } } }, () => cfg);

本地验证:issue6770 + issue7112/7113/7111/3354/3662/4147 共 40 用例全绿(先 npm --prefix kernel run build 补齐 acp-kernel/dist,否则后 5 个文件会因 ERR_MODULE_NOT_FOUND 假红——那是环境问题不是回归)。

纠正你的一条侧边说法: ffc75459b 不是「非 verbatim cherry-pick 的重写」——它带 -x 标记 (cherry picked from commit 9ec1e6f33674184216fe05b23268a2b9b13f726d),作者/日期/消息都是 resec 原样。你真正该盯的耦合点在装配层:dsh-compaction-gate.ts 里 #7116 的 boot alarm 与 #7117 的 reconcile 被合成进同一个 ctx.inject(["loader"]) 回调(这是 PR 正文声明的 3 处机械冲突消解之一),我已读过最终合成态确认两者都存活、口径一致。#7115 的 fiber 语义与 #7117 的 reconcile 并不直接耦合——reconcile 走的是 entry.update() 重载,不读 internal/config 监听器的 this/fiber。

CI 状态: 我推送后 ci:full 会重跑。你报的 4 个红 shard(ubuntu 22/3、24/3、windows 22/5、24/5)全挂同一个用例,这次修复后应转绿;请等新一轮 ci:full 确认。另外提醒 owner:我上一轮 review 提的 PR 顶部缺 #6905 的 ⚠️ MODEL-FACING TEXT CHANGE 仍未补,合并前需一并处理。

This branch has not been deployed

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

Labels

ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR root-cause

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: all external summaries failing bypasses consecutive failure protection, repeated compress continues dispatching req | fix: 外部摘要全失败绕过连续失败保护,重复 compress 继续派发请求 [Bug][dsh] measured-body egress fuse meters a model-hidden DSH field: 88% of a refused body was dsh_session_log inside the other bucket pi-web-access 0.46+ breaks the #2435 coexistence path, then the #1662 fallback sends inline-origin traffic to real DNS Guard meter inflates the body size by ~4.8x, causing the egress fuse to trip on normal requests. | guard meter 把 body 体量放大 ~4.8 倍,正常请求被 egress fuse 拦下 [opencode-v2] ACP tools registered with permission:"allow" cannot be allowlisted by name in agent permissions

8 participants