fix(kiro): 放行可刷新 OAuth 调度候选 (#340)

This commit is contained in:
Entropy.Xu
2026-04-26 23:49:55 +08:00
committed by GitHub
parent f3a9fd4c82
commit e8763b3bbd
5 changed files with 300 additions and 21 deletions
@@ -122,7 +122,7 @@ async fn gateway_locally_denies_openai_chat_after_repeated_execution_runtime_mis
assert_eq!(payload["error"]["type"], "http_error");
assert_eq!(
payload["error"]["message"],
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Chat Completions,原因代码: missing_auth_context)"
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商"
);
}
@@ -248,7 +248,7 @@ async fn gateway_locally_denies_openai_chat_when_control_api_is_configured_witho
assert_eq!(payload["error"]["type"], "http_error");
assert_eq!(
payload["error"]["message"],
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Chat Completions,原因代码: missing_auth_context)"
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商"
);
assert_eq!(*execute_hits.lock().expect("mutex should lock"), 0);
assert_eq!(*public_hits.lock().expect("mutex should lock"), 0);
@@ -359,7 +359,7 @@ async fn gateway_locally_denies_openai_chat_stream_after_execution_runtime_miss_
assert_eq!(payload["error"]["type"], "http_error");
assert_eq!(
payload["error"]["message"],
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Chat Completions,原因代码: missing_auth_context)"
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商"
);
assert_eq!(*execute_hits.lock().expect("mutex should lock"), 0);
assert_eq!(*public_hits.lock().expect("mutex should lock"), 0);
@@ -537,7 +537,7 @@ async fn gateway_locally_denies_openai_responses_after_execution_runtime_miss_wi
"cli",
"openai:cli",
"{\"model\":\"gpt-5\",\"input\":\"hello\"}",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Responses,原因代码: missing_auth_context)",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商",
)
.await;
}
@@ -551,7 +551,7 @@ async fn gateway_locally_denies_claude_messages_after_execution_runtime_miss_wit
"chat",
"claude:chat",
"{\"model\":\"claude-sonnet-4-5\",\"messages\":[]}",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商(Claude Messages,原因代码: decision_input_unavailable)",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商",
)
.await;
}
@@ -565,7 +565,7 @@ async fn gateway_locally_denies_openai_responses_stream_after_execution_runtime_
"cli",
"openai:cli",
"{\"model\":\"gpt-5\",\"input\":\"hello\",\"stream\":true}",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Responses,原因代码: missing_auth_context)",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商",
)
.await;
}
@@ -579,7 +579,7 @@ async fn gateway_locally_denies_claude_messages_stream_after_execution_runtime_m
"chat",
"claude:chat",
"{\"model\":\"claude-sonnet-4-5\",\"messages\":[],\"stream\":true}",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商(Claude Messages,原因代码: decision_input_unavailable)",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商",
)
.await;
}
@@ -593,7 +593,7 @@ async fn gateway_locally_denies_openai_compact_after_execution_runtime_miss_with
"compact",
"openai:compact",
"{\"model\":\"gpt-5\",\"input\":\"hello\"}",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Responses Compact,原因代码: missing_auth_context)",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商",
)
.await;
}
@@ -607,7 +607,7 @@ async fn gateway_locally_denies_openai_compact_stream_after_execution_runtime_mi
"compact",
"openai:compact",
"{\"model\":\"gpt-5\",\"input\":\"hello\",\"stream\":true}",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商(OpenAI Responses Compact,原因代码: missing_auth_context)",
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商",
)
.await;
}
@@ -621,7 +621,7 @@ async fn gateway_locally_denies_gemini_generate_after_execution_runtime_miss_wit
"chat",
"gemini:chat",
"{\"contents\":[]}",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商(Gemini Public,原因代码: decision_input_unavailable)",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商",
)
.await;
}
@@ -635,7 +635,7 @@ async fn gateway_locally_denies_gemini_v1_generate_after_execution_runtime_miss_
"chat",
"gemini:chat",
"{\"contents\":[]}",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商(Gemini Public,原因代码: decision_input_unavailable)",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商",
)
.await;
}
@@ -649,7 +649,7 @@ async fn gateway_locally_denies_gemini_stream_after_execution_runtime_miss_witho
"chat",
"gemini:chat",
"{\"contents\":[]}",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商(Gemini Public,原因代码: decision_input_unavailable)",
"请求缺少本地执行所需的认证、模型或配置上下文,无法选择上游提供商",
)
.await;
}