Commit cbe3396
Fix latent gpt-5.4 reasoning-model classification + auto-resolve --timeout
The reverted state (and pre-PR-404 main) misclassified `gpt-5.4` as a
non-reasoning model in `_is_reasoning_model()`. Per OpenAI's model docs,
gpt-5.4 IS a reasoning model and should hit the reasoning code path
(REASONING_MAX_TOKENS=32768, no `temperature` in payload, longer timeout).
PR #404's commit message documented this as a "latent bug fix per OpenAI
docs"; this restores that fix without re-introducing the gpt-5.5 bump
or the Mandate prompt that #416 reverts.
Concrete changes:
.claude/scripts/openai_review.py:
- Add `gpt-5.4` to `_is_reasoning_model()`'s prefix tuple
- Add `REASONING_TIMEOUT = 900` constant
- Add `_resolve_timeout(timeout, model)` helper: None -> auto-resolve
(900s for reasoning, 300s otherwise); explicit values pass through
- `call_openai()` signature: `timeout: int | None = None` (was
`int = DEFAULT_TIMEOUT`); calls `_resolve_timeout()` internally so
direct callers also get model-aware defaults
- CLI `--timeout` argparse default: None (was DEFAULT_TIMEOUT); help
text describes the dynamic default
- CLI runtime: replace the "Consider --timeout 900" advisory with
`args.timeout = _resolve_timeout(...)` and surface the effective
timeout in the "Sending review to ..." log line
.claude/commands/ai-review-local.md:
- --timeout description: dynamic default for reasoning models
- Reasoning-model handling section: skill no longer needs to pass
--timeout 900 manually; gpt-5.4 added to reasoning-model list
tests/test_openai_review.py:
- Flip `test_gpt54_is_not_reasoning` -> `test_gpt54_is_reasoning`
(and add snapshot variant)
- Add `TestResolveTimeout` (4 cases: reasoning default, non-reasoning
default, explicit passthrough, zero-as-explicit)
- Update `test_standard_model_payload` to use `gpt-4.1` (true
non-reasoning model) instead of `gpt-5.4`
169 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3498d3f commit cbe3396
3 files changed
Lines changed: 67 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
| 1120 | + | |
1120 | 1121 | | |
1121 | 1122 | | |
1122 | 1123 | | |
1123 | 1124 | | |
1124 | 1125 | | |
1125 | 1126 | | |
1126 | | - | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1127 | 1140 | | |
1128 | 1141 | | |
1129 | 1142 | | |
| |||
1154 | 1167 | | |
1155 | 1168 | | |
1156 | 1169 | | |
1157 | | - | |
| 1170 | + | |
1158 | 1171 | | |
1159 | 1172 | | |
1160 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1161 | 1179 | | |
1162 | 1180 | | |
1163 | 1181 | | |
| 1182 | + | |
1164 | 1183 | | |
1165 | 1184 | | |
1166 | 1185 | | |
| |||
1363 | 1382 | | |
1364 | 1383 | | |
1365 | 1384 | | |
1366 | | - | |
1367 | | - | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1368 | 1391 | | |
1369 | 1392 | | |
1370 | 1393 | | |
| |||
1634 | 1657 | | |
1635 | 1658 | | |
1636 | 1659 | | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1660 | + | |
| 1661 | + | |
1644 | 1662 | | |
1645 | 1663 | | |
1646 | 1664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
1550 | | - | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1551 | 1555 | | |
1552 | 1556 | | |
1553 | 1557 | | |
| |||
1572 | 1576 | | |
1573 | 1577 | | |
1574 | 1578 | | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1575 | 1603 | | |
1576 | 1604 | | |
1577 | 1605 | | |
| |||
1795 | 1823 | | |
1796 | 1824 | | |
1797 | 1825 | | |
1798 | | - | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
1799 | 1829 | | |
1800 | 1830 | | |
1801 | 1831 | | |
| |||
0 commit comments