mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:14:31 +00:00
fix: clean tool schemas and thinking blocks for google-antigravity (openclaw#19732) thanks @Oceanswave
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Oceanswave <760674+Oceanswave@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -175,6 +175,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- Agents/Antigravity: preserve unsigned Claude thinking blocks as plain text instead of dropping them during transcript sanitization, preventing reasoning context loss while avoiding `thinking.signature` request rejections.
|
||||||
- Agents/Google: clean tool JSON Schemas for `google-antigravity` the same as `google-gemini-cli` before Cloud Code Assist requests, preventing Claude tool calls from failing with `patternProperties` 400 errors. (#19860)
|
- Agents/Google: clean tool JSON Schemas for `google-antigravity` the same as `google-gemini-cli` before Cloud Code Assist requests, preventing Claude tool calls from failing with `patternProperties` 400 errors. (#19860)
|
||||||
- Tests/Telegram: add regression coverage for command-menu sync that asserts all `setMyCommands` entries are Telegram-safe and hyphen-normalized across native/custom/plugin command sources. (#19703) Thanks @obviyus.
|
- Tests/Telegram: add regression coverage for command-menu sync that asserts all `setMyCommands` entries are Telegram-safe and hyphen-normalized across native/custom/plugin command sources. (#19703) Thanks @obviyus.
|
||||||
- Agents/Image: collapse resize diagnostics to one line per image and include visible pixel/byte size details in the log message for faster triage.
|
- Agents/Image: collapse resize diagnostics to one line per image and include visible pixel/byte size details in the log message for faster triage.
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ describe("sanitizeSessionHistory (google thinking)", () => {
|
|||||||
expect(assistant.content?.[0]?.thinking).toBe("reasoning");
|
expect(assistant.content?.[0]?.thinking).toBe("reasoning");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("drops unsigned thinking blocks for Antigravity Claude", async () => {
|
it("converts unsigned thinking blocks to text for Antigravity Claude", async () => {
|
||||||
const out = await sanitizeSimpleSession({
|
const out = await sanitizeSimpleSession({
|
||||||
modelApi: "google-antigravity",
|
modelApi: "google-antigravity",
|
||||||
modelId: "anthropic/claude-3.5-sonnet",
|
modelId: "anthropic/claude-3.5-sonnet",
|
||||||
@@ -99,8 +99,10 @@ describe("sanitizeSessionHistory (google thinking)", () => {
|
|||||||
content: [{ type: "thinking", thinking: "reasoning" }],
|
content: [{ type: "thinking", thinking: "reasoning" }],
|
||||||
});
|
});
|
||||||
|
|
||||||
const assistant = out.find((msg) => (msg as { role?: string }).role === "assistant");
|
const assistant = out.find((msg) => (msg as { role?: string }).role === "assistant") as {
|
||||||
expect(assistant).toBeUndefined();
|
content?: Array<{ type?: string; text?: string }>;
|
||||||
|
};
|
||||||
|
expect(assistant.content).toEqual([{ type: "text", text: "reasoning" }]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("maps base64 signatures to thinkingSignature for Antigravity Claude", async () => {
|
it("maps base64 signatures to thinkingSignature for Antigravity Claude", async () => {
|
||||||
|
|||||||
@@ -101,6 +101,12 @@ export function sanitizeAntigravityThinkingBlocks(messages: AgentMessage[]): Age
|
|||||||
const candidate =
|
const candidate =
|
||||||
rec.thinkingSignature ?? rec.signature ?? rec.thought_signature ?? rec.thoughtSignature;
|
rec.thinkingSignature ?? rec.signature ?? rec.thought_signature ?? rec.thoughtSignature;
|
||||||
if (!isValidAntigravitySignature(candidate)) {
|
if (!isValidAntigravitySignature(candidate)) {
|
||||||
|
// Preserve reasoning content as plain text when signatures are invalid/missing.
|
||||||
|
// Antigravity Claude rejects unsigned thinking blocks, but dropping them loses context.
|
||||||
|
const thinkingText = (block as { thinking?: unknown }).thinking;
|
||||||
|
if (typeof thinkingText === "string" && thinkingText.trim()) {
|
||||||
|
nextContent.push({ type: "text", text: thinkingText } as AssistantContentBlock);
|
||||||
|
}
|
||||||
contentChanged = true;
|
contentChanged = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user