Skip to content

fix(wire): pin acp-kernel 0.0.95 — Copilot-Gemini-portable compress schema (#1414) - #1423

Merged
ranxianglei merged 2 commits into
masterfrom
2026-09-26_gemini-schema-contract
Sep 26, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-09-26_gemini-schema-contract

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Kernel 0.0.95 (acp-kernel #448/#454, published) replaced the compress tool schema's union type arrays and untyped anyOf fragments with explicit typed alternatives — Copilot Gemini stops 400ing with invalid_request_body on requests carrying the ACP compress tool.

Bili bundles the kernel schema at build time, so this PR:

  1. Bumps the exact dev-dependency pin 0.0.93 → 0.0.95 (npm install acp-kernel@0.0.95 --save-exact).
  2. Adds tests/wire-schema-portable.test.ts — the Bili wire-contract regression Copilot Gemini rejects ACP compress schema with invalid_request_body #1414 asks for: walks the full outgoing ACP tool surface on all four wires (anthropic/openai/responses/google), including Bili's own withRangeParams rewrites, asserting:
    • no union type arrays anywhere,
    • every anyOf alternative declares an explicit scalar type,
    • top level stays a plain object (Anthropic requirement).

A/B verified: red against 0.0.93 (3/4 wires fail on content.type: ["array","string"]), green against 0.0.95 (4/4). Also carries everything else in 0.0.95: nested-image stripping (#437), open-objectives carry-forward (#443), shared segmentation + turn-aware status (#415), prettier baseline tooling.

Local: typecheck clean, new suite 4/4.

Fixes #1414

…chema (#1414)

Kernel #448 (acp-kernel 0.0.95) replaced the compress tool's union
type arrays and untyped anyOf fragments with explicit typed
alternatives; Bili bundles that schema at build time, so the exact
dev-dependency pin is the delivery path.

Adds tests/wire-schema-portable.test.ts walking Bili's full outgoing
ACP tool surface on all four wires (anthropic/openai/responses/google,
including withRangeParams rewrites): no union type arrays, every anyOf
alternative declares an explicit scalar type, top level stays a plain
object. Red against 0.0.93 (3/4 wires fail), green against 0.0.95.

Fixes #1414
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-26_gemini-schema-contract (8afedf0)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-1423

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Reviewing PR #1423 now (the follow-up pin-bump promised in the #1414 thread): verifying the 0.0.93→0.0.95 pin + lockfile, re-running typecheck/tests/build on the PR head, auditing the full 0.0.95 delta (not just the schema fix), and checking the new tests/wire-schema-portable.test.ts against the WC-008 contract from #1415. Will report the verdict shortly.

- wire-contract goldens regenerated for acp-kernel 0.0.93→0.0.95 via
  scripts/update-wire-contract-goldens.ts: compress/decompress/search
  schemas gain explicit typed anyOf alternatives (kernel #448, the
  Copilot-Gemini portability fix). Reviewed: no unrelated drift.
- preflight e2e windows 10_600 → 12_000: the typed-alternative schema
  grew tool definitions by ~1.4KB (~340 tokens of wireOverhead, which
  every fit decision adds per #470). At 10_600 the recent zone no
  longer fit after folding — fold-all is correct behavior for a tight
  window, but these tests pin 'recent messages survive', so they need
  the headroom the pre-#448 schema size had. Payload still overflows
  12k (~13k-token history), so the preflight-fire premise is intact.
@ranxianglei

Copy link
Copy Markdown
Owner Author

CI failures diagnosed and fixed (8afedf0). The 6 red tests were two distinct classes:

1. Wire-contract goldens (4×, expected) — the pin bump changes every tool schema (that's the point of the PR). Regenerated via the sanctioned scripts/update-wire-contract-goldens.ts; reviewed the diff: only the #448 typed-alternatives restructure (explicit type on every anyOf branch, union arrays split), no unrelated drift.

2. Preflight e2e (2×, real behavioral edge — investigated to root cause):

Real-world note: small-window (≤12k) sessions now carry ~340 more overhead tokens per request. If that matters, a kernel follow-up could slim the schema (dedupe shared fragment descriptions); not blocking here — correctness is unaffected and larger windows don't notice.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Review complete — verified against the fixed head (8afedf0). Verdict: mergeable.

① Original issue (#1414) — direction correct. Root cause lived in the kernel (union type arrays + untyped anyOf fragments in the compress schema → Copilot Gemini 400 invalid_request_body); the fix belongs in acp-kernel #448, and since bili bundles the kernel at build time, the exact-pin bump is the right (and only) bili-side change. Pin is exact ("acp-kernel": "0.0.95", no caret), lockfile integrity sha512 matches the npm registry byte-for-byte, and 0.0.95 is live on npm.

② Regression audit — existing behaviors touched by the bundled delta:

③ Code. Two clean commits: pin + new test, then goldens + test windows — each labeled, no src/ changes. Base is fresh (branch contains current master c030b56), mergeable state clean.

④ Test validity — tests/wire-schema-portable.test.ts. Has teeth: red against 0.0.93 (3/4 wires fail on content.type: ["array","string"]), green against 0.0.95 (4/4). Covers all four wires including Bili's own withRangeParams rewrites, asserts top level stays a plain object, and requires an explicit scalar type on every anyOf alternative. One minor future-proofing note (non-blocking): walk() recurses into properties/items/anyOf but not oneOf/allOf — the current schema contains zero oneOf/allOf (verified in the goldens), so coverage is complete today; if the kernel ever introduces a oneOf branch, the walk would skip it silently (golden snapshots would still catch the shape change).

⑤ Diff cleanliness. Clean — six files, every line serves #1414.

Verification evidence. CI on head 8afedf0: all runs green, including E2E (real codex), e2e-fake-codex, e2e-local-registry, Windows overlay. Local re-run: typecheck clean, build OK, full suite 2812 tests / 2800 pass / 0 fail / 12 skipped (by design). Both previously-red classes confirmed fixed, with correct root causes — the preflight one in particular is a genuine behavioral edge handled properly (test adjusted to preserve its pinned contract, real-world impact disclosed).

One gap to close (not blocking this PR): per the wire-constraint-ledger rule (AGENTS.md §7.3), the Gemini constraint should become a permanent WIRE_RULES entry with enforcement in the fixing PR. That piece currently lives in open PR #1415 (WC-008 ledger entry + Gemini-gated fake-upstream validator + tests/copilot-schema-contract.test.ts). It has zero file overlap with this PR — recommendation: merge #1415 immediately after this one so the permanent ledger records the constraint.

中文一句话摘要: 核实了 acp-kernel 0.0.95 钉版修复了 Copilot-Gemini 的 compress 工具 schema 400(新增四线路可移植性测试在 0.0.93 红/0.0.95 绿),golden 重生成仅含 #448 结构变更无漂移,preflight 两例失败的根因(schema 增大 ~340 tokens 挤爆小窗口 fit 判定)已独立复现且测试窗口调整保留了原断言意图,CI(含真实 codex e2e)全绿,可以合并;建议随后合入 #1415 补上 WC-008 台账条目。

@ranxianglei
ranxianglei merged commit d7d2b4b into master Sep 26, 2026
13 checks passed
@ranxianglei
ranxianglei deleted the 2026-09-26_gemini-schema-contract 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.

Copilot Gemini rejects ACP compress schema with invalid_request_body

1 participant