Fix : noAuth support for providers and adjusted MITM restart settings.

This commit is contained in:
decolua
2026-04-14 10:14:50 +07:00
parent 7959fd37ad
commit 6a6e2fcd77
9 changed files with 23 additions and 14 deletions
+2 -2
View File
@@ -172,8 +172,8 @@ export async function handleChatCore({ body, modelInfo, credentials, log, onCred
return createErrorResult(HTTP_STATUS.BAD_GATEWAY, errMsg);
}
// Handle 401/403 - try token refresh
if (providerResponse.status === HTTP_STATUS.UNAUTHORIZED || providerResponse.status === HTTP_STATUS.FORBIDDEN) {
// Handle 401/403 - try token refresh (skip for noAuth providers)
if (!executor.noAuth && (providerResponse.status === HTTP_STATUS.UNAUTHORIZED || providerResponse.status === HTTP_STATUS.FORBIDDEN)) {
try {
const newCredentials = await refreshWithRetry(() => executor.refreshCredentials(credentials, log), 3, log);
if (newCredentials?.accessToken || newCredentials?.copilotToken) {