kernel-guard snapshots github.event.pull_request.body at dispatch time
(ci.yml PR_BODY), so the runs triggered by the review-fix commits still
carry the pre-marker body and would fail on a red herring. This empty
commit produces a fresh pull_request event whose payload includes the
declaration.
The first commit regenerated the corpus after stripping the legacy
image keys, so tests/storage-corpus.test.ts asserted 'keys must NOT
materialize' against a fixture that never carried them — a vacuous pin
while the PR body claimed the corpus pinned back-compat.
The generator now re-injects the pre-#3266 keys into the on-disk record
after the normal write (writeAndPin mutateFiles hook), so the fixture
carries exactly what an older version persisted. Verified load behavior
pins honestly: whitelisted readers DROP stats.imageShrunk*/imageFull*
and state.imageShrinks/imageFullRestored; metadata is an opaque host
bag and passes THROUGH (legacy imageShrinks survives as inert data —
the digest covers the loaded view, so it pins that split). All case
digests shift because the kernel state.stats blob lost its three image
fields; folded/zstd pair stays byte-identical.
Review of the main removal commit left dead code behind: ImageFormat/
ImageBillingMode type aliases and the CompressionStats imagesShrunk/
imageBytesSaved/imageTokensSaved fields (seeded by createInitialState,
asserted in the kernel persist test) had zero remaining readers after
src/image-compress.ts went away. Removed them and reworded three
comments that still described the image_full restore channel as live.
CONFIGURATION.md got the strong disabled:true variant, the preset-ptc/cordis
resurrection trap, and the new banner alarm policy, but the zh-CN mirror was
left on the old weak auto:false-only recipe (AGENTS.md zh/en sync rule).
Mirrored all four sections verbatim from the en text.
1. src/web/diagnostics.ts used a raw .slice(-8) for the shortened session id
in the new conflict-banner blob — the #816/#1615 family gate (text-safe
scan over src/) correctly flagged it. Switch to safeSuffix from
src/text-safe.ts (surrogate-safe by construction).
2. tests/issue3148-upstream-circuit.test.ts pinned the pre-#3071 clamp
expectation (capped 1360); #3071's capability floor lifts the cap to
max(1360, min(4096, raw headroom)) = 4096 for the reporter's exact numbers.
Both PRs landed in the same window and master push CI skips the test
matrix, so the stale expectation surfaced as 3 red legs on the next PR to
run the matrix (this one). Aligned with the merged #3071 contract and
documented the math in the comment.
The opt-in compress.imageCompression pass and its image_full restore
channel are structurally broken where they matter most:
- hosts that reject bili-injected tools (codex) can never deliver the
restore call — the downscale is permanent for them (#3270 disarmed
the lane, which proved the tool was dead weight there);
- where the tool IS injectable, the model has no reliable way to learn
the ref of the downscaled message (no ref annotations on the wire),
producing the 38-round guess-reject-resend loop from #3266 (cache
hit 75% -> 28%).
Remove the whole feature from host and kernel: arrival-time downscale
pass, image_full injection + sticky restore + fail-streak guardrail,
image stats, persistence keys, wire-contract tool variants, config
schema, docs, and the sharp optional dependency. Every image now passes
through byte-identical at original resolution.
Sessions persisted by older versions load unchanged; legacy
imageShrinks/imageFullRestored state keys and imageShrunk* stats are
ignored on load (storage corpus pins that as a fixture).
kernel 0.0.126.
Only conflict: the #2682 dispatch rework and #2952 tier-distillation
recovery both touched the same declaration spot. Kept both sides
(union): the fold-order log flag plus the whole #2952 recovery block —
they are independent (dispatch ordering vs exhaustion-path recovery).
Verified on the merged tree: tsc --noEmit clean after kernel rebuild;
preflight family 189/189 green including issue2682 payoff-order (3),
issue2952 tier-recovery (5).
master moved past the PR base (#3273 incremental lane, #3199 unified web
lists, codexForge kind=prompt, network.allowPrivateHttpProviders docs).
Conflicts were all additive:
- src/server.ts: keep master's codexForge kind union (+"prompt") AND the
PR's autoModeForge Prepared field.
- src/server/handle.ts: combined import lines (knobs + auto-mode-forge +
v1internal); PR interception point verified to still run BEFORE the
#388 side-request split.
- CONFIGURATION.md / CONFIGURATION.zh-CN.md: keep both new env-table rows
(BILI_ALLOW_PRIVATE_HTTP_PROVIDERS, BILI_AUTO_MODE_FORGE), alphabetical.
Verified: tsc clean, 56/56 (auto-mode-forge + e2e-anthropic + web-i18n +
text-safe), test-suite-lock gate, import-graph gate, build OK.
Directive 4 — the banner is an alarm for interception FAILURE, not a ledger
viewer: bili_conflictSeverity now exposes a landed tier (hasConfirmed ||
unannounced-rewrite signal) and the render gate requires sev0.landed, so
suspected-plugin stock, sibling stock, display-only viewers, and recovered
(intercepted+rebased) landings stay recorded in acp_status / stats but never
pop the banner. #2912 neutralOnly stands-down preserved.
Directive 2+3 — new 不再提示 (don't show again) button: dismissal persists in
localStorage as a {lastAt, events} watermark so it survives reloads and new
sessions (users reported the banner stalking them across sessions), yet the
alarm re-arms automatically the moment a NEWER event lands — dismissal can
quiet stock, never mask fresh evidence.
Directive 5 — the banner now carries the #3040 report buttons (copy
diagnostics / report on GitHub) via a new conflict-banner diagnostics topic
that serves the aggregated conflict ledger summary (sessions/events/kinds/
classification/newest-per-session, session ids shortened) as a copyable blob
and a prefilled issues/new URL.
Directive 1 (docs) — CONFIGURATION.md #2474 recipe rewritten: strong variant
disabled: true on the nested compaction-basic row (the component actually
turns off, same mechanism dsh uses on the host plane) over the weak
auto: false variant, with the preset-ptc/preset-cordis resurrection trap
called out; BILI_CONFLICT_SCAN row documents the new banner policy.
Tests: web-conflict-banner +7 (landed-tier matrix incl. rewrite-signal-only
and recovered-only quiet, dismiss watermark re-arm semantics incl. corrupt
storage, gate/source assertions), web-storage-banner +1 (conflict-banner
diagnostics topic serves ledger section + decodable issue URL).
Port pi's findDegenerateRuns minRun semantics (200) onto the existing intrinsic
stream terminator: a model stuck in a symbol loop (#3946: one symbol string for
~22 minutes) now trips the stream mid-generation instead of running to
max-output or manual abort.
Detection runs on DECODED model text only — per-frame JSON walk over text-family
keys (openai delta.content/reasoning_content, anthropic text_delta/thinking_delta,
responses top-level delta, google parts[].text). Tool-call arguments are excluded
(#1039 user intent), and Responses cumulative snapshot events (.done/.completed/
.incomplete) are skipped so runs are never double-counted. Every frame is parsed:
token-granular streaming interleaves framing bytes between identical characters, so
a raw run-length pre-gate would stay blind to the incident shape. NDJSON bodies
(bare-newline events) are handled by a fallback splitter; byte-exact forwarding and
the clean-EOF trip contract are unchanged. Always on, zero new config.
Also neutralizes the trip log wording in relay.ts (two sites): it said 'runaway
enumeration detected' even when the reason is now text-run.
Pair by order, not id-set membership: a result needs a same-id call EARLIER
in the view (forward pass), a call needs a same-id result LATER (backward
pass). An id-set cannot tell two instances apart when a host re-issues the
same tool-call id for different calls (Agent Teams name:index ids), so a
half-pair whose own partner was folded away used to survive because a
different same-id partner was still visible - shipping an unpaired role:"tool"
message (upstream 400 "tool_call_id ... is not found") or an unanswered
tool_call ("... did not have response messages") and bricking the session.
Unique-id sessions behave identically to the old set lookup; one call still
answers any number of same-id results (precedence, not multiplicity); compress
calls stay exempt.
Fixes#3046
The dead-end cooldown tests pin "cooldown replays the cached diagnosis" and
"cooldown spends zero upstream calls" on an immediate r1->r2 retry, but seeded
a 400ms window. On loaded CI runners (windows node22 jitter, #3279) the gap
between arming the marker and the retry exceeds 400ms, so the retry legitimately
re-walks preflight instead of replaying — drifting the local token estimate in
the fail-fast message and re-spending upstream calls, which breaks the
byte-equality / zero-calls assertions as a sporadic red shard.
Widen BILI_PREFLIGHT_DEAD_END_COOLDOWN_MS to 60s in the four affected files so
the within-cooldown path is deterministic regardless of runner speed; in
preflight-empty-summary convert the #726 expiry leg from a wall-clock sleep to a
direct marker `until` cool-down so it no longer depends on the window size.
A/B evidence: 400ms window + 800ms gap -> 2 calls spent, messages diverge (flake);
60s window + 800ms/5000ms gaps -> 0 calls, byte-identical replay.
Fixes#3274
On the responses wire a codex host rejects bili-injected tools at its tool
router and records a synthetic "unsupported call" entry in its own resent
history. An armed CCR there declares acp_retrieve (unroutable by the host)
and placeholderizes oversized tool results the model can never retrieve back
(silent loss); every retrieve round-trip permanently forks client history
from ours (prefix-cache collapse). Same structural mechanism as image_full's
restore channel (#3266/#3270).
Gate the CCR arming stamp with !(protocol === "responses" && isCodexClient),
mirroring #3270's adjacent image_full gate. Disarmed -> no tool declaration,
no placeholder substitution; large tool results stay verbatim until regular
folding. Other lanes/wires unaffected; plugin-mode responses already excluded
via PLUGIN_CCR_WIRES. CCR is opt-in, so this only touches codex responses
users who explicitly enabled compress.ccr.
Test: tests/issue3272-ccr-codex-lane-gate.test.ts pins codex->disarmed /
non-codex->armed on the native responses wire.
- T1: shadow list = index baseline + tree delta — fresh row adopted with
zero decodes; externally rewritten file decoded and wins; unrecorded file
listed; ghost row dropped; live session overrides. Structural assert that
decode count equals the delta count only (no full-corpus decode).
- T2: unified boot parses only the newest window before listen; survivors
come from the savedAt-desc trim within the window (#404 contract kept);
label aliases seeded synchronously from index rows; remainder scan
completes post-boot and covers unrecorded labels.
- T3: legacy control — synchronous full parse, aliases complete immediately
after boot (zero regression for non-unified installs).
Small in-passing fix found while testing #3199, its own labeled commit.
Pre-existing failure verified on pristine master with the node:sqlite
builtin engine: the #841 cold-load case assumed every top-level entry under
the sessions dir is a protocol directory and readdir'd each one — unified
storage puts index.db (+WAL files) at top level, so the snapshot scan died
with ENOTDIR. Guard the descent with isDirectory(); unrelated to the #3199
change itself.