( messages: Message[], decision: ThinkingDecision, modelId: string, )
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Build the outbound message array for this iteration. Pure — returns a NEW |
| 82 | * array; the stored history is never touched. Only appends; never rewrites. |
| 83 | */ |
| 84 | export function applyThinkingDecision( |
| 85 | messages: Message[], |
| 86 | decision: ThinkingDecision, |
| 87 | modelId: string, |
| 88 | ): Message[] { |
| 89 | if (decision !== 'no_think') return messages; // thinking is the model default |
| 90 | if (!modelSupportsSoftSwitch(modelId)) return messages; |
| 91 | return [...messages, { role: 'user', content: '/no_think' } as Message]; |
no test coverage detected