MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / decideThinking

Function decideThinking

src/agent/thinking-control.ts:49–56  ·  view source on GitHub ↗
(ctx: ThinkingContext)

Source from the content-addressed store, hash-verified

47 /** Greeting / one-liner — skip the first-iter think tax. */
48 trivial?: boolean;
49}
50
51export 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';

Callers 2

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected