mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 22:05:50 +00:00
feat: 添加gemini协议适配 (#125)
* feat: 添加gemini协议适配 * Remove unrelated local files from Gemini PR
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
isNotEmptyMessage,
|
||||
deriveUUID,
|
||||
normalizeMessages,
|
||||
normalizeMessagesForAPI,
|
||||
isClassifierDenial,
|
||||
buildYoloRejectionMessage,
|
||||
buildClassifierUnavailableMessage,
|
||||
@@ -486,3 +487,23 @@ describe("normalizeMessages", () => {
|
||||
expect(normalized.length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeMessagesForAPI", () => {
|
||||
test("preserves Gemini thought signature metadata on tool_use blocks", () => {
|
||||
const assistant = makeAssistantMsg([
|
||||
{
|
||||
type: "tool_use",
|
||||
id: "tool-1",
|
||||
name: "Bash",
|
||||
input: { command: "pwd" },
|
||||
_geminiThoughtSignature: "sig-123",
|
||||
},
|
||||
]);
|
||||
|
||||
const normalized = normalizeMessagesForAPI([assistant]);
|
||||
const block = (normalized[0] as AssistantMessage).message.content[0] as any;
|
||||
|
||||
expect(block.type).toBe("tool_use");
|
||||
expect(block._geminiThoughtSignature).toBe("sig-123");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user