Skip to content

Commit b8c9242

Browse files
fix(clawsweeper): address review for automerge-openclaw-openclaw-85570 (1)
1 parent 6f0b519 commit b8c9242

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/agents/tools/media-tool-shared.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ describe("hasGenerationToolAvailability", () => {
128128
).toBe(true);
129129
});
130130

131-
it("keeps config-backed auth when provider isConfigured only checks env/profile", () => {
131+
it("preserves a provider-specific not-configured result over generic config auth", () => {
132132
const cfg = {
133133
models: {
134134
providers: {
135-
"custom-image": {
135+
"workflow-image": {
136136
baseUrl: "https://example.com/v1",
137137
apiKey: "sk-configured", // pragma: allowlist secret
138138
models: [],
@@ -141,7 +141,7 @@ describe("hasGenerationToolAvailability", () => {
141141
},
142142
};
143143
const provider = {
144-
id: "custom-image",
144+
id: "workflow-image",
145145
defaultModel: "workflow",
146146
isConfigured: () => false,
147147
};
@@ -152,13 +152,13 @@ describe("hasGenerationToolAvailability", () => {
152152
provider,
153153
cfg,
154154
}),
155-
).toBe(true);
155+
).toBe(false);
156156
expect(
157157
resolveCapabilityModelConfigForTool({
158158
cfg,
159159
providers: [provider],
160160
}),
161-
).toEqual({ primary: "custom-image/workflow" });
161+
).toBeNull();
162162
});
163163

164164
it("allows generation tools for runtime providers configured without auth", () => {

src/agents/tools/media-tool-shared.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,10 @@ export function isCapabilityProviderConfigured<T extends CapabilityProvider>(par
214214
: false;
215215
}
216216
if (provider.isConfigured) {
217-
if (
218-
provider.isConfigured({
219-
cfg: params.cfg,
220-
agentDir: params.agentDir,
221-
})
222-
) {
223-
return true;
224-
}
217+
return provider.isConfigured({
218+
cfg: params.cfg,
219+
agentDir: params.agentDir,
220+
});
225221
}
226222
return hasProviderAuthForTool({
227223
provider: provider.id,

0 commit comments

Comments
 (0)