Repository navigation
[PR] kernel: sign the leading functionCall of a rebuilt Google model content (fold-split parallel batch → sticky 400) - #6888
Conversation
…nt (ranxianglei#6887) A fold that covers the signed head of a parallel functionCall batch but keeps a protected sibling made coreToGoogle emit a model content led by an unsigned call; Gemini 3+ 400s every later request. When no part of the rebuilt model content is signed and the target needs signatures, stamp the documented bypass value on the first functionCall. Signed parts, siblings, unsigned histories and Claude-family targets stay byte-identical. Adds wire-contract ledger WC-026.
The kernel version bump to 0.0.199 (PR ranxianglei#6888) left kernel/package-lock.json stale at 0.0.198, failing the lock-sync check. Regenerated with 'npm install --package-lock-only'; the only drift is the two version lines. Co-authored-by: e_work-daemon[bot] <198958989+ework-daemon[bot]@users.noreply.github.com>
[bot] 🏷 Duplicate screening: not a duplicate. The fold-split producer (a parallel batch whose signed head is folded away while a protected sibling survives) is a distinct mechanism from #6103 (shipped in 0.1.214), which fixed a different producer — a stripped proxy ReviewDirection (highest priority): Correct. The bug is a wire-shape defect in Code: The guard
Regression: I reviewed the existing behaviors the touched paths carry:
Tests: Real tests, not tautologies. The three new behaviour tests fail on master and pass with the fix. The fold-split repro is a genuine regression test (a parallel batch whose signed head is folded away, plus a later signed turn that stays Diff cleanliness: Clean. 5 files, 182+/2-. Every line relates to the fix. The kernel version bump 0.0.198 → 0.0.199 is CI-enforced (Kernel Boundary rule 2). No unrelated changes, no whitespace churn. CI fix I pushed: The only CI failure on the original head was 结构化八问
判定:可合。 修复方向正确、代码保守、测试真实、diff 干净; |
… CI fix) The root package-lock.json tracks the in-repo kernel via "acp-kernel": "file:./kernel"; its kernel entry was stale at 0.0.198 after the version bump to 0.0.199 (PR ranxianglei#6888). The lock-sync check also regens the root lockfile, so this line must move too. Co-authored-by: e_work-daemon[bot] <198958989+ework-daemon[bot]@users.noreply.github.com>
[bot] 🏷 CI update on the fixed head (
Verdict unchanged: mergeable. The PR's own changes are verified (kernel |
(ai: vllm-qwen/qwen3.8-27b) CI fixed — PR is fully green on new head What I did this run:
八问
判定:PR #6888 CI 全绿(head |
…discipline) Merging origin/master into this branch made the PR's original 0.0.198->0.0.199 bump invisible: master independently bumped the kernel to 0.0.199 (commits 497efc7, 4ccccab), so the diff vs master showed kernel/src changes with no version delta and kernel-guard Rule 2 failed. Re-bump to 0.0.200 restores the required version delta for the PR's kernel change (kernel/src/wire/google.ts). Lockfiles synced via npm install --package-lock-only.
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved + red CI fixed. PR is now fully green and mergeable. What I did this run:
八问(中文结论)
判定:本 PR 的合并冲突与红 CI 均已修复,CI 全绿、可合并,等待人工 review/merge。 |
[ework] CI fix verified green ✓ |
1 similar comment
[ework] CI fix verified green ✓ |
Fixes #6887
kernel-change:
coreToGoogle(kernel/src/wire/google.ts) is the only place that rebuilds Gemini model contents after a fold. The unsigned leadingfunctionCallis produced there, so the guard has to live there too. It is a mechanical wire-shape bug: the regression tests below reproduce it, and the root cause is reported in #6887.Not a model-facing text change. No config surface change. The root
package.jsonversion is untouched.Problem
Gemini 3+ requires the first
functionCallpart of each model content to carry athoughtSignature. Parallel siblings never carry one. Sometimes a fold covers the signed head of a parallel batch while a protected sibling survives.coreToGooglethen rebuilds a model content that leads with the unsigned sibling. Every later request 400s (Function call is missing a thought_signature in functionCall parts), including retries and cold-loads. The production evidence is in #6887 (0.1.214, agy + gemini-4-carbon-high).#6103 (shipped in 0.1.214) fixed a different producer, a stripped proxy
compresscall. This PR fixes the fold-split shape.Change
signLeadingFunctionCall(parts, { model, signing }), called fromflushModel. It acts only when all of these hold:gemini-(3+);functionCall.skip_thought_signature_validatoron that firstfunctionCalland leaves every other part as-is.kernel/tests/issue3939-wire-byte-stability.test.tsare unchanged and still pass.kernel/package.jsonversion 0.0.198 → 0.0.199.tests/wire-contract-fakes.ts): the fake Google upstream now rejects a signing conversation whose model content leads with an unsigned call. A gate test (positive plus two negatives) and a live-enforcement probe are intests/wire-contract.test.ts.Tests
kernel/tests/wire-google.test.ts:SIG-LATER);npm --prefix kernel testpasses.npm run typecheckis clean. The full-suite verdict comes from CI on this head.Alternative considered
Keep folds from splitting one model content's parallel batch, by moving the boundary or protecting the head. That is a unit-projection change (KDD #12), which is larger and needs owner design. The wire-level guard covers every producer of this shape, including this one and future ones. A projection-level rule could still be added on top.