refactor: remove reasoning after first turn filter

This commit is contained in:
Pascal 2026-01-16 15:18:59 +01:00
parent 2973c64609
commit 78c6380222
6 changed files with 3 additions and 21 deletions

View File

@ -278,9 +278,6 @@ export class AgenticClient {
return;
}
// Filter reasoning content after first turn if configured
const shouldFilterReasoning = agenticConfig.filterReasoningAfterFirstTurn && turn > 0;
let turnContent = '';
let turnToolCalls: ApiChatCompletionToolCall[] = [];
let lastStreamingToolCallName = '';
@ -314,7 +311,7 @@ export class AgenticClient {
turnContent += chunk;
onChunk?.(chunk);
},
onReasoningChunk: shouldFilterReasoning ? undefined : onReasoningChunk,
onReasoningChunk,
onToolCallChunk: (serialized: string) => {
try {
turnToolCalls = JSON.parse(serialized) as ApiChatCompletionToolCall[];

View File

@ -259,11 +259,6 @@
label: 'Max lines per tool preview',
type: 'input'
},
{
key: 'agenticFilterReasoningAfterFirstTurn',
label: 'Filter reasoning after first turn',
type: 'checkbox'
},
{
key: 'showToolCallInProgress',
label: 'Show tool call in progress',

View File

@ -3,8 +3,7 @@ import type { AgenticConfig } from '$lib/types/agentic';
export const DEFAULT_AGENTIC_CONFIG: AgenticConfig = {
enabled: true,
maxTurns: 100,
maxToolPreviewLines: 25,
filterReasoningAfterFirstTurn: true
maxToolPreviewLines: 25
} as const;
// Agentic tool call tag markers

View File

@ -23,7 +23,6 @@ export const SETTING_CONFIG_DEFAULT: Record<string, string | number | boolean> =
mcpServerUsageStats: '{}', // JSON object: { [serverId]: usageCount }
agenticMaxTurns: 10,
agenticMaxToolPreviewLines: 25,
agenticFilterReasoningAfterFirstTurn: true,
showToolCallInProgress: false,
// make sure these default values are in sync with `common.h`
samplers: 'top_k;typ_p;top_p;min_p;temperature',
@ -124,8 +123,6 @@ export const SETTING_CONFIG_INFO: Record<string, string> = {
'Maximum number of tool execution cycles before stopping (prevents infinite loops).',
agenticMaxToolPreviewLines:
'Number of lines shown in tool output previews (last N lines). Only these previews and the final LLM response persist after the agentic loop completes.',
agenticFilterReasoningAfterFirstTurn:
'Only show reasoning from the first agentic turn. When disabled, reasoning from all turns is merged in one (WebUI limitation).',
showToolCallInProgress:
'Automatically expand tool call details while executing and keep them expanded after completion.',
pyInterpreterEnabled:

View File

@ -7,7 +7,6 @@ export interface AgenticConfig {
enabled: boolean;
maxTurns: number;
maxToolPreviewLines: number;
filterReasoningAfterFirstTurn: boolean;
}
/**

View File

@ -24,16 +24,11 @@ export function getAgenticConfig(
settings.agenticMaxToolPreviewLines,
DEFAULT_AGENTIC_CONFIG.maxToolPreviewLines
);
const filterReasoningAfterFirstTurn =
typeof settings.agenticFilterReasoningAfterFirstTurn === 'boolean'
? settings.agenticFilterReasoningAfterFirstTurn
: DEFAULT_AGENTIC_CONFIG.filterReasoningAfterFirstTurn;
return {
enabled: mcpStore.hasEnabledServers(perChatOverrides) && DEFAULT_AGENTIC_CONFIG.enabled,
maxTurns,
maxToolPreviewLines,
filterReasoningAfterFirstTurn
maxToolPreviewLines
};
}