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

Function applyThinkingDecision

src/agent/thinking-control.ts:80–88  ·  view source on GitHub ↗
(
  messages: Message[],
  decision: ThinkingDecision,
  modelId: string,
)

Source from the content-addressed store, hash-verified

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 */
84export 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];

Callers 2

runMethod · 0.85

Calls 1

modelSupportsSoftSwitchFunction · 0.85

Tested by

no test coverage detected