| @@ -188,9 +188,9 @@ | ||
| 188 | 188 | // default 1 is supported). Mirror mxchat-admin-chat's send_to_openai (15bd6a) |
| 189 | 189 | // / mxchat-basic 3.2.9's integrator exactly: send temperature 1 and route |
| 190 | 190 | // reasoning_effort. Only triggers for gpt-5* ids, so Grok / custom OpenAI- |
| 191 | 191 | // compatible providers keep the 0.4 default above. |
| 192 | - if (strpos($model, 'gpt-5') === 0) { | |
| 192 | + if (strpos($model, 'gpt-5') === 0 || strpos($model, 'gpt-6') === 0) { // gpt-6 too (plan 45c22d) | |
| 193 | 193 | $body['temperature'] = 1; |
| 194 | 194 | $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'); |
| 195 | 195 | if (!in_array($model, $no_reasoning_models, true)) { |
| 196 | 196 | if ($model === 'gpt-5.1-2025-11-13') { |
| @@ -196,8 +196,11 @@ | ||
| 196 | 196 | if ($model === 'gpt-5.1-2025-11-13') { |
| 197 | 197 | $body['reasoning_effort'] = 'low'; |
| 198 | 198 | } elseif ($model === 'gpt-5.5' || $model === 'gpt-5.4') { |
| 199 | 199 | $body['reasoning_effort'] = 'none'; |
| 200 | + } elseif (in_array($model, array('gpt-6-astra', 'gpt-6-sol', 'gpt-6-luna'), true)) { | |
| 201 | + // plan 45c22d (probed 2026-09-27): gpt-6 rejects 'minimal'; core uses 'low'. | |
| 202 | + $body['reasoning_effort'] = 'low'; | |
| 200 | 203 | } elseif (in_array($model, array('gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna'), true)) { |
| 201 | 204 | // plan-6fb107: gpt-5.6 rejects 'minimal' (live 400: "does not support |
| 202 | 205 | // 'minimal'"); core uses 'low'. Mirror mxchat-basic integrator :8444. |
| 203 | 206 | $body['reasoning_effort'] = 'low'; |
| @@ -232,9 +235,13 @@ | ||
| 232 | 235 | ); |
| 233 | 236 | $body = array( |
| 234 | 237 | 'model' => $model, |
| 235 | 238 | 'max_tokens' => 1024, |
| 236 | - 'system' => $system_prompt, | |
| 239 | + // Prompt-cache breakpoint (plan 1ff43b): the editor-assistant | |
| 240 | + // instruction is a fixed template reused across requests. | |
| 241 | + 'system' => trim((string) $system_prompt) === '' ? $system_prompt : array( | |
| 242 | + array('type' => 'text', 'text' => $system_prompt, 'cache_control' => array('type' => 'ephemeral')), | |
| 243 | + ), | |
| 237 | 244 | 'messages' => array( |
| 238 | 245 | array('role' => 'user', 'content' => $user_content), |
| 239 | 246 | ), |
| 240 | 247 | 'stream' => true, |