mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 01:17:46 +08:00
feat(routing): consolidate scheduling strategy configuration
This commit is contained in:
@@ -118,8 +118,7 @@ use crate::execution_runtime::{
|
||||
use crate::log_ids::short_request_id;
|
||||
use crate::orchestration::{
|
||||
apply_local_execution_effect, build_local_error_flow_metadata, classify_failure_disposition,
|
||||
cyber_continue_failover_enabled, spawn_local_oauth_success_effect,
|
||||
trace_upstream_response_body, with_error_flow_report_context,
|
||||
spawn_local_oauth_success_effect, trace_upstream_response_body, with_error_flow_report_context,
|
||||
with_upstream_response_report_context, FailureDisposition, FailureTokenAction,
|
||||
LocalAdaptiveRateLimitEffect, LocalAdaptiveSuccessEffect, LocalAttemptFailureEffect,
|
||||
LocalExecutionEffect, LocalExecutionEffectContext, LocalFailoverAnalysis,
|
||||
@@ -6173,7 +6172,10 @@ async fn execute_stream_from_frame_stream_with_retry_scope(
|
||||
}
|
||||
let prefetch_for_cyber_failover =
|
||||
is_openai_responses_family_format(plan.provider_api_format.as_str())
|
||||
&& cyber_continue_failover_enabled(state).await;
|
||||
&& crate::orchestration::routing_execution_policy_from_report_context(
|
||||
report_context.as_ref(),
|
||||
)
|
||||
.is_some_and(|policy| policy.cyber_continue_failover);
|
||||
let stream_commit_policy = StreamCommitPolicy::for_response(
|
||||
direct_stream_finalize_kind.is_some(),
|
||||
upstream_content_type,
|
||||
@@ -8501,14 +8503,6 @@ mod tests {
|
||||
Arc::new(provider_catalog),
|
||||
"development-key",
|
||||
);
|
||||
let data_state = if continue_failover {
|
||||
data_state.with_system_config_values_for_tests([(
|
||||
crate::orchestration::CYBER_CONTINUE_FAILOVER_CONFIG_KEY.to_string(),
|
||||
json!(true),
|
||||
)])
|
||||
} else {
|
||||
data_state
|
||||
};
|
||||
let state = AppState::new()
|
||||
.expect("app state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
@@ -8557,7 +8551,10 @@ mod tests {
|
||||
"candidate_index": 0,
|
||||
"retry_index": 0,
|
||||
"provider_api_format": "openai:responses",
|
||||
"client_api_format": "openai:responses"
|
||||
"client_api_format": "openai:responses",
|
||||
"routing_execution_policy": {
|
||||
"cyber_continue_failover": continue_failover
|
||||
}
|
||||
})),
|
||||
crate::clock::current_unix_ms(),
|
||||
Instant::now(),
|
||||
@@ -10515,7 +10512,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn prefetched_codex_cyber_policy_violation_retries_when_system_setting_is_enabled() {
|
||||
async fn prefetched_codex_cyber_policy_violation_retries_when_routing_strategy_is_enabled() {
|
||||
assert!(
|
||||
execute_prefetched_codex_cyber_policy_failure(true)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user