test: use open model sentinels
This commit is contained in:
@@ -1289,7 +1289,7 @@ mod tests {
|
||||
// and DOES replay reasoning_content — see
|
||||
// `deepseek_model_on_openai_provider_still_replays_reasoning_content`.
|
||||
let request = MessageRequest {
|
||||
model: "gpt-4o".to_string(),
|
||||
model: "qwen3-coder".to_string(),
|
||||
messages: vec![Message {
|
||||
role: "assistant".to_string(),
|
||||
content: vec![
|
||||
@@ -2748,7 +2748,7 @@ mod tests {
|
||||
// DeepSeek reasoning model on the openai provider still gets sanitized
|
||||
// (see chat.rs `deepseek_model_on_openai_provider_still_replays_*`).
|
||||
let mut body = json!({
|
||||
"model": "gpt-4o",
|
||||
"model": "qwen3-coder",
|
||||
"messages": [
|
||||
{ "role": "user", "content": "hi" },
|
||||
{
|
||||
@@ -2759,8 +2759,12 @@ mod tests {
|
||||
]
|
||||
});
|
||||
|
||||
let result =
|
||||
sanitize_thinking_mode_messages(&mut body, "gpt-4o", Some("max"), ApiProvider::Openai);
|
||||
let result = sanitize_thinking_mode_messages(
|
||||
&mut body,
|
||||
"qwen3-coder",
|
||||
Some("max"),
|
||||
ApiProvider::Openai,
|
||||
);
|
||||
|
||||
assert!(result.is_none());
|
||||
let assistant = body["messages"]
|
||||
|
||||
@@ -3093,7 +3093,7 @@ mod alias_thinking_detection_tests {
|
||||
// `reasoning_content` on providers that reject the field.
|
||||
assert!(!requires_reasoning_content("deepseek-v3"));
|
||||
assert!(!requires_reasoning_content("deepseek-coder"));
|
||||
assert!(!requires_reasoning_content("gpt-4o"));
|
||||
assert!(!requires_reasoning_content("qwen3-coder"));
|
||||
assert!(!requires_reasoning_content("claude-sonnet-4-6"));
|
||||
}
|
||||
|
||||
@@ -3169,7 +3169,7 @@ mod alias_thinking_detection_tests {
|
||||
// openai provider must continue to have reasoning_content stripped.
|
||||
assert!(!should_replay_reasoning_content_for_provider(
|
||||
ApiProvider::Openai,
|
||||
"gpt-4o",
|
||||
"qwen3-coder",
|
||||
None,
|
||||
));
|
||||
assert!(!should_replay_reasoning_content_for_provider(
|
||||
@@ -3211,7 +3211,7 @@ mod alias_thinking_detection_tests {
|
||||
// parser keeps inlining any `reasoning_content` it emits as text.
|
||||
assert!(!is_reasoning_model_for_stream(
|
||||
ApiProvider::Openai,
|
||||
"gpt-4o"
|
||||
"qwen3-coder"
|
||||
));
|
||||
assert!(!is_reasoning_model_for_stream(
|
||||
ApiProvider::Openai,
|
||||
@@ -3220,7 +3220,7 @@ mod alias_thinking_detection_tests {
|
||||
// Non-DeepSeek model on a reasoning-aware provider is also unchanged.
|
||||
assert!(!is_reasoning_model_for_stream(
|
||||
ApiProvider::Deepseek,
|
||||
"gpt-4o"
|
||||
"qwen3-coder"
|
||||
));
|
||||
}
|
||||
|
||||
@@ -3230,7 +3230,7 @@ mod alias_thinking_detection_tests {
|
||||
// model identity, or stream parsing and message sanitisation disagree
|
||||
// about where reasoning tokens live. Effort=None isolates the
|
||||
// model/provider dimension shared by both.
|
||||
for model in ["deepseek-v4-pro", "deepseek-reasoner", "gpt-4o"] {
|
||||
for model in ["deepseek-v4-pro", "deepseek-reasoner", "qwen3-coder"] {
|
||||
for provider in [ApiProvider::Openai, ApiProvider::Deepseek] {
|
||||
assert_eq!(
|
||||
is_reasoning_model_for_stream(provider, model),
|
||||
|
||||
@@ -5243,7 +5243,7 @@ api_key = "old-openrouter-key"
|
||||
|
||||
#[test]
|
||||
fn normalize_model_name_rejects_invalid_or_non_deepseek_ids() {
|
||||
assert!(normalize_model_name("gpt-4o").is_none());
|
||||
assert!(normalize_model_name("qwen3-coder").is_none());
|
||||
assert!(normalize_model_name("codewhale v4").is_none());
|
||||
assert!(normalize_model_name("").is_none());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user