Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
📃 style: Match File Activity Icons To File Rows (#16445)
lia-by-librechat[bot]fcb88717bc32
diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/FileAuthoringCall.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/FileAuthoringCall.test.tsxindex 7fa74e2e96..27183855af 100644--- a/client/src/components/Chat/Messages/Content/Parts/__tests__/FileAuthoringCall.test.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/FileAuthoringCall.test.tsx@@ -29,12 +29,17 @@ jest.mock('~/components/Chat/Messages/Content/ProgressText', () => ({phase,inProgressText,finishedText,+ icon,}: {phase: 'running' | 'completed' | 'cancelled' | 'failed';inProgressText: string;finishedText: string;+ icon: React.ReactNode;}) => (- <div data-testid="progress-text">{phase === 'running' ? inProgressText : finishedText}</div>+ <div data-testid="progress-text">+ {icon}+ {phase === 'running' ? inProgressText : finishedText}+ </div>),}));@@ -132,6 +137,7 @@ describe('FileAuthoringCall', () => {);expect(screen.getByTestId('progress-text')).toHaveTextContent('Updated SKILL.md');+ expect(document.querySelector('.lucide-file-pen-line')).not.toBeNull();});it('prefers the output diff over the args preview after edit_file completes', () => {diff --git a/client/src/components/Chat/Messages/Content/ToolOutput/ToolIcon.tsx b/client/src/components/Chat/Messages/Content/ToolOutput/ToolIcon.tsxindex 665b6335e0..8687c09bf9 100644--- a/client/src/components/Chat/Messages/Content/ToolOutput/ToolIcon.tsx+++ b/client/src/components/Chat/Messages/Content/ToolOutput/ToolIcon.tsx@@ -7,6 +7,8 @@ import {ArrowRightLeft,FileSearch,FileText,+ FilePlus2,+ FilePenLine,MessageCircleQuestion,ScrollText,Brain,@@ -32,6 +34,8 @@ export type ToolIconType =| 'file_search'| 'skill'| 'read_file'+ | 'create_file'+ | 'edit_file'| 'bash_tool'| 'background_tasks'| 'ask_user_question'@@ -49,6 +53,8 @@ const ICON_MAP: Record<ToolIconType, React.ComponentType<{ className?: string }>file_search: FileSearch,skill: ScrollText,read_file: FileText,+ create_file: FilePlus2,+ edit_file: FilePenLine,bash_tool: BashIcon,background_tasks: ListChecks,ask_user_question: MessageCircleQuestion,@@ -88,6 +94,9 @@ export function getToolIconType(name: string): ToolIconType {if (name === 'read_file') {return 'read_file';}+ if (name === 'create_file' || name === 'edit_file') {+ return name;+ }if (name === 'bash_tool' || name === Constants.BASH_PROGRAMMATIC_TOOL_CALLING) {return 'bash_tool';}diff --git a/client/src/components/Chat/Messages/Content/__tests__/ActivityPhaseGroup.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ActivityPhaseGroup.test.tsxindex 73bbfc989b..f768fa617d 100644--- a/client/src/components/Chat/Messages/Content/__tests__/ActivityPhaseGroup.test.tsx+++ b/client/src/components/Chat/Messages/Content/__tests__/ActivityPhaseGroup.test.tsx@@ -165,6 +165,45 @@ describe('ActivityPhaseGroup', () => {expect(screen.getByText(LABEL).parentElement).toHaveClass('flex-1', 'text-left');});+ test.each([+ ['create_file', '', 'lucide-file-plus-2'],+ ['edit_file', '', 'lucide-file-pen-line'],+ ['create_file', 'Created skills/demo/SKILL.md', 'lucide-file-plus-2'],+ ['create_file', 'Updated AGENTS.md with safe diagnostic guidance', 'lucide-file-pen-line'],+ ['edit_file', 'Edited AGENTS.md', 'lucide-file-pen-line'],+ ])(+ 'shows the file-row glyph on settled and live phase headers for %s: %s',+ (name, output, glyph) => {+ const part = {+ type: ContentTypes.TOOL_CALL,+ [ContentTypes.TOOL_CALL]: {+ id: 'file-1',+ name,+ args: '{"path":"AGENTS.md"}',+ output,+ type: 'tool_call',+ },+ } as unknown as TMessageContentParts;+ const { rerender } = render(+ <ActivityPhaseGroup labelPart={labelPart} hasContent spanParts={[part]}>+ <div data-testid="phase-content" />+ </ActivityPhaseGroup>,+ );++ expect(screen.getByRole('button', { name: LABEL }).querySelector(`.${glyph}`)).not.toBeNull();+ expect(+ screen.getByRole('button', { name: LABEL }).querySelector('.lucide-wrench'),+ ).toBeNull();++ rerender(+ <ActivityPhaseGroup labelPart={labelPart} hasContent liveParts={[part]}>+ <div data-testid="phase-content" />+ </ActivityPhaseGroup>,+ );+ expect(screen.getByRole('button').querySelector(`.${glyph}`)).not.toBeNull();+ },+ );+test('keeps the focus ring inside the clipped header', () => {render(<ActivityPhaseGroup labelPart={labelPart} hasContent>diff --git a/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsxindex b04b25b894..93e5434921 100644--- a/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx+++ b/client/src/components/Chat/Messages/Content/__tests__/StackedToolIcons.test.tsx@@ -48,6 +48,15 @@ describe('shared header glyphs', () => {},);+ it.each([+ ['create_file', 'lucide-file-plus-2'],+ ['edit_file', 'lucide-file-pen-line'],+ ])('renders %s with the same glyph as its file row', (name, glyph) => {+ const { container } = render(<StackedToolIcons toolNames={[name]} />);+ expect(container.querySelector(`.${glyph}`)).not.toBeNull();+ expect(container.querySelector('.lucide-wrench')).toBeNull();+ });+it('retains a bounded stack and overflow count', () => {const { container } = render(<StackedToolIconsdiff --git a/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsxindex cc6c1c6528..171f4a51d6 100644--- a/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx+++ b/client/src/components/Chat/Messages/Content/__tests__/ToolCallGroup.test.tsx@@ -847,6 +847,26 @@ describe('ToolCallGroup image hoisting', () => {expect(screen.queryByText(/web_search|file_search|retrieval/)).not.toBeInTheDocument();});+ it('uses the edit glyph for a create_file overwrite without changing its tool label', () => {+ renderGroup({+ ...baseProps,+ parts: [+ {+ part: makePart(+ 'file-1',+ 'Updated AGENTS.md with safe diagnostic guidance',+ 'create_file',+ ),+ idx: 0,+ },+ ],+ lastContentIdx: 0,+ });++ expect(screen.getByTestId('stacked-icons')).toHaveAttribute('data-tool-names', 'edit_file');+ expect(screen.getByRole('button', { name: 'Create File' })).toBeInTheDocument();+ });+it('keeps repeated action counts and failed-call status in the compact summary', () => {renderGroup({...baseProps,diff --git a/client/src/components/Chat/Messages/Content/__tests__/ToolIcon.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ToolIcon.test.tsxindex 2734ccb44e..f0c92f96d5 100644--- a/client/src/components/Chat/Messages/Content/__tests__/ToolIcon.test.tsx+++ b/client/src/components/Chat/Messages/Content/__tests__/ToolIcon.test.tsx@@ -26,6 +26,13 @@ describe('getToolIconType - ACTN-01: Action delimiter detection', () => {expect(getToolIconType('some_plain_tool')).toBe('generic');});+ it('gives native file authoring tools their row glyphs without changing MCP identity', () => {+ expect(getToolIconType('create_file')).toBe('create_file');+ expect(getToolIconType('edit_file')).toBe('edit_file');+ expect(getToolIconType(`create_file${Constants.mcp_delimiter}remote`)).toBe('mcp');+ expect(getToolIconType(`edit_file${Constants.mcp_delimiter}remote`)).toBe('mcp');+ });+it('gives the native background-task tool its own icon while preserving MCP identity', () => {expect(getToolIconType(Constants.CHECK_BACKGROUND_TASK)).toBe('background_tasks');expect(diff --git a/client/src/components/Chat/Messages/Content/live.ts b/client/src/components/Chat/Messages/Content/live.tsindex 216cc2e4c1..8d9bcaabf5 100644--- a/client/src/components/Chat/Messages/Content/live.ts+++ b/client/src/components/Chat/Messages/Content/live.ts@@ -1,4 +1,4 @@-import { Tools, Constants, ContentTypes, stripToolCallErrorPrefix } from 'librechat-data-provider';+import { Constants, ContentTypes, stripToolCallErrorPrefix } from 'librechat-data-provider';import type {Agents,TAttachment,@@ -12,9 +12,8 @@ import { getBatchActivityLabelPart, getActivityLabelText } from '~/utils/activitimport { hasPendingApprovalInPart, hasPendingAuthInPart } from '~/utils/groupToolCalls';import { ASK_USER_QUESTION, getSubmittedAskAnswer } from '~/utils/approval';import { getToolDisplayLabel, parseToolName } from '~/utils/toolLabels';+import { getToolIconName, getToolMeta, summarizeSpan } from './outcome';import { boundIntentLabel, getToolCallIntent } from './Parts/intent';-import { isBashProgrammaticToolCall } from './routing';-import { getToolMeta, summarizeSpan } from './outcome';import { isError } from './ToolOutput';/** How often a live fold's header may repaint. A streamed intent moves the@@ -246,7 +245,7 @@ export function getSpanIconNames(parts: ReadonlyArray<TMessageContentParts | undconst toolCall = part == null ? undefined : getStandardToolCall(part);if (toolCall != null) {const name = toolCall.name ?? '';- icons.add(isBashProgrammaticToolCall(name, toolCall.args) ? Tools.bash_tool : name);+ icons.add(getToolIconName(name, toolCall.args, toolCall.output));continue;}const legacy = part == null ? null : getToolMeta(part);diff --git a/client/src/components/Chat/Messages/Content/outcome.ts b/client/src/components/Chat/Messages/Content/outcome.tsindex 7b039c0c3f..1191a48d2b 100644--- a/client/src/components/Chat/Messages/Content/outcome.ts+++ b/client/src/components/Chat/Messages/Content/outcome.ts@@ -38,6 +38,19 @@ function hasFailedOutput(output: unknown): boolean {return typeof output === 'string' && isError(output);}+/** A create_file overwrite displays the edit glyph in its own row. Headers use+ * the same identity, without changing the tool name used for labels/counts. */+export function getToolIconName(+ name: string,+ args?: string | Record<string, unknown>,+ output?: string | null,+): string {+ if (name === 'create_file' && output?.startsWith('Updated ')) {+ return 'edit_file';+ }+ return isBashProgrammaticToolCall(name, args) ? Tools.bash_tool : name;+}+/*** Group metadata must agree with the individual card, which resolves its* outcome from the run step's terminal verdict through `resolveToolCallPhase`.@@ -105,7 +118,7 @@ export function getToolMeta(* agents" on completion even when the child returned no text. */const completed = !!tc.output || tc.progress === 1;const name = tc.name ?? '';- const iconName = isBashProgrammaticToolCall(name, tc.args) ? Tools.bash_tool : name;+ const iconName = getToolIconName(name, tc.args, tc.output);/** Memory tools report failure in prose ("Invalid key ...") that generic* `isError` parsing does not recognize, so `MemoryCall` classifies it with* its own predicate. Reuse that here or a persisted call with no terminal