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

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
The Cloudflare Blog
IT之家
IT之家
雷峰网
雷峰网
小众软件
小众软件
博客园 - 叶小钗
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog

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
fix(comfy): read config from plugins.entries instead of m...
547895019 · 2026-04-25 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import {

55

} from "./image-generation-provider.js";

66

import {

77

buildComfyConfig,

8+

buildLegacyComfyConfig,

89

mockComfyCloudJobResponses,

910

mockComfyProviderApiKey,

1011

parseComfyJsonBody,

@@ -25,6 +26,7 @@ describe("comfy image-generation provider", () => {

25262627

afterEach(() => {

2728

_setComfyFetchGuardForTesting(null);

29+

vi.unstubAllEnvs();

2830

vi.restoreAllMocks();

2931

});

3032

@@ -42,6 +44,57 @@ describe("comfy image-generation provider", () => {

4244

).toBe(true);

4345

});

444647+

it("falls back to legacy models.providers comfy config when plugin config is absent", () => {

48+

const provider = buildComfyImageGenerationProvider();

49+

expect(

50+

provider.isConfigured?.({

51+

cfg: buildLegacyComfyConfig({

52+

workflow: {

53+

"6": { inputs: { text: "" } },

54+

},

55+

promptNodeId: "6",

56+

}),

57+

}),

58+

).toBe(true);

59+

});

60+61+

it("treats cloud comfy workflows as configured with a plugin config API key", () => {

62+

const provider = buildComfyImageGenerationProvider();

63+

expect(

64+

provider.isConfigured?.({

65+

cfg: buildComfyConfig({

66+

mode: "cloud",

67+

apiKey: "comfy-test-key",

68+

image: {

69+

workflow: {

70+

"6": { inputs: { text: "" } },

71+

},

72+

promptNodeId: "6",

73+

},

74+

}),

75+

}),

76+

).toBe(true);

77+

});

78+79+

it("treats cloud comfy workflows as configured with a plugin config env SecretRef", () => {

80+

vi.stubEnv("COMFY_TEST_API_KEY", "comfy-secret-ref-key");

81+

const provider = buildComfyImageGenerationProvider();

82+

expect(

83+

provider.isConfigured?.({

84+

cfg: buildComfyConfig({

85+

mode: "cloud",

86+

apiKey: { source: "env", provider: "default", id: "COMFY_TEST_API_KEY" },

87+

image: {

88+

workflow: {

89+

"6": { inputs: { text: "" } },

90+

},

91+

promptNodeId: "6",

92+

},

93+

}),

94+

}),

95+

).toBe(true);

96+

});

97+4598

it("submits a local workflow, waits for history, and downloads images", async () => {

4699

_setComfyFetchGuardForTesting(fetchWithSsrFGuardMock);

47100

fetchWithSsrFGuardMock

@@ -301,4 +354,82 @@ describe("comfy image-generation provider", () => {

301354

outputNodeIds: ["9"],

302355

});

303356

});

357+358+

it("uses plugin config env SecretRef auth for cloud workflows", async () => {

359+

vi.stubEnv("COMFY_TEST_API_KEY", "comfy-secret-ref-key");

360+

_setComfyFetchGuardForTesting(fetchWithSsrFGuardMock);

361+

mockComfyCloudJobResponses(fetchWithSsrFGuardMock, {

362+

body: Buffer.from("cloud-data"),

363+

contentType: "image/png",

364+

filename: "cloud.png",

365+

outputKind: "images",

366+

promptId: "cloud-secret-ref-1",

367+

redirectLocation: "https://cdn.example.com/cloud.png",

368+

});

369+370+

const provider = buildComfyImageGenerationProvider();

371+

await provider.generateImage({

372+

provider: "comfy",

373+

model: "workflow",

374+

prompt: "cloud workflow prompt",

375+

cfg: buildComfyConfig({

376+

mode: "cloud",

377+

apiKey: { source: "env", provider: "default", id: "COMFY_TEST_API_KEY" },

378+

workflow: {

379+

"6": { inputs: { text: "" } },

380+

"9": { inputs: {} },

381+

},

382+

promptNodeId: "6",

383+

outputNodeId: "9",

384+

}),

385+

});

386+387+

const submitRequest = fetchWithSsrFGuardMock.mock.calls[0]?.[0];

388+

const submitHeaders = new Headers(submitRequest?.init?.headers);

389+

expect(submitHeaders.get("x-api-key")).toBe("comfy-secret-ref-key");

390+

expect(parseJsonBody(1)).toMatchObject({

391+

extra_data: {

392+

api_key_comfy_org: "comfy-secret-ref-key",

393+

},

394+

});

395+

});

396+397+

it("uses provider auth fallback for cloud workflows without plugin config API keys", async () => {

398+

vi.stubEnv("COMFY_API_KEY", "stale-env-key");

399+

mockComfyProviderApiKey("profile-key");

400+

_setComfyFetchGuardForTesting(fetchWithSsrFGuardMock);

401+

mockComfyCloudJobResponses(fetchWithSsrFGuardMock, {

402+

body: Buffer.from("cloud-data"),

403+

contentType: "image/png",

404+

filename: "cloud.png",

405+

outputKind: "images",

406+

promptId: "cloud-profile-1",

407+

redirectLocation: "https://cdn.example.com/cloud.png",

408+

});

409+410+

const provider = buildComfyImageGenerationProvider();

411+

await provider.generateImage({

412+

provider: "comfy",

413+

model: "workflow",

414+

prompt: "cloud workflow prompt",

415+

cfg: buildComfyConfig({

416+

mode: "cloud",

417+

workflow: {

418+

"6": { inputs: { text: "" } },

419+

"9": { inputs: {} },

420+

},

421+

promptNodeId: "6",

422+

outputNodeId: "9",

423+

}),

424+

});

425+426+

const submitRequest = fetchWithSsrFGuardMock.mock.calls[0]?.[0];

427+

const submitHeaders = new Headers(submitRequest?.init?.headers);

428+

expect(submitHeaders.get("x-api-key")).toBe("profile-key");

429+

expect(parseJsonBody(1)).toMatchObject({

430+

extra_data: {

431+

api_key_comfy_org: "profile-key",

432+

},

433+

});

434+

});

304435

});