mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 02:17:46 +08:00
feat(openai): align GPT-5.6 and Codex request contracts
This commit is contained in:
@@ -165,6 +165,7 @@ mod tests {
|
||||
global_model_id: format!("global-model-{id}"),
|
||||
global_model_name: "gpt-5".to_string(),
|
||||
selected_provider_model_name: "gpt-5".to_string(),
|
||||
supports_streaming: true,
|
||||
mapping_matched_model: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ fn enumerate_minimal_candidate_selection_inner(
|
||||
continue;
|
||||
};
|
||||
|
||||
let supports_streaming = row.supports_streaming();
|
||||
candidates.push(SchedulerMinimalCandidateSelectionCandidate {
|
||||
provider_id: row.provider_id,
|
||||
provider_name: row.provider_name,
|
||||
@@ -93,6 +94,7 @@ fn enumerate_minimal_candidate_selection_inner(
|
||||
global_model_id: row.global_model_id,
|
||||
global_model_name: row.global_model_name,
|
||||
selected_provider_model_name,
|
||||
supports_streaming,
|
||||
mapping_matched_model,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ mod tests {
|
||||
global_model_id: format!("global-model-{id}"),
|
||||
global_model_name: "gpt-5".to_string(),
|
||||
selected_provider_model_name: "gpt-5".to_string(),
|
||||
supports_streaming: true,
|
||||
mapping_matched_model: None,
|
||||
}
|
||||
}
|
||||
@@ -211,6 +212,27 @@ mod tests {
|
||||
assert_eq!(candidates[0].selected_provider_model_name, "gpt-5-canary-1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enumeration_preserves_effective_streaming_capability() {
|
||||
let mut row = sample_row("1");
|
||||
row.model_supports_streaming = Some(false);
|
||||
|
||||
let candidates =
|
||||
super::enumerate_minimal_candidate_selection(EnumerateMinimalCandidateSelectionInput {
|
||||
rows: vec![row],
|
||||
normalized_api_format: "openai:chat",
|
||||
requested_model_name: "gpt-5",
|
||||
resolved_global_model_name: "gpt-5",
|
||||
require_streaming: false,
|
||||
required_capabilities: None,
|
||||
auth_constraints: None,
|
||||
})
|
||||
.expect("candidate selection should build");
|
||||
|
||||
assert_eq!(candidates.len(), 1);
|
||||
assert!(!candidates[0].supports_streaming);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enumeration_preserves_theoretical_candidate_order_without_final_sorting() {
|
||||
let mut later_priority = sample_row("1");
|
||||
|
||||
@@ -25,6 +25,7 @@ pub struct SchedulerMinimalCandidateSelectionCandidate {
|
||||
pub global_model_id: String,
|
||||
pub global_model_name: String,
|
||||
pub selected_provider_model_name: String,
|
||||
pub supports_streaming: bool,
|
||||
pub mapping_matched_model: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user