#7738 review fixups: kernel version bump + google empty-reasoning guard

Small fixes from local review of #7738 (see PR review comment):

- kernel/package.json 0.0.211 -> 0.0.212: kernel-guard (#2092) requires a
  kernel/package.json version bump whenever kernel/ source changes. master is
  already at 0.0.211, so this PR's wire/crosslane/msgid-pin source changes
  need 0.0.212 to pass the master->HEAD version-diff check. Top-level lock
  records acp-kernel as resolved:"kernel" (no version field) -> no lock change.
- wire/google.ts reasoningPart: an unsigned reasoning core with no raw part
  and empty text now yields no part (was a degenerate {text:""} part). Matches
  the anthropic/responses length guards. Cross-lane-only in effect (native
  Gemini reasoning cores carry a thought signature or a raw part), so
  single-lane google bytes are unchanged.
- session-lane.ts: drop the blank-line scar left by the prior deletion.

Verified: kernel tsc --noEmit clean; kernel suite 1685/1685 pass.
This commit is contained in:
ranxianglei
2026-11-26 22:56:32 +08:00
parent 8f4c62a620
commit e7bf782c2b
3 changed files with 16 additions and 20 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "acp-kernel",
"version": "0.0.211",
"version": "0.0.212",
"description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.",
"license": "MIT",
"author": "ranxianglei",
+15 -8
View File
@@ -404,7 +404,10 @@ export function coreToGoogle(messages: BiliMessage[], opts?: { model?: string })
if (m.role === "assistant") {
flushUser();
if (!model) model = { reasoning: [], text: [], calls: [] };
if (m.contentType === "reasoning") model.reasoning.push(reasoningPart(m));
if (m.contentType === "reasoning") {
const rp = reasoningPart(m);
if (rp) model.reasoning.push(rp);
}
else if (m.contentType === "tool-call") model.calls.push(toolCallPart(m));
else model.text.push(...contentParts(m));
} else {
@@ -467,16 +470,20 @@ export function conversationSignalGoogle(
* signatures) degrades to a PLAIN text part: Gemini 3 validates thought
* signatures, so an unsigned thought part rejects the whole request —
* pi's parity is to ship the text without the thought flag. */
function reasoningPart(m: BiliMessage): GooglePart {
function reasoningPart(m: BiliMessage): GooglePart | undefined {
const text = m.text ?? "";
const head = rawParts(m)[0];
if (head) return { ...head, text, thought: true };
if (!m.googleThoughtSignature) return { text };
return {
text,
thought: true,
...signatureField("thoughtSignature", m.googleThoughtSignature),
};
if (m.googleThoughtSignature)
return {
text,
thought: true,
...signatureField("thoughtSignature", m.googleThoughtSignature),
};
// Unsigned + no raw part: a plain text part — but only when there is
// actually text (an empty part is a no-op the request would carry for
// nothing; the anthropic/responses wires guard the same way).
return text ? { text } : undefined;
}
function toolCallPart(m: BiliMessage): GooglePart {
-11
View File
@@ -38,17 +38,6 @@
import type { Session } from "../session.js";
import type { BiliMessage } from "acp-kernel/wire";
type LogFn = (level: string, msg: string) => void;
const REDACTED_PLACEHOLDER = "[redacted_thinking]";