惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
有赞技术团队
有赞技术团队
博客园_首页
IT之家
IT之家
爱范儿
爱范儿
量子位
小众软件
小众软件
Jina AI
Jina AI
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
The Cloudflare Blog
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
雷峰网
雷峰网
V
Visual Studio Blog
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: trim duplicate local auth resolver cases · openclaw...
steipete · 2026-05-06 · via Recent Commits to openclaw:main

@@ -124,6 +124,7 @@ vi.mock("../plugins/provider-runtime.js", async () => {

124124

let applyAuthHeaderOverride: typeof import("./model-auth.js").applyAuthHeaderOverride;

125125

let applyLocalNoAuthHeaderOverride: typeof import("./model-auth.js").applyLocalNoAuthHeaderOverride;

126126

let hasUsableCustomProviderApiKey: typeof import("./model-auth.js").hasUsableCustomProviderApiKey;

127+

let hasSyntheticLocalProviderAuthConfig: typeof import("./model-auth.js").hasSyntheticLocalProviderAuthConfig;

127128

let requireApiKey: typeof import("./model-auth.js").requireApiKey;

128129

let resolveApiKeyForProvider: typeof import("./model-auth.js").resolveApiKeyForProvider;

129130

let resolveAwsSdkEnvVarName: typeof import("./model-auth.js").resolveAwsSdkEnvVarName;

@@ -140,6 +141,7 @@ beforeAll(async () => {

140141

({

141142

applyAuthHeaderOverride,

142143

applyLocalNoAuthHeaderOverride,

144+

hasSyntheticLocalProviderAuthConfig,

143145

hasUsableCustomProviderApiKey,

144146

requireApiKey,

145147

resolveApiKeyForProvider,

@@ -862,6 +864,33 @@ describe("resolveApiKeyForProvider", () => {

862864

});

863865864866

describe("resolveApiKeyForProvider – synthetic local auth for custom providers", () => {

867+

it("recognizes local baseUrl variants for synthetic auth config", () => {

868+

const localBaseUrls = [

869+

"http://127.0.0.1:8080/v1",

870+

"http://192.168.0.222:11434/v1",

871+

"http://localhost:11434/v1",

872+

"http://[::1]:8080/v1",

873+

"http://0.0.0.0:11434/v1",

874+

"http://[::ffff:127.0.0.1]:8080/v1",

875+

];

876+877+

for (const baseUrl of localBaseUrls) {

878+

expect(

879+

hasSyntheticLocalProviderAuthConfig({

880+

provider: "custom-local",

881+

cfg: {

882+

models: {

883+

providers: {

884+

"custom-local": createCustomProviderConfig(baseUrl),

885+

},

886+

},

887+

},

888+

}),

889+

baseUrl,

890+

).toBe(true);

891+

}

892+

});

893+865894

it("synthesizes a local auth marker for custom providers with a local baseUrl and no apiKey", async () => {

866895

const auth = await resolveCustomProviderAuth(

867896

"custom-127-0-0-1-8080",

@@ -873,43 +902,20 @@ describe("resolveApiKeyForProvider – synthetic local auth for custom providers

873902

expect(auth.source).toContain("synthetic local key");

874903

});

875904876-

it("synthesizes a local auth marker for private LAN custom providers with no apiKey", async () => {

877-

const auth = await resolveCustomProviderAuth(

878-

"custom-192-168-0-222-11434",

879-

"http://192.168.0.222:11434/v1",

880-

"qwen3.5:9b",

881-

"Qwen 3.5 9B",

882-

);

883-

expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);

884-

expect(auth.source).toContain("synthetic local key");

885-

});

886-887-

it("synthesizes a local auth marker for localhost custom providers", async () => {

888-

const auth = await resolveCustomProviderAuth("my-local", "http://localhost:11434/v1");

889-

expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);

890-

});

891-892-

it("synthesizes a local auth marker for IPv6 loopback (::1)", async () => {

893-

const auth = await resolveCustomProviderAuth("my-ipv6", "http://[::1]:8080/v1");

894-

expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);

895-

});

896-897-

it("synthesizes a local auth marker for 0.0.0.0", async () => {

898-

const auth = await resolveCustomProviderAuth(

899-

"my-wildcard",

900-

"http://0.0.0.0:11434/v1",

901-

"qwen",

902-

"Qwen",

903-

);

904-

expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);

905-

});

906-907-

it("synthesizes a local auth marker for IPv4-mapped IPv6 (::ffff:127.0.0.1)", async () => {

908-

const auth = await resolveCustomProviderAuth("my-mapped", "http://[::ffff:127.0.0.1]:8080/v1");

909-

expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);

910-

});

911-912905

it("does not synthesize auth for remote custom providers without apiKey", async () => {

906+

expect(

907+

hasSyntheticLocalProviderAuthConfig({

908+

provider: "my-remote",

909+

cfg: {

910+

models: {

911+

providers: {

912+

"my-remote": createCustomProviderConfig("https://api.example.com/v1"),

913+

},

914+

},

915+

},

916+

}),

917+

).toBe(false);

918+913919

await expect(

914920

resolveApiKeyForProvider({

915921

provider: "my-remote",