| @@ -291,9 +291,9 @@ | ||
| 291 | 291 | // and mxchat-basic's integrator EXACTLY so the non-streaming path (multi-block + |
| 292 | 292 | // any non-stream fallback) is GPT-5-safe. Without this the multi-block path 400s on |
| 293 | 293 | // every GPT-5 model — which is most installs (plan-8cb0cb fold consistency fix). |
| 294 | 294 | // Only triggers for gpt-5* ids; Grok / custom OpenAI-compatible keep the 0.4 above. |
| 295 | - if (strpos($model, 'gpt-5') === 0) { | |
| 295 | + if (strpos($model, 'gpt-5') === 0 || strpos($model, 'gpt-6') === 0) { // gpt-6 too (plan 45c22d) | |
| 296 | 296 | $body['temperature'] = 1; |
| 297 | 297 | $no_reasoning_models = array('gpt-5.2', 'gpt-5.1-chat-latest', 'gpt-5.3-chat-latest', 'gpt-5.4-mini', 'gpt-5.4-nano'); |
| 298 | 298 | if (!in_array($model, $no_reasoning_models, true)) { |
| 299 | 299 | if ($model === 'gpt-5.1-2025-11-13') { |
| @@ -299,8 +299,11 @@ | ||
| 299 | 299 | if ($model === 'gpt-5.1-2025-11-13') { |
| 300 | 300 | $body['reasoning_effort'] = 'low'; |
| 301 | 301 | } elseif ($model === 'gpt-5.5' || $model === 'gpt-5.4') { |
| 302 | 302 | $body['reasoning_effort'] = 'none'; |
| 303 | + } elseif (in_array($model, array('gpt-6-astra', 'gpt-6-sol', 'gpt-6-luna'), true)) { | |
| 304 | + // plan 45c22d (probed 2026-09-27): gpt-6 rejects 'minimal'; core uses 'low'. | |
| 305 | + $body['reasoning_effort'] = 'low'; | |
| 303 | 306 | } elseif (in_array($model, array('gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna'), true)) { |
| 304 | 307 | // plan-6fb107: gpt-5.6 rejects 'minimal' (live 400); core uses 'low'. |
| 305 | 308 | $body['reasoning_effort'] = 'low'; |
| 306 | 309 | } else { |
| @@ -346,9 +349,13 @@ | ||
| 346 | 349 | } |
| 347 | 350 | $body = array( |
| 348 | 351 | 'model' => $model, |
| 349 | 352 | 'max_tokens' => 1024, |
| 350 | - 'system' => $system_prompt, | |
| 353 | + // Prompt-cache breakpoint (plan 1ff43b): the editor-assistant | |
| 354 | + // instruction is a fixed template reused across requests. | |
| 355 | + 'system' => trim((string) $system_prompt) === '' ? $system_prompt : array( | |
| 356 | + array('type' => 'text', 'text' => $system_prompt, 'cache_control' => array('type' => 'ephemeral')), | |
| 357 | + ), | |
| 351 | 358 | 'messages' => array( |
| 352 | 359 | array('role' => 'user', 'content' => $user_content), |
| 353 | 360 | ), |
| 354 | 361 | ); |