mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 18:07:47 +08:00
对齐 Codex CLI 0.159.3 的通用画像、模型能力与原生协议
This commit is contained in:
@@ -1860,14 +1860,20 @@ mod tests {
|
||||
assert_eq!(
|
||||
model_ids,
|
||||
vec![
|
||||
"gpt-6-astra",
|
||||
"gpt-6.1-sol",
|
||||
"gpt-6-sol",
|
||||
"gpt-6-luna",
|
||||
"gpt-5.6-sol",
|
||||
"gpt-5.6-terra",
|
||||
"gpt-5.6-luna",
|
||||
"gpt-daybreak-blue-latest",
|
||||
"gpt-daybreak-red-latest",
|
||||
"gpt-5.5",
|
||||
"codex-auto-review",
|
||||
"gpt-5.4",
|
||||
"gpt-5.4-mini",
|
||||
"gpt-5.2",
|
||||
"codex-auto-review",
|
||||
]
|
||||
);
|
||||
let sol = models
|
||||
@@ -1886,7 +1892,7 @@ mod tests {
|
||||
);
|
||||
assert_eq!(sol["multi_agent_version"], "v2");
|
||||
assert_eq!(sol["supports_image_detail_original"], true);
|
||||
assert_eq!(sol["context_window"], 372_000);
|
||||
assert_eq!(sol["context_window"], 272_000);
|
||||
|
||||
for model_id in ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"] {
|
||||
let model = models
|
||||
@@ -1894,11 +1900,11 @@ mod tests {
|
||||
.find(|model| model["id"] == model_id)
|
||||
.expect("GPT-5.6 Codex preset");
|
||||
assert_eq!(model["shell_type"], "shell_command");
|
||||
assert_eq!(model["comp_hash"], "3000");
|
||||
assert!(model.get("comp_hash").is_none());
|
||||
assert_eq!(model["experimental_supported_tools"], json!([]));
|
||||
assert_eq!(model["tool_mode"], "code_mode_only");
|
||||
assert_eq!(model["prefer_websockets"], true);
|
||||
assert_eq!(model["reasoning_summary_format"], "experimental");
|
||||
assert!(model.get("reasoning_summary_format").is_none());
|
||||
assert_eq!(model["truncation_policy"]["limit"], 10_000);
|
||||
assert_eq!(model["minimal_client_version"], "0.144.0");
|
||||
assert!(model.get("effective_context_window_percent").is_none());
|
||||
@@ -1924,7 +1930,7 @@ mod tests {
|
||||
assert_eq!(auto_review["supported_in_api"], true);
|
||||
assert_eq!(auto_review["default_reasoning_level"], "medium");
|
||||
assert_eq!(auto_review["default_reasoning_summary"], "none");
|
||||
assert_eq!(auto_review["use_responses_lite"], false);
|
||||
assert_eq!(auto_review["use_responses_lite"], true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -129,6 +129,12 @@ pub async fn build_standard_models_fetch_execution_plan_for_client_version(
|
||||
provider_type == "codex" && api_format.starts_with("openai:");
|
||||
let is_deepseek_anthropic_models_fetch = api_format.starts_with("claude:")
|
||||
&& deepseek_anthropic_models_fetch_uses_openai_auth(&transport.endpoint.base_url);
|
||||
if is_codex_openai_models_fetch {
|
||||
if let Some(version) = codex_client_version {
|
||||
aether_ai_formats::CodexClientProfile::cli(version)
|
||||
.map_err(|error| error.to_string())?;
|
||||
}
|
||||
}
|
||||
let mut headers =
|
||||
standard_models_fetch_headers(&api_format, &provider_type, codex_client_version);
|
||||
if is_codex_openai_models_fetch {
|
||||
@@ -636,10 +642,9 @@ fn standard_models_fetch_headers(
|
||||
return BTreeMap::from([
|
||||
(
|
||||
"user-agent".to_string(),
|
||||
format!(
|
||||
"{}/{client_version}",
|
||||
aether_ai_formats::codex_client_originator()
|
||||
),
|
||||
aether_ai_formats::CodexClientProfile::cli(client_version)
|
||||
.expect("validated Codex catalog client version")
|
||||
.user_agent,
|
||||
),
|
||||
(
|
||||
"originator".to_string(),
|
||||
@@ -1059,7 +1064,12 @@ mod tests {
|
||||
);
|
||||
assert_eq!(
|
||||
plan.headers.get("user-agent").map(String::as_str),
|
||||
Some("codex_cli_rs/0.145.2")
|
||||
Some(
|
||||
aether_ai_formats::CodexClientProfile::cli("0.145.2")
|
||||
.unwrap()
|
||||
.user_agent
|
||||
.as_str()
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
plan.headers.get("originator").map(String::as_str),
|
||||
|
||||
Reference in New Issue
Block a user