mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: split Codex chat and responses defaults
This commit is contained in:
@@ -30,7 +30,10 @@ fn applies_codex_defaults_when_body_rules_do_not_handle_fields() {
|
||||
assert!(body.get("top_p").is_none());
|
||||
assert!(body.get("metadata").is_none());
|
||||
assert_eq!(body["store"], false);
|
||||
assert_eq!(body["instructions"], "You are ChatGPT.");
|
||||
assert_eq!(body["instructions"], "");
|
||||
assert_eq!(body["include"], json!(["reasoning.encrypted_content"]));
|
||||
assert_eq!(body["parallel_tool_calls"], true);
|
||||
assert!(body.get("reasoning").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -293,7 +293,11 @@ mod tests {
|
||||
|
||||
assert!(converted.get("metadata").is_none());
|
||||
assert_eq!(converted["store"], false);
|
||||
assert_eq!(converted["instructions"], "You are ChatGPT.");
|
||||
assert_eq!(converted["instructions"], "");
|
||||
assert_eq!(converted["include"], json!(["reasoning.encrypted_content"]));
|
||||
assert_eq!(converted["parallel_tool_calls"], true);
|
||||
assert_eq!(converted["reasoning"]["effort"], "medium");
|
||||
assert_eq!(converted["reasoning"]["summary"], "auto");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde_json::Value;
|
||||
|
||||
use crate::ai_serving::transport::apply_standard_provider_request_body_rules_with_request_headers;
|
||||
use crate::ai_serving::{
|
||||
apply_codex_openai_responses_special_body_edits,
|
||||
apply_codex_openai_responses_chat_body_edits,
|
||||
apply_openai_responses_compact_special_body_edits,
|
||||
build_cross_format_openai_chat_request_body_with_model_directives as surface_build_cross_format_openai_chat_request_body,
|
||||
build_local_openai_chat_request_body_with_model_directives as surface_build_local_openai_chat_request_body,
|
||||
@@ -75,7 +75,7 @@ pub(crate) fn build_cross_format_openai_chat_request_body(
|
||||
body_json,
|
||||
request_headers,
|
||||
)?;
|
||||
apply_codex_openai_responses_special_body_edits(
|
||||
apply_codex_openai_responses_chat_body_edits(
|
||||
&mut provider_request_body,
|
||||
provider_type,
|
||||
provider_api_format,
|
||||
|
||||
@@ -149,7 +149,8 @@ fn local_openai_responses_wrapper_preserves_body_order_after_edits() {
|
||||
"prompt_cache_key",
|
||||
]
|
||||
);
|
||||
assert_eq!(provider_request_body["parallel_tool_calls"], true);
|
||||
assert_eq!(provider_request_body["parallel_tool_calls"], json!(true));
|
||||
assert_eq!(provider_request_body["instructions"], json!(""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -3,6 +3,7 @@ pub(crate) use aether_ai_formats::api::{
|
||||
aggregate_openai_chat_stream_sync_response, aggregate_openai_responses_stream_sync_response,
|
||||
aggregate_standard_chat_stream_sync_response, aggregate_standard_cli_stream_sync_response,
|
||||
api_format_alias_matches, api_format_storage_aliases,
|
||||
apply_codex_openai_responses_chat_body_edits,
|
||||
apply_codex_openai_responses_special_body_edits, apply_codex_openai_responses_special_headers,
|
||||
apply_model_directive_mapping_patch, apply_model_directive_overrides_from_model,
|
||||
apply_model_directive_overrides_from_request,
|
||||
|
||||
@@ -155,6 +155,7 @@ pub async fn serve_execution_runtime_tcp(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
pub async fn serve_execution_runtime_unix(
|
||||
socket_path: &Path,
|
||||
max_in_flight_requests: Option<usize>,
|
||||
@@ -179,6 +180,19 @@ pub async fn serve_execution_runtime_unix(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
pub async fn serve_execution_runtime_unix(
|
||||
_socket_path: &Path,
|
||||
_max_in_flight_requests: Option<usize>,
|
||||
_distributed_request_gate: Option<RuntimeSemaphore>,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Unsupported,
|
||||
"Unix sockets are not supported on this platform",
|
||||
)
|
||||
.into())
|
||||
}
|
||||
|
||||
async fn health(State(state): State<ExecutionRuntimeAppState>) -> impl IntoResponse {
|
||||
let request_concurrency = state.request_concurrency_snapshot().map(|snapshot| {
|
||||
json!({
|
||||
|
||||
@@ -3094,7 +3094,7 @@ async fn gateway_handles_openai_responses_test_model_locally() {
|
||||
.json_body
|
||||
.as_ref()
|
||||
.and_then(|body| body.get("instructions")),
|
||||
Some(&json!("You are ChatGPT."))
|
||||
Some(&json!(""))
|
||||
);
|
||||
assert_eq!(
|
||||
plan.body
|
||||
|
||||
Reference in New Issue
Block a user