diff --git a/src/agents/compaction.ts b/src/agents/compaction.ts index b19f9bc92b1..20a6d80fa43 100644 --- a/src/agents/compaction.ts +++ b/src/agents/compaction.ts @@ -257,7 +257,6 @@ async function summarizeChunks(params: { model, params.reserveTokens, params.apiKey, - params.headers, params.signal, effectiveInstructions, summary, diff --git a/src/agents/pi-extensions/compaction-safeguard.test.ts b/src/agents/pi-extensions/compaction-safeguard.test.ts index 17eef9998ac..929268b8b2a 100644 --- a/src/agents/pi-extensions/compaction-safeguard.test.ts +++ b/src/agents/pi-extensions/compaction-safeguard.test.ts @@ -1649,7 +1649,7 @@ describe("compaction-safeguard extension model fallback", () => { messageText: "test message", tokensBefore: 1000, }); - const { result, getApiKeyMock } = await runCompactionScenario({ + const { result, getApiKeyAndHeadersMock } = await runCompactionScenario({ sessionManager, event: mockEvent, apiKey: null, @@ -1660,7 +1660,7 @@ describe("compaction-safeguard extension model fallback", () => { // KEY ASSERTION: Prove the fallback path was exercised // The handler should have resolved request auth with runtime.model // (via ctx.model ?? runtime?.model). - expect(getApiKeyMock).toHaveBeenCalledWith(model); + expect(getApiKeyAndHeadersMock).toHaveBeenCalledWith(model); // Verify runtime.model is still available (for completeness) const retrieved = getCompactionSafeguardRuntime(sessionManager); @@ -1676,7 +1676,7 @@ describe("compaction-safeguard extension model fallback", () => { messageText: "test", tokensBefore: 500, }); - const { result, getApiKeyMock } = await runCompactionScenario({ + const { result, getApiKeyAndHeadersMock } = await runCompactionScenario({ sessionManager, event: mockEvent, apiKey: null, @@ -1685,7 +1685,7 @@ describe("compaction-safeguard extension model fallback", () => { expect(result).toEqual({ cancel: true }); // Verify early return: request auth should NOT have been resolved when both models are missing. - expect(getApiKeyMock).not.toHaveBeenCalled(); + expect(getApiKeyAndHeadersMock).not.toHaveBeenCalled(); }); }); @@ -1706,7 +1706,7 @@ describe("compaction-safeguard double-compaction guard", () => { customInstructions: "", signal: new AbortController().signal, }; - const { result, getApiKeyMock } = await runCompactionScenario({ + const { result, getApiKeyAndHeadersMock } = await runCompactionScenario({ sessionManager, event: mockEvent, apiKey: "sk-test", // pragma: allowlist secret @@ -1720,7 +1720,7 @@ describe("compaction-safeguard double-compaction guard", () => { expect(compaction.summary).toContain("## Open TODOs"); expect(compaction.firstKeptEntryId).toBe("entry-1"); expect(compaction.tokensBefore).toBe(1500); - expect(getApiKeyMock).not.toHaveBeenCalled(); + expect(getApiKeyAndHeadersMock).not.toHaveBeenCalled(); }); it("returns compaction result with structured fallback summary sections", async () => { @@ -1831,13 +1831,13 @@ describe("compaction-safeguard double-compaction guard", () => { messageText: "real message", tokensBefore: 1500, }); - const { result, getApiKeyMock } = await runCompactionScenario({ + const { result, getApiKeyAndHeadersMock } = await runCompactionScenario({ sessionManager, event: mockEvent, apiKey: null, }); expect(result).toEqual({ cancel: true }); - expect(getApiKeyMock).toHaveBeenCalled(); + expect(getApiKeyAndHeadersMock).toHaveBeenCalled(); }); it("treats tool results as real conversation only when linked to a meaningful user ask", async () => { diff --git a/src/agents/skills-install.download.test.ts b/src/agents/skills-install.download.test.ts index 408857a1f4e..bd8559b60fe 100644 --- a/src/agents/skills-install.download.test.ts +++ b/src/agents/skills-install.download.test.ts @@ -60,13 +60,7 @@ function buildEntry(name: string): SkillEntry { description: `${name} test skill`, filePath: path.join(skillDir, "SKILL.md"), baseDir: skillDir, - sourceInfo: { - path: skillDir, - source: "openclaw-workspace", - scope: "project", - origin: "package", - baseDir: skillDir, - }, + source: "openclaw-workspace", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills-status.test.ts b/src/agents/skills-status.test.ts index e61e9057a6c..3e0b2ab6783 100644 --- a/src/agents/skills-status.test.ts +++ b/src/agents/skills-status.test.ts @@ -17,13 +17,7 @@ describe("buildWorkspaceSkillStatus", () => { description: "test", filePath: "/tmp/os-scoped", baseDir: "/tmp", - sourceInfo: { - path: "/tmp", - source: "test", - scope: "project", - origin: "package", - baseDir: "/tmp", - }, + source: "test", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills.buildworkspaceskillstatus.test.ts b/src/agents/skills.buildworkspaceskillstatus.test.ts index 7169ef38353..4b3cca8808f 100644 --- a/src/agents/skills.buildworkspaceskillstatus.test.ts +++ b/src/agents/skills.buildworkspaceskillstatus.test.ts @@ -24,13 +24,7 @@ function makeEntry(params: { description: `desc:${params.name}`, filePath: `/tmp/${params.name}/SKILL.md`, baseDir: `/tmp/${params.name}`, - sourceInfo: { - path: `/tmp/${params.name}`, - source: params.source ?? "openclaw-workspace", - scope: "project", - origin: "package", - baseDir: `/tmp/${params.name}`, - }, + source: params.source ?? "openclaw-workspace", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills.resolveskillspromptforrun.test.ts b/src/agents/skills.resolveskillspromptforrun.test.ts index e8b424757e8..305e11f2f4e 100644 --- a/src/agents/skills.resolveskillspromptforrun.test.ts +++ b/src/agents/skills.resolveskillspromptforrun.test.ts @@ -17,13 +17,7 @@ describe("resolveSkillsPromptForRun", () => { description: "Demo", filePath: "/app/skills/demo-skill/SKILL.md", baseDir: "/app/skills/demo-skill", - sourceInfo: { - path: "/app/skills/demo-skill", - source: "openclaw-bundled", - scope: "project", - origin: "package", - baseDir: "/app/skills/demo-skill", - }, + source: "openclaw-bundled", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills/compact-format.test.ts b/src/agents/skills/compact-format.test.ts index 63b5eee22b5..cd9d6f42f15 100644 --- a/src/agents/skills/compact-format.test.ts +++ b/src/agents/skills/compact-format.test.ts @@ -15,13 +15,7 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S description: desc, filePath, baseDir: `/skills/${name}`, - sourceInfo: { - path: `/skills/${name}`, - source: "workspace", - scope: "project", - origin: "package", - baseDir: `/skills/${name}`, - }, + source: "workspace", disableModelInvocation: false, }; } diff --git a/src/cli/skills-cli.formatting.test.ts b/src/cli/skills-cli.formatting.test.ts index 69c762dc11e..7002bdc4aec 100644 --- a/src/cli/skills-cli.formatting.test.ts +++ b/src/cli/skills-cli.formatting.test.ts @@ -38,13 +38,7 @@ describe("skills-cli (e2e)", () => { description: "Capture UI screenshots", filePath: path.join(baseDir, "SKILL.md"), baseDir, - sourceInfo: { - path: baseDir, - source: "openclaw-bundled", - scope: "project", - origin: "package", - baseDir, - }, + source: "openclaw-bundled", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/plugins/provider-auth-storage.ts b/src/plugins/provider-auth-storage.ts index 813e333909d..7145386e9e0 100644 --- a/src/plugins/provider-auth-storage.ts +++ b/src/plugins/provider-auth-storage.ts @@ -9,13 +9,6 @@ import { } from "./provider-auth-helpers.js"; const resolveAuthAgentDir = (agentDir?: string) => agentDir ?? resolveOpenClawAgentDir(); -const ZAI_DEFAULT_MODEL_REF = "zai/glm-5"; -const XIAOMI_DEFAULT_MODEL_REF = "xiaomi/mimo-v2-flash"; -const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto"; -const HUGGINGFACE_DEFAULT_MODEL_REF = "huggingface/deepseek-ai/DeepSeek-R1"; -const TOGETHER_DEFAULT_MODEL_REF = "together/moonshotai/Kimi-K2.5"; -const LITELLM_DEFAULT_MODEL_REF = "litellm/claude-opus-4-6"; -const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF = "vercel-ai-gateway/anthropic/claude-opus-4.6"; type ProviderApiKeySetter = ( key: SecretInput,