fix(onboard): short-circuit model auth check · openclaw/openclaw@379ba2e
rubencu
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -91,6 +91,8 @@ describe("warnIfModelConfigLooksOff", () => {
|
91 | 91 | expect(note).not.toHaveBeenCalled(); |
92 | 92 | expect(listProfilesForProvider).toHaveBeenCalledWith(store, "openai"); |
93 | 93 | expect(listProfilesForProvider).toHaveBeenCalledWith(store, "openai-codex"); |
| 94 | +expect(resolveEnvApiKey).not.toHaveBeenCalled(); |
| 95 | +expect(hasUsableCustomProviderApiKey).not.toHaveBeenCalled(); |
94 | 96 | }); |
95 | 97 | |
96 | 98 | it("keeps custom OpenAI-compatible provider auth separate from Codex OAuth profiles", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,14 +77,11 @@ export async function warnIfModelConfigLooksOff(
|
77 | 77 | modelId: ref.model, |
78 | 78 | agentId: options?.agentId, |
79 | 79 | }); |
80 | | -const hasProfile = authProviders.some( |
81 | | -(provider) => listProfilesForProvider(store, provider).length > 0, |
82 | | -); |
83 | | -const envKey = authProviders.some((provider) => resolveEnvApiKey(provider)); |
84 | | -const hasCustomKey = authProviders.some((provider) => |
85 | | -hasUsableCustomProviderApiKey(config, provider), |
86 | | -); |
87 | | -if (!hasProfile && !envKey && !hasCustomKey) { |
| 80 | +const hasAuth = |
| 81 | +authProviders.some((provider) => listProfilesForProvider(store, provider).length > 0) || |
| 82 | +authProviders.some((provider) => resolveEnvApiKey(provider)) || |
| 83 | +authProviders.some((provider) => hasUsableCustomProviderApiKey(config, provider)); |
| 84 | +if (!hasAuth) { |
88 | 85 | warnings.push( |
89 | 86 | `No auth configured for provider "${ref.provider}". The agent may fail until credentials are added. ${buildProviderAuthRecoveryHint( |
90 | 87 | { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。