fix(litellm): ensure API key retry prompts for new key
- Clear CLI-provided API key and token options when retrying - Forces fresh prompt instead of reusing old credentials - Consistent behavior with base URL retry Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f901884913
commit
aa0d7563ff
@ -804,11 +804,18 @@ export async function applyAuthChoiceApiProviders(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action === "retry-apikey") {
|
if (action === "retry-apikey") {
|
||||||
// Re-prompt for API key and retry
|
// Re-prompt for API key and retry the entire flow
|
||||||
apiKey = await promptForApiKey();
|
// Clear the CLI-provided options to force prompting
|
||||||
await setLitellmApiKey(apiKey, params.agentDir);
|
const newParams = {
|
||||||
// Retry fetch by recursively calling this function
|
...params,
|
||||||
return await applyAuthChoiceApiProviders({ ...params, authChoice: "litellm-api-key" });
|
authChoice: "litellm-api-key" as const,
|
||||||
|
opts: {
|
||||||
|
...params.opts,
|
||||||
|
litellmApiKey: undefined, // Clear the CLI-provided API key so we can prompt
|
||||||
|
token: undefined, // Also clear token if it was used
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return await applyAuthChoiceApiProviders(newParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action === "retry-baseurl") {
|
if (action === "retry-baseurl") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user