





















@@ -103,11 +103,12 @@ describe("discoverAuthStorage", () => {
103103type: "api_key",
104104key: "sk-ant-runtime",
105105});
106-expect(credentials["openai-codex"]).toMatchObject({
107-type: "oauth",
108-access: "oauth-access",
109-refresh: "oauth-refresh",
110-});
106+const codexCredential = credentials["openai-codex"] as
107+| { type?: string; access?: string; refresh?: string }
108+| undefined;
109+expect(codexCredential?.type).toBe("oauth");
110+expect(codexCredential?.access).toBe("oauth-access");
111+expect(codexCredential?.refresh).toBe("oauth-refresh");
111112});
112113113114it("scrubs static api_key entries from legacy auth.json and keeps oauth entries", async () => {
@@ -126,10 +127,9 @@ describe("discoverAuthStorage", () => {
126127127128const parsed = await readLegacyAuthJson(agentDir);
128129expect(parsed.openrouter).toBeUndefined();
129-expect(parsed["openai-codex"]).toMatchObject({
130-type: "oauth",
131-access: "oauth-access",
132-});
130+const codexEntry = parsed["openai-codex"] as { type?: string; access?: string } | undefined;
131+expect(codexEntry?.type).toBe("oauth");
132+expect(codexEntry?.access).toBe("oauth-access");
133133});
134134});
135135@@ -145,7 +145,9 @@ describe("discoverAuthStorage", () => {
145145scrubLegacyStaticAuthJsonEntriesForDiscovery(path.join(agentDir, "auth.json"));
146146147147const parsed = await readLegacyAuthJson(agentDir);
148-expect(parsed.openrouter).toMatchObject({ type: "api_key", key: "legacy-static-key" });
148+const openrouterEntry = parsed.openrouter as { type?: string; key?: string } | undefined;
149+expect(openrouterEntry?.type).toBe("api_key");
150+expect(openrouterEntry?.key).toBe("legacy-static-key");
149151} finally {
150152if (previous === undefined) {
151153delete process.env.OPENCLAW_AUTH_STORE_READONLY;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。