Tool log UI: collapsible block under agent messages
Shows 🔧 Инструменты (N) with tool names and truncated results.
Displayed between thinking and message content.
This commit is contained in:
parent
cede9fbfdf
commit
82c2ff4c53
@ -297,6 +297,25 @@ export default function ChatPanel({ chatId, projectId }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
)}
|
)}
|
||||||
|
{msg.tool_log && msg.tool_log.length > 0 && (
|
||||||
|
<details className="ml-5 mb-1">
|
||||||
|
<summary className="text-xs text-[var(--muted)] cursor-pointer hover:text-[var(--fg)]">
|
||||||
|
🔧 Инструменты ({msg.tool_log.length})
|
||||||
|
</summary>
|
||||||
|
<div className="mt-1 text-xs text-[var(--muted)] bg-white/5 rounded p-2 max-h-[300px] overflow-y-auto space-y-1">
|
||||||
|
{msg.tool_log.map((t, i) => (
|
||||||
|
<div key={i} className="border-b border-white/10 pb-1 last:border-0">
|
||||||
|
<span className="font-mono text-blue-400">{t.name}</span>
|
||||||
|
{t.result && (
|
||||||
|
<div className="ml-3 text-[var(--muted)] truncate max-w-[500px]" title={t.result}>
|
||||||
|
→ {t.result.slice(0, 150)}{t.result.length > 150 ? '…' : ''}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
)}
|
||||||
<div className="ml-5 whitespace-pre-wrap">{renderContent(msg.content)}</div>
|
<div className="ml-5 whitespace-pre-wrap">{renderContent(msg.content)}</div>
|
||||||
{renderAttachments(msg.attachments)}
|
{renderAttachments(msg.attachments)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -147,6 +147,7 @@ export interface Message {
|
|||||||
author: MemberBrief | null;
|
author: MemberBrief | null;
|
||||||
content: string;
|
content: string;
|
||||||
thinking: string | null;
|
thinking: string | null;
|
||||||
|
tool_log: Array<{name: string; args?: string; result?: string; error?: boolean}> | null;
|
||||||
mentions: MemberBrief[];
|
mentions: MemberBrief[];
|
||||||
actor: MemberBrief | null;
|
actor: MemberBrief | null;
|
||||||
voice_url: string | null;
|
voice_url: string | null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user