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

View File

@@ -120,7 +120,7 @@ async fn gateway_locally_denies_sync_ai_control_execute_when_opted_in_and_execut
);
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);
@@ -255,7 +255,7 @@ async fn gateway_locally_denies_stream_ai_control_execute_when_opted_in_and_exec
);
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);
@@ -393,7 +393,7 @@ async fn gateway_does_not_proxy_control_execute_over_http_when_opted_in_and_exec
let payload: serde_json::Value = response.json().await.expect("body should parse");
assert_eq!(
payload["error"]["message"],
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商OpenAI Chat Completions原因代码: missing_auth_context"
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商"
);
assert_eq!(*plan_hits.lock().expect("mutex should lock"), 0);
assert_eq!(*execute_hits.lock().expect("mutex should lock"), 0);
@@ -526,7 +526,7 @@ async fn gateway_does_not_proxy_control_execute_over_http_when_opted_in_and_exec
let payload: serde_json::Value = response.json().await.expect("body should parse");
assert_eq!(
payload["error"]["message"],
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商OpenAI Chat Completions原因代码: missing_auth_context"
"请求缺少有效的用户或 API Key 认证上下文,无法选择上游提供商"
);
assert_eq!(*plan_hits.lock().expect("mutex should lock"), 0);
assert_eq!(*execute_hits.lock().expect("mutex should lock"), 0);

View File

@@ -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;
}

View File

@@ -654,7 +654,7 @@ async fn gateway_surfaces_local_execution_runtime_miss_reason_when_all_openai_ch
assert_eq!(payload["error"]["type"], "http_error");
assert_eq!(
payload["error"]["message"],
"找到 1 个支持模型 gpt-5 的候选提供商,但本次同步请求全部不可用:提供商类型不支持本地执行 2 次(原因代码: all_candidates_skipped"
"找到 1 个支持模型 gpt-5 的候选提供商,但本次同步请求全部不可用:提供商类型不支持本地执行 2 次"
);
let stored_candidates = request_candidate_repository