mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
Improve Codex Chat reasoning conversion
- Convert Chat reasoning_content and reasoning fields into Responses reasoning output items. - Emit Responses reasoning summary SSE events for streamed Chat reasoning deltas. - Preserve output ordering when reasoning, text, and tool calls are streamed together. - Add regression coverage for data-only Chat SSE errors, multiple tool calls, and compact routing.
This commit is contained in:
@@ -464,4 +464,21 @@ wire_api = "chat"
|
||||
"/v1/responses/compact"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_codex_provider_uses_chat_completions_from_meta_api_format_for_compact() {
|
||||
let mut provider = create_provider(json!({
|
||||
"base_url": "https://example.com/v1"
|
||||
}));
|
||||
provider.meta = Some(crate::provider::ProviderMeta {
|
||||
api_format: Some("openai_chat".to_string()),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
assert!(codex_provider_uses_chat_completions(&provider));
|
||||
assert!(should_convert_codex_responses_to_chat(
|
||||
&provider,
|
||||
"/responses/compact?stream=true"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user