(ctx: ThinkingContext)
| 47 | /** Greeting / one-liner — skip the first-iter think tax. */ |
| 48 | trivial?: boolean; |
| 49 | } |
| 50 | |
| 51 | export function decideThinking(ctx: ThinkingContext): ThinkingDecision { |
| 52 | const every = ctx.rethinkEvery ?? 8; |
| 53 | if (ctx.forceThink) return 'think'; |
| 54 | if (ctx.recentToolErrors > 0) return 'think'; |
| 55 | // A "hi" / "thanks" must not pay a 30–90s hidden reasoning pass. |
| 56 | if (ctx.trivial) return 'no_think'; |
| 57 | if (ctx.iteration <= 1) return 'think'; |
| 58 | if (ctx.taskComplex && every > 0 && ctx.iteration % every === 0) return 'think'; |
| 59 | return 'no_think'; |
no outgoing calls
no test coverage detected