@@ -364,6 +364,57 @@ def test_x_initiator_header_system_only_messages():
364
364
assert headers ["X-Initiator" ] == "user"
365
365
366
366
367
+ def test_get_supported_openai_params_claude_model ():
368
+ """Test that Claude models with extended thinking support have thinking and reasoning parameters."""
369
+ config = GithubCopilotConfig ()
370
+
371
+ # Test Claude 4 model supports thinking and reasoning_effort parameters
372
+ supported_params = config .get_supported_openai_params ("claude-sonnet-4-20250514" )
373
+ assert "thinking" in supported_params
374
+ assert "reasoning_effort" in supported_params
375
+
376
+ # Test Claude 3-7 model supports thinking and reasoning_effort parameters
377
+ supported_params_claude37 = config .get_supported_openai_params ("claude-3-7-sonnet-20250219" )
378
+ assert "thinking" in supported_params_claude37
379
+ assert "reasoning_effort" in supported_params_claude37
380
+
381
+ # Test Claude 3.5 model does NOT support thinking parameters (no extended thinking)
382
+ supported_params_claude35 = config .get_supported_openai_params ("claude-3.5-sonnet" )
383
+ assert "thinking" not in supported_params_claude35
384
+ assert "reasoning_effort" not in supported_params_claude35
385
+
386
+ # Test non-Claude model doesn't include thinking parameters but may include reasoning_effort
387
+ supported_params_gpt = config .get_supported_openai_params ("gpt-4o" )
388
+ assert "thinking" not in supported_params_gpt
389
+ # gpt-4o should NOT have reasoning_effort (not a reasoning model)
390
+ assert "reasoning_effort" not in supported_params_gpt
391
+
392
+ # Test O-series reasoning models include reasoning_effort but not thinking
393
+ supported_params_o3 = config .get_supported_openai_params ("o3-mini" )
394
+ assert "thinking" not in supported_params_o3
395
+ # o3-mini should have reasoning_effort (it's an O-series reasoning model)
396
+ assert "reasoning_effort" in supported_params_o3
397
+
398
+
399
+ def test_get_supported_openai_params_case_insensitive ():
400
+ """Test that Claude model detection is case-insensitive for models with extended thinking."""
401
+ config = GithubCopilotConfig ()
402
+
403
+ # Test uppercase Claude 4 model with full model name
404
+ supported_params_upper = config .get_supported_openai_params ("CLAUDE-SONNET-4-20250514" )
405
+ assert "thinking" in supported_params_upper
406
+ assert "reasoning_effort" in supported_params_upper
407
+
408
+ # Test mixed case Claude 3-7 model (has extended thinking) with full model name
409
+ supported_params_mixed = config .get_supported_openai_params ("Claude-3-7-Sonnet-20250219" )
410
+ assert "thinking" in supported_params_mixed
411
+ assert "reasoning_effort" in supported_params_mixed
412
+
413
+ # Test that Claude 3.5 models don't have thinking support (case insensitive)
414
+ supported_params_35 = config .get_supported_openai_params ("CLAUDE-3.5-SONNET" )
415
+ assert "thinking" not in supported_params_35
416
+ assert "reasoning_effort" not in supported_params_35
417
+
367
418
def test_copilot_vision_request_header_with_image ():
368
419
"""Test that Copilot-Vision-Request header is added when messages contain images"""
369
420
config = GithubCopilotConfig ()
0 commit comments