diff --git a/CLAUDE.md b/CLAUDE.md index 0728605824..372bff256c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,8 +10,7 @@ This file provides guidance to AI coding assistants when working with code in th - **Log centrally**: Route all logging through `loggerService` with the right context—no `console.log`. - **Research via subagent**: Lean on `subagent` for external docs, APIs, news, and references. - **Always propose before executing**: Before making any changes, clearly explain your planned approach and wait for explicit user approval to ensure alignment and prevent unwanted modifications. -- **Write conventional commits with emoji**: Commit small, focused changes using emoji-prefixed Conventional Commit messages (e.g., `✨ feat:`, `🐛 fix:`, `♻️ refactor:`, ` -📝 docs:`). +- **Write conventional commits**: Commit small, focused changes using Conventional Commit messages (e.g., `feat:`, `fix:`, `refactor:`, `docs:`). ## Development Commands diff --git a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/BashTool.tsx b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/BashTool.tsx index d92b6461a4..9b9d98054d 100644 --- a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/BashTool.tsx +++ b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/BashTool.tsx @@ -1,10 +1,12 @@ import type { CollapseProps } from 'antd' -import { Tag } from 'antd' +import { Popover, Tag } from 'antd' import { Terminal } from 'lucide-react' import { ToolTitle } from './GenericTools' import type { BashToolInput as BashToolInputType, BashToolOutput as BashToolOutputType } from './types' +const MAX_TAG_LENGTH = 100 + export function BashTool({ input, output @@ -15,6 +17,13 @@ export function BashTool({ // 如果有输出,计算输出行数 const outputLines = output ? output.split('\n').length : 0 + // 处理命令字符串的截断 + const command = input.command + const needsTruncate = command.length > MAX_TAG_LENGTH + const displayCommand = needsTruncate ? `${command.slice(0, MAX_TAG_LENGTH)}...` : command + + const tagContent = {displayCommand} + return { key: 'tool', label: ( @@ -26,7 +35,15 @@ export function BashTool({ stats={output ? `${outputLines} ${outputLines === 1 ? 'line' : 'lines'}` : undefined} />
- {input.command} + {needsTruncate ? ( + {command}
} + trigger="hover"> + {tagContent} + + ) : ( + tagContent + )} ),