refactor: 移除 Python upstream 依赖,清理全部 legacy/Python 兼容层

- 移除 upstream_base_url 参数及 AETHER_GATEWAY_UPSTREAM 环境变量,gateway 不再需要指向 Python 宿主
- 删除所有 LEGACY_*/PYTHON_* 常量、路由组、header 定义及 sunset/phaseout 机制
- 将 legacy_gateway_bridge 重命名为 internal_gateway,executor 相关命名统一为 execution_runtime
- dev.sh 新增 Postgres/Redis 预检查,移除 upstream 相关启动参数和提示
- 新增 ai_public 路由处理器
- 全量适配 handler、test、state、control 等模块的命名和接口变更
This commit is contained in:
fawney19
2026-04-04 01:40:24 +08:00
parent 1d9c77522a
commit cbc811f6ce
484 changed files with 11046 additions and 3925 deletions
@@ -1,9 +1,33 @@
pub(crate) use super::*;
use super::super::{
admin_clear_oauth_invalid_key_id, admin_export_key_id, admin_provider_id_for_refresh_quota,
admin_reveal_key_id, admin_update_key_id, build_admin_create_provider_key_record,
build_admin_export_key_payload, build_admin_provider_key_response,
build_admin_provider_keys_payload, build_admin_reveal_key_payload,
build_admin_update_provider_key_record, normalize_string_id_list,
refresh_antigravity_provider_quota_locally, refresh_codex_provider_quota_locally,
refresh_kiro_provider_quota_locally,
};
use crate::gateway::handlers::public::build_admin_keys_grouped_by_format_payload;
use crate::gateway::handlers::{
admin_provider_id_for_keys, query_param_value, AdminProviderKeyBatchDeleteRequest,
AdminProviderKeyCreateRequest, AdminProviderKeyUpdateRequest, AdminProviderQuotaRefreshRequest,
OAUTH_ACCOUNT_BLOCK_PREFIX,
};
use crate::gateway::{AppState, GatewayError, GatewayPublicRequestContext};
use axum::{
body::{Body, Bytes},
http,
response::{IntoResponse, Response},
Json,
};
use serde_json::json;
use std::collections::BTreeSet;
use std::time::{SystemTime, UNIX_EPOCH};
pub(super) async fn maybe_build_local_admin_endpoints_keys_response(
state: &AppState,
request_context: &GatewayPublicRequestContext,
request_body: Option<&axum::body::Bytes>,
request_body: Option<&Bytes>,
) -> Result<Option<Response<Body>>, GatewayError> {
let Some(decision) = request_context.control_decision.as_ref() else {
return Ok(None);