Skip to content

fix: pin acp-kernel 0.0.89 — Claude-lane hotfix (top-level anyOf removed from compress schema) - #1302

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-25_pin-0.0.89
Sep 25, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-25_pin-0.0.89

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #1299 (user-facing outage) · kernel side: acp-kernel #404 + #405 (merged), released as 0.0.89.

What happened

Kernel 0.0.87–0.0.88 gave COMPRESS_PARAMETERS a top-level anyOf (the #374 schema relaxation). Anthropic hard-rejects tool input_schema with top-level oneOf/allOf/anyOf → 0.1.148 (pin 0.0.88) 400s every request carrying the injected compress tool on the Claude lane (tools.91.custom.input_schema), and the auto-updater pushed it fleet-wide. 0.1.147 (0.0.86) unaffected.

This PR

  1. Pin 0.0.88 → 0.0.89 (kernel 0.0.89 = master + the fix: top-level back to plain {type, properties}, content-vs-flat alternation stays in descriptions + parser).
  2. NEW tests/kernel-pin-wire-schema.test.ts — the pin gate: imports the pinned kernel and walks every tool × every wire shape (anthropic / openai / responses / google, absorb / image_full / acp_retrieve included, plus the manifest path) asserting no top-level combinators. Verified it trips on 0.0.88 (red) and passes on 0.0.89 (green) — a future pin bump to a wire-illegal kernel now fails CI at the pin PR instead of production.

Gates

  • typecheck ✓
  • full suite: 2556 tests, 0 fail (10 e2e-gated skips)
  • build ✓

After merge

Needs hotfix release 0.1.149 — Claude proxy users are still 400-ing on 0.1.148. Also note: #1298 (fingerprint/refold) depends on kernel APIs not yet released (#398/#400) — its CI will stay red against this pin until the kernel ships them; that PR is blocked upstream by design.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-25_pin-0.0.89 (cd56fe1)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-1302

Each push to this PR publishes a new version under the pr-1302 npm tag.

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit 6998854 into master Sep 25, 2026
11 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

PR 已核验完毕(人工已于 05:37Z 合并,merge commit 69988547)。我拉取了合并头并在本地复验,结论:无问题。

Diff 与回归面

  • diff 最小:package.json pin 0.0.88→0.0.89、package-lock.json 仅 acp-kernel 条目(version/resolved/integrity)、新增 tests/kernel-pin-wire-schema.test.ts。无无关改动、无 lockfile churn。
  • kernel 0.0.88 vs 0.0.89 dist 逐文件比对:只有 compress-tools 变化(移除顶层 anyOf + 补 wire-legality 文档注释),该 pin 未带入任何其他行为变更——pin bump 的回归面仅限 schema 形状本身。

行为变更披露(旧→新)

  • compress input_schema 顶层:{type, properties, anyOf} → {type, properties};content-vs-flat 交替形式移入描述文本 + parseCompressInput 解析器校验,接受的输入形式一个不丢(flat 单段与 range-object 均收)。
  • 嵌套组合子不变且合法:content.items.anyOf(行/对象双形式)、COMPRESS_RANGE_OBJECT 自带的顶层 anyOf(仅作为数组 items 引用)。
  • 运行时实测 0.0.89 四种线型(anthropic/openai/responses/google)×全部工具:顶层键仅 type/properties(/required),零组合子——含 OPENAI/RESPONSES(此前"[bug] 0.1.148 Claude 请求因 compress 顶层 anyOf schema 被 Anthropic 400 拒绝 #1299 里说这两条线型仍带顶层 anyOf"的说法与 0.0.89 实际不符,实测干净)。

Gates(本地在合并头复跑)

  • typecheck ✓;full suite 2556 tests / 0 fail / 10 e2e-gated skip ✓;build ✓。
  • pin 门有效性双向复现:同一测试对 0.0.88 跑 → test 1 失败(正是 "top-level anyOf … Do NOT pin this kernel version");对 0.0.89 跑 → 全绿。未来钉到非法内核会在 pin PR 处挂 CI。
  • 构建产物审计:dist/index.js 中仅剩 2 处 anyOf,均为合法嵌套(range items / content items),无任何工具 schema 顶层组合子。

关联观察:#1301(#1299 会话提的并行热修 PR)在本 PR 之后 3 分钟也被合并(fab7dcff),只带来它自己的 tests/issue1299-anthropic-top-level.test.ts(bili 出口层:服务常量 + plugin manifest + 真实代理转发请求体)。master 现在有两套互补的 pin 门(kernel 导出层 + bili 出口层),都绿——当前 master 头复跑全套:2559 / 0 fail / 10 skip。两个并行会话产出重叠 PR 且双双合并,属查重缺口,记录备查,无需处理。

下一步:npm latest 仍是 0.1.148,Claude 用户仍在 400——我正按 §5 流程切 *_release-v0.1.149 分支提 release PR(纯版本号提交),开出后贴链接。另:PR 正文所述 #1298 对本 pin 的 CI 持续红是预期(kernel #398/#400 未发布所致),不阻塞本发布。

一句话总结:pin 0.0.89 热修已核实无误(kernel diff 仅含 schema 修复、pin 门测试双向复现有效、本地全套 gates 绿),合并无问题;正在提 0.1.149 发布 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

发布闭环完成,热修已上线:

  • 发布路径:本 issue 承诺的 0.1.149 发布已由 one-click manual release 工作流(release-manual.yml)执行——我按 §5 准备分支时发现 owner 已触发该流程:Actions 自动切了 2026-09-25_release-v0.1.149 分支、提交 release v0.1.149(415ca7f9)并开出 PR release v0.1.149 #1303(https://github.com/ranxianglei/billion-context/pull/1303),人工于 05:45:19Z 合并(merge commit dc8bdea5),CI 自动发布。我本地准备好的等价 release commit 未推送(内容完全一致,避免重复提交),本地分支已清理。
  • npm:latest = 0.1.149 ✓(tag v0.1.149 → dc8bdea5)。
  • 发布产物审计:从 npm 下载官方 0.1.149 tarball,重跑同一套检查——dist/index.js 中仅 2 处 anyOf,均为合法嵌套(range items / content items);COMPRESS_PARAMETERS 顶层 = {type:"object", properties…},零顶层组合子。与本地验证过的构建指纹一致,热修确实在发布的产物里。
  • 用户侧影响:运行中的实例会在 ~3 分钟检查周期内自更新到 0.1.149(重启后生效),Claude lane 的 400 随即消除;可用 bili start 日志或 bili doctor 确认收敛。今后任何把 pin 钉到 wire 非法内核的变更,都会被双层 pin 门(kernel 导出层 + bili 出口层)在 CI 拦下。

一句话总结:0.1.149 热修发布全链路闭环(one-click 工作流 PR #1303 已合并、npm 已发布、官方产物复审无顶层组合子),Claude lane 事故解除。

ranxianglei pushed a commit that referenced this pull request Sep 25, 2026
…enai SSE lane

Review of #1305 (mutation-verified) found the consolidation dropped the
old #1302 assertion for the OpenAI chat and Responses tool shapes:
top-level combinators were only checked on anthropic (WC-001) and google
(WC-006), so an anyOf on COMPRESS_TOOL_OPENAI.parameters passed every
rule test and only the golden byte-diffs caught it. Restores the ban as
part of WC-004/WC-005 with provenance; re-running the mutation now fails
6 rule tests (was 0).

Also: stream:true on the openai-chat smoke lane (activates the fake's
SSE branch and exercises the real src/stream-openai.ts parse path —
previously dead code), sse() no longer emits an empty event: line for
OpenAI chunks, and AGENTS.md now points WIRE_RULES at
tests/wire-contract-fakes.ts (where it is defined).
antclt pushed a commit to antclt/billion-context that referenced this pull request Sep 25, 2026
…nified ledger (ranxianglei#1304)

Consolidates the ranxianglei#1301 served-surface gate and the ranxianglei#1302 kernel-export gate
into one wire-contract suite and extends it per owner decision on ranxianglei#1304
(items 1+2+3, plus the 4-protocol scripted-client matrix phase):

- tests/wire-contract-fakes.ts: WIRE_RULES ledger (WC-001..WC-006, each with
  production/doc provenance) + strictest-known validation for all four wires
  (anthropic /v1/messages, openai chat, responses, google v1beta) + four
  validation-parity fake upstreams on listen(0) with canned per-wire replies.
- tests/wire-contract.test.ts: four layers — ledger self-check (every rule id
  has a live enforcement clause), A kernel exports, B bili-built surfaces,
  C plugin manifest (default + opt-in), D live proxy-mode forward of one
  client-shaped turn per protocol through the matching fake (asserts the
  forwarded tool set is exactly bili's intended surface and the fake's
  strictest validation accepts it). The anthropic lane reproduces ranxianglei#1299
  end-to-end. Supersedes tests/kernel-pin-wire-schema.test.ts and
  tests/issue1299-anthropic-top-level.test.ts (all their assertions kept).
- tests/wire-contract-golden.test.ts + tests/golden/wire-contract/*.json:
  byte-equal golden snapshots of every advertised tool schema at both layers
  (kernel exports, bili surfaces, plugin manifest default+opt-in); manifest
  version normalized to <VERSION> so release commits don't churn it.
- scripts/update-wire-contract-goldens.ts: explicit regeneration path.
- AGENTS.md §7.3: institutional rule — every upstream rejection/validation
  constraint becomes a permanent wire-contract rule inside the fixing PR;
  the ledger only grows.
@ranxianglei
ranxianglei deleted the 2026-09-25_pin-0.0.89 branch October 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] 0.1.148 Claude 请求因 compress 顶层 anyOf schema 被 Anthropic 400 拒绝

1 participant