]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
UI: fix Settings/Display tool call content toggle (#25783)
authorPascal <redacted>
Mon, 20 Jul 2026 14:28:24 +0000 (16:28 +0200)
committerGitHub <redacted>
Mon, 20 Jul 2026 14:28:24 +0000 (16:28 +0200)
* ui: fix Show tool call in progress toggle ignored

The showToolCallInProgress setting was disconnected from the render
path during the agentic content rework: getDefaultExpanded() returns
a hardcoded false for tool call sections and an unconditional effect
auto-expands the currently executing tool call regardless of the
setting.

Drive default expansion of all tool call section types from the
setting and remove the now redundant auto-expand effect. Manual
toggling still takes precedence over the default in both directions.

* ui: rename Show tool call in progress to Always show tool call content

The previous name suggested symmetry with Show thought in progress,
which only applies while inference is running, but tool call content
stays expanded after completion. Rename the label, the settings key
and the syncable server key to alwaysShowToolCallContent. The synced
parameter never worked under its previous name so no migration is
needed.

tools/ui/src/lib/components/app/chat/ChatMessages/ChatMessageAgenticContent.svelte
tools/ui/src/lib/constants/settings-keys.ts
tools/ui/src/lib/constants/settings-registry.ts

index 34c82cd76328c00ce4a939e21b7e8ea8d1baf68d..751d13756271c61c7951d5a546b9de11d4c1349e 100644 (file)
@@ -43,6 +43,7 @@
 
        const renderThinkingAsMarkdown = $derived(config().renderThinkingAsMarkdown as boolean);
        const showThoughtInProgress = $derived(Boolean(config().showThoughtInProgress));
+       const alwaysShowToolCallContent = $derived(Boolean(config().alwaysShowToolCallContent));
        const showMessageStats = $derived(Boolean(config().showMessageStats));
        const showAgenticTurnStats = $derived(showMessageStats && Boolean(config().showAgenticTurnStats));
 
                isStreaming ? agenticExecutingToolCallId(message.convId) : null
        );
 
-       // Skip sections the user manually collapsed - we never override an explicit false.
-       let lastSeenExecutingToolCallId: string | null = null;
-       $effect(() => {
-               const current = currentlyExecutingToolCallId;
-               const previous = lastSeenExecutingToolCallId;
-               lastSeenExecutingToolCallId = current;
-               if (!current || current === previous) return;
-               const idx = sections.findIndex((s) => s.toolCallId === current);
-               if (idx >= 0 && expandedStates[idx] === undefined) {
-                       expandedStates[idx] = true;
-               }
-       });
-
        type TurnGroup = {
                sections: AgenticSection[];
                flatIndices: number[];
 
        function getDefaultExpanded(section: AgenticSection): boolean {
                if (
+                       section.type === AgenticSectionType.TOOL_CALL ||
                        section.type === AgenticSectionType.TOOL_CALL_PENDING ||
                        section.type === AgenticSectionType.TOOL_CALL_STREAMING
                ) {
-                       return false;
+                       return alwaysShowToolCallContent;
                }
 
                if (section.type === AgenticSectionType.REASONING_PENDING) {
index 0761ef8f0913b9b57f5c9dfe486e5f449a7e045a..bbcdde43516fcd7ca967e628213935cfb4761f96 100644 (file)
@@ -60,7 +60,7 @@ export const SETTINGS_KEYS = {
        MCP_SERVERS: 'mcpServers',
        MCP_REQUEST_TIMEOUT_SECONDS: 'mcpRequestTimeoutSeconds',
        AGENTIC_MAX_TURNS: 'agenticMaxTurns',
-       SHOW_TOOL_CALL_IN_PROGRESS: 'showToolCallInProgress',
+       ALWAYS_SHOW_TOOL_CALL_CONTENT: 'alwaysShowToolCallContent',
        // Performance
        PRE_ENCODE_CONVERSATION: 'preEncodeConversation',
        // Developer
index b1404093c5b0d4deababf4fbf9032c27d1773dbd..03d4ce4e9eb52d300d042ce30fe7db7c5c67aa83 100644 (file)
@@ -253,14 +253,14 @@ const SETTINGS_REGISTRY: Record<string, SettingsSectionEntry> = {
                                }
                        },
                        {
-                               key: SETTINGS_KEYS.SHOW_TOOL_CALL_IN_PROGRESS,
-                               label: 'Show tool call in progress',
+                               key: SETTINGS_KEYS.ALWAYS_SHOW_TOOL_CALL_CONTENT,
+                               label: 'Always show tool call content',
                                help: 'Automatically expand tool call details while executing and keep them expanded after completion.',
                                defaultValue: false,
                                type: SettingsFieldType.CHECKBOX,
                                section: SETTINGS_SECTION_SLUGS.DISPLAY,
                                sync: {
-                                       serverKey: SETTINGS_KEYS.SHOW_TOOL_CALL_IN_PROGRESS,
+                                       serverKey: SETTINGS_KEYS.ALWAYS_SHOW_TOOL_CALL_CONTENT,
                                        paramType: SyncableParameterType.BOOLEAN
                                }
                        },