fix(llm): forward reasoning effort to GPT-6 and gate minimal thinking

- reasoning_effort was forwarded only to IDs matching gpt-5 or the o-series, so
  GPT-6 models silently dropped the configured effort; match GPT-5 and later,
  with a version boundary so unrelated IDs do not match
- Gemini Pro, 3.8+ and the -latest aliases reject thinking_level "minimal"
  with a 400; send it only to numbered Flash models before 3.8 and map it to
  "low" elsewhere, since aliases move between generations
This commit is contained in:
Yijia-Xiao
2026-09-14 18:09:33 +00:00
parent 62d3479217
commit 9b4c741d33
4 changed files with 42 additions and 11 deletions

View File

@@ -17,9 +17,10 @@ from tradingagents.llm_clients.openai_client import (
"model,expected",
[
("gpt-5.5", True), ("gpt-5.4", True), ("gpt-5.4-mini", True),
("gpt-5.5-pro", True), ("o1", True), ("o3-mini", True),
("gpt-5.5-pro", True), ("gpt-6-astra", True), ("o1", True), ("o3-mini", True),
("gpt-4.1", False), ("gpt-4o", False), ("gpt-4o-mini", False),
("gpt-3.5-turbo", False),
("gpt-3.5-turbo", False), ("gpt-10", True),
("gpt-5foo", False), ("gpt-60x", False), ("o3rd-party", False),
],
)
def test_supports_reasoning_effort(model, expected):