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,4 +1,3 @@
use super::*;
use crate::gateway::maintenance::ProviderCheckinRunSummary;
use aether_crypto::{encrypt_python_fernet_plaintext, DEVELOPMENT_ENCRYPTION_KEY};
use aether_data::repository::candidates::{
@@ -9,6 +8,7 @@ use aether_data::repository::provider_catalog::{
InMemoryProviderCatalogReadRepository, StoredProviderCatalogProvider,
};
use axum::routing::{get, post};
use super::{start_server, AppState, Arc, Json, Mutex, Router, StatusCode, json};
#[tokio::test]
async fn gateway_background_request_candidate_cleanup_deletes_expired_entries_in_batches() {
@@ -74,7 +74,7 @@ async fn gateway_background_request_candidate_cleanup_deletes_expired_entries_in
("request_candidates_retention_days".to_string(), json!(30)),
]);
let gateway_state = AppState::new("http://127.0.0.1:18084")
let gateway_state = AppState::new()
.expect("gateway state should build")
.with_data_state_for_tests(data_state);
let background_tasks = gateway_state.spawn_background_tasks();
@@ -202,18 +202,18 @@ async fn gateway_provider_checkin_runs_local_query_balance_for_configured_provid
vec![],
vec![],
));
let gateway_state = AppState::new("http://127.0.0.1:18084")
let gateway_state = AppState::new()
.expect("gateway state should build")
.with_data_state_for_tests(
crate::gateway::gateway_data::GatewayDataState::with_provider_catalog_repository_for_tests(
repository,
)
.with_system_config_values_for_tests([
("enable_provider_checkin".to_string(), json!(true)),
("provider_checkin_time".to_string(), json!("01:05")),
])
.with_encryption_key_for_tests(DEVELOPMENT_ENCRYPTION_KEY),
);
crate::gateway::gateway_data::GatewayDataState::with_provider_catalog_repository_for_tests(
repository,
)
.with_system_config_values_for_tests([
("enable_provider_checkin".to_string(), json!(true)),
("provider_checkin_time".to_string(), json!("01:05")),
])
.with_encryption_key_for_tests(DEVELOPMENT_ENCRYPTION_KEY),
);
let summary = crate::gateway::maintenance::perform_provider_checkin_once(&gateway_state)
.await
@@ -241,17 +241,17 @@ async fn gateway_provider_checkin_skips_when_disabled_via_system_config() {
vec![],
vec![],
));
let gateway_state = AppState::new("http://127.0.0.1:18084")
let gateway_state = AppState::new()
.expect("gateway state should build")
.with_data_state_for_tests(
crate::gateway::gateway_data::GatewayDataState::with_provider_catalog_repository_for_tests(
repository,
)
.with_system_config_values_for_tests([(
"enable_provider_checkin".to_string(),
json!(false),
)]),
);
crate::gateway::gateway_data::GatewayDataState::with_provider_catalog_repository_for_tests(
repository,
)
.with_system_config_values_for_tests([(
"enable_provider_checkin".to_string(),
json!(false),
)]),
);
let summary = crate::gateway::maintenance::perform_provider_checkin_once(&gateway_state)
.await