完善 Router 共享账号与订阅契约

Router 固定 Token 展示名改为 agc_auto_generate,并同步后台安全查询测试。

文档记录跨独立数据库的稳定账号恢复、default 分组、订阅续期和 best-effort 扣费规则。

调整共享官方 Router 的非生产启动告警,并保留错误 code 构造能力。
This commit is contained in:
2026-09-02 14:56:19 +08:00
parent 1c6c499a11
commit b414f2f5f8
7 changed files with 39 additions and 10 deletions
+1 -1
View File
@@ -5489,7 +5489,7 @@ mod tests {
&json!([
"external-api-key-1",
"user-1",
"陶泥儿 LLM Router 官方账号(服务端)",
"agc_auto_generate",
"tnr_sk_fixture",
"[\"llm:responses\"]",
"2026-08-29T00:00:00Z",
@@ -63,6 +63,11 @@ impl AppError {
self
}
pub fn with_code(mut self, code: &'static str) -> Self {
self.code = code;
self
}
pub fn with_details(mut self, details: Value) -> Self {
self.details = Some(details);
self
+8 -3
View File
@@ -208,14 +208,19 @@ fn log_llm_router_startup_warnings(config: &AppConfig) {
);
}
if !config.is_production() && !is_loopback {
if !config.is_production() && base_url == OFFICIAL_LLM_ROUTER_BASE_URL {
warn!(
environment = %config.environment,
"非生产环境 LLM Router 目标不是 loopback;为避免测试污染线上用户,provisioning 和请求将被拒绝"
"非生产环境正在使用共享官方 LLM RouterRouter 账号、Token 和额度属于共享线上实例"
);
} else if !config.is_production() && !is_loopback {
warn!(
environment = %config.environment,
"非生产环境的 LLM Router 目标既不是官方固定路由也不是 loopbackprovisioning 和请求将被拒绝"
);
}
if config.is_test_environment() {
if config.is_test_environment() && is_loopback {
warn!("当前为 test 环境:必须使用 loopback Router fixture,不会连接线上用户服务");
}
}