|
1 | 1 | // Google tests cover index plugin behavior. |
2 | | -import { createHash } from "node:crypto"; |
3 | 2 | import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; |
4 | 3 | import os from "node:os"; |
5 | 4 | import path from "node:path"; |
@@ -16,6 +15,7 @@ import {
|
16 | 15 | import { createCapturedThinkingConfigStream } from "openclaw/plugin-sdk/provider-test-contracts"; |
17 | 16 | import type { RealtimeVoiceProviderPlugin } from "openclaw/plugin-sdk/realtime-voice"; |
18 | 17 | import { describe, expect, it, vi } from "vitest"; |
| 18 | +import { resolveGeminiCliProfileHome } from "./gemini-cli-auth-home.js"; |
19 | 19 | import { registerGoogleGeminiCliProvider } from "./gemini-cli-provider.js"; |
20 | 20 | import googlePlugin from "./index.js"; |
21 | 21 | import googleProviderDiscovery from "./provider-discovery.js"; |
@@ -38,15 +38,7 @@ describe("google provider plugin hooks", () => {
|
38 | 38 | it("exposes staged Gemini CLI OAuth homes as runtime external auth profiles", async () => { |
39 | 39 | const agentDir = await mkdtemp(path.join(os.tmpdir(), "openclaw-google-cli-auth-")); |
40 | 40 | const profileId = "google-gemini-cli:user@example.test"; |
41 | | -const profileHash = createHash("sha256").update(profileId).digest("hex").slice(0, 24); |
42 | | -const credentialsDir = path.join( |
43 | | -agentDir, |
44 | | -"cli-runtimes", |
45 | | -"google-gemini-cli", |
46 | | -"profiles", |
47 | | -profileHash, |
48 | | -".gemini", |
49 | | -); |
| 41 | +const credentialsDir = path.join(resolveGeminiCliProfileHome(agentDir, profileId), ".gemini"); |
50 | 42 | const idTokenPayload = Buffer.from( |
51 | 43 | JSON.stringify({ sub: "google-account-42", email: "user@example.test" }), |
52 | 44 | ).toString("base64url"); |
|