Repository navigation
[PR] wave-11 batch: 7 community fixes (opencode provider, preflight epoch, output budget, +4) — #6797/#6818 excluded - #6827
Conversation
) On a watermark fastpath hit, prepareOpenai re-parses scalar fields from the raw wire text, silently discarding the max_tokens restore that restoreOutputBudget had just applied upstream of it. The log still reports the restore while the forwarded body carries the client's shrunk value (max_tokens: 1). Snapshot the restored budget from the pre-rebind body and write it back after the rebind. The output-budget field plumbing moves from side-request.ts to budget.ts so the prepare modules can use it without reaching into the side-lane engine (#1440 P2 cut 2); side-request.ts re-exports it, so existing importers are untouched. Regression test: hermetic A/B golden over two proxies (rollout off vs on) asserting the starved turn forwards the restored ceiling on both paths, with a residency check proving the fastpath actually hit.
The shape pass and the residual census in planReconciliation compare every unclaimed anchor with every candidate. For each pair they ran canonicalTextOf, wordBagDigest and simhashHex on the candidate text again. These values depend only on the candidate text, so the work was anchors x candidates full-text tokenizations. A resumed session where every fold is inactive hits this hard: about 9.6k stored ids against 1.3k inbound messages kept the event loop busy for more than 300 s, so the watchdog killed the proxy. The next request for the same session started the loop again. Now each candidate's canonical text, word-bag digest and simhash are computed once. Candidates are grouped by word-bag digest (and, for user text, by unwrapped identity), keeping their original order. Each anchor only scans its own group, so the first match and the near-duplicate answer are the same as before. Measured on a copy of the affected store: the request that never finished now takes about 0.8 s in bili. The new test (3k anchors x 1.5k candidates) runs in about 1 s; before the change it did not finish in 300 s.
While a proxy is claimed (BILLION_CONTEXT_PROXY), the omp plugin stamps the session id as a top-level prompt_cache_key. The proxy strips it before it forwards. But when one request falls back to a direct send (the proxy is not ready, or its respawn failed), the claim is still set, so the body was already stamped and nothing strips the field. A strict upstream then rejects the request: 400 prompt_cache_key: Extra inputs are not permitted Record the values the plugin stamps, and give the omp lane its own direct-send guard: it runs the shared incremental guard first, then removes a top-level prompt_cache_key only when its value is one this process stamped. A key the host set itself is left alone.
…is pending (#6069) The #3641 epoch-confirm latch pauses preflight folding and passes the request through verbatim. An over-window payload cannot pass through, so the paused preflight reported 0 compressible ranges and every turn was refused with preflight_compress_failed. The latch clears only after a turn is forwarded, so the session could not recover. Keep the pause while the verbatim payload fits the window, judged on the same calibrated scale as the fold loop, and fold as usual once it does not.
…s gate) The constant is referenced only inside src/plugin-install.ts; the unused-exports CI lane (INTERNAL_ONLY) fails on it. Drop the leading export — no behavior change.
#6816) The routing PR writes providers.claude-agent.settings.baseURL on 2.x hosts; this note documents the new behavior in en+zh: re-run to route existing installs, port drift + the doctor warning, foreign baseURL preservation, and the mcp__opencode__* tools residual.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10835-pr.6827.7ed0148This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6827.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) Review of #6827 (wave-11 batch: 9 community fixes) Verdict: mergeable — one CI blocker found and fixed (pushed), pending CI green. I reviewed all 9 sub-PRs in detail (per-merge diffs against CI blocker — found and fixed. The Per-PR findings (code review, ③):
Regression review (②) — behavior changes, all intentional and disclosed:
Test effectiveness (④): each sub-PR ships a regression test — 9 new files ( Diff cleanliness (⑤/⑤b): clean — every line maps to one of the 9 fixes; no unrelated churn, no mass whitespace. Code quality is high: fail-closed validation, merge-preserving writes, advisory-only doctor, no dead code, named constants. The #6819 unused export 8问(结构化审核结论)
结论:可合。 9 个修复方向正确、代码质量高、各自有回归测试、无无意回归。唯一的 CI 阻塞(architecture-docs 缺条目)我已推一行修复,本地 lane 已绿;CI 在新 head |
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved — final head What I did this run:
八问(结构化结论)
判定:冲突已解,等新 head |
(ai: vllm-qwen/qwen3.8-27b) No action needed this run — the conflict was already resolved in the previous run; verified live just now. Live state (checked this run, not from memory):
The full CI pass is still running on 八问(结构化结论)
判定: 无新问题,CI 进行中(0 失败),若变红本车道会自动再触发处理。 |
0a9866a to
6d2e2a1
Compare
(ai: vllm-qwen/qwen3.8-27b) Red What I did this run:
八问(结构化结论)
判定: |
# Conflicts: # src/agent/pi.ts
# Conflicts: # tests/golden/storage-render/anthropic.json # tests/golden/storage-render/chat.json # tests/golden/storage-render/google.json # tests/golden/storage-render/responses.json
# Conflicts: # src/server/budget.ts
…6775 persisted fields) — wire shas unchanged, persisted digests only
ae09131 to
05d75f2
Compare
…, regenerate below)
…6775 persisted fields) — wire shas unchanged
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1233-master.a446a3c # this exact build
npm install -g billion-context@master # always the newest merged build
|
Re-sync the drifted-name / draft-envelope lane onto upstream master a446a3c (PR ranxianglei#6827, 24 commits / 33 files). No lane file is touched by this delta (overlap 0), so the merge is a pure history advance: no conflict resolution was needed. Verification on the merged tree: - kernel build rc=0 - tsc --noEmit: only the 5 pre-existing @deepseek-ai/cordis host-only errors in tests/dsh-tool-registration-lifetime.test.ts (also present on a pristine master worktree) - gates: check-unused-exports, config-surface-guard, lifecycle-ledger-guard, check-test-import-graph, check-architecture-docs all rc=0 - gen-config-docs generate: working tree clean (docs fixed point holds) - suites: issue5175 66/0, tag-echo 79/0, issue2190-degen-close 32/0, issue3905-announcement-tail 19/0, issue2929-codex-fold-double-miss 1/0, issue2303-draft-tail 14/0, native-compact-terminal 1/0, notice-registry 5/0, side-lane-invariants 18/0, issue5403-watermark-fastpath 1/0, issue6752-watermark-output-budget-restore 1/0
…nder golden conflict Master's batch11-wave11 (#6827) regenerated the storage-render goldens for new persisted fields; the PR's lastFoldDrift field also touches them. Regenerated from the merged code so the snapshots reflect both; golden suite 5/5, PR test 3/3, typecheck clean.
…lict at 0.0.200 Master advanced past the PR base again (batch11 wave11 #6827, lean-compress receipt #7105, wire-client-sidecars #7083, p1 batch b2/b3, #7087, #7101 -> kernel 0.0.199, storage-render goldens regenerated for #6775 persisted fields, 400 files). Content hunks auto-merged (kernel/src/compress.ts, kernel/src/types.ts, all four storage-render goldens); the only conflicts were the three kernel version lines, resolved at 0.0.200 = master's 0.0.199 + this PR's kernel/src change, per the CI-enforced kernel version discipline. Targeted local verification: tests/golden-storage-render.test.ts 5/5, tests/storage-state-fields.test.ts 2/2, kernel issue6116/issue3769/ hide-consumed suites 27/27.
Wave-11 batch: 7 community fixes — opencode provider routing, incremental-timestamp journal, preflight epoch pause, output-budget restore, and 3 more.
Author commits are kept verbatim (five PRs land as real two-parent merge commits; #6775/#6772/#6766 as their plain commits after the rebase onto current master — same bytes either way). Per-PR review done; independent reviewer passes over the largest (#6773). #6773 is not in this batch — held pending a fix or explicit ack (detailed comment on that PR). #6797 (pi thread negotiation) and #6818 (incremental-timestamp journal) are excluded per owner preference this round; both are reviewed and correct and can land separately.
claude-agent/*) drives a local Claude Code CLI that calls Anthropic directly, so the HTTP-hook routing never sees it — silently uncompressed.bili plugin install opencodenow routes it viaproviders.claude-agent.settings.baseURL(live lane port, merge-preserving, never clobbers a foreign baseURL); doctor warns on unrouted/foreign/stale-port states (2.x only).preflight_compress_failed, non-retryable) and the session can never recover — the latch only clears when the old history comes back, which it won't. The verbatim-pause now applies only while the payload still fits the window; over-window payloads fold as usual.prompt_cache_keyon a payload whose fingerprint no longer matches it → strict upstreams 400. The direct-send guard now drops only a key this process stamped (LRU set, cap 1024); host-set keys and the normal incremental path are untouched.calibratedEstimateModel,calibrationRing.model) — so a k̂ learned on one model leaks onto another after restart — and the emergency-shrink marker (emergencyShrinkAt/Estimate). Both restored on load with type validation.compactionCoverageText()formatter now emits the readout once per process on the first routed request.restoreOutputBudgethad restored into the parsed object — the restoredmax_tokensnever reached upstream while the log said success. The plumbing moved tosrc/server/budget.ts(side-request re-exports it) and the fastpath now carries the restored field. A/B golden e2e pins it.Review notes
jsonWriter=offregressions: converge-to-disk can permanently wedge a session under the multi-relay topology, and startup pre-warm silently skips sessions with originals. Full findings in the PR comment; waiting on author/owner decision.Verification
budget.tsre-export block) resolved by taking the PR's side — that move is the PR's point; verified no other hunk inbudget.tsdiffers between the two.npx tsc --noEmit: clean on the batch tip (afternpm run build).golden-storage-render(5/5 after kernel rebuild — the 6775 golden updates are consistent).Closes #6816
Closes #6069
Closes #6802
Closes #6800
Closes #6770
Closes #6752