Show chat memory mutation tools

This commit is contained in:
Dhravya 2026-06-27 00:03:25 +00:00
parent fde9146964
commit 71577706ae
2 changed files with 20 additions and 5 deletions

View file

@ -48,7 +48,10 @@ import {
import { SpaceSelector } from "@/components/space-selector"
import { SuperLoader } from "../superloader"
import { UserMessage } from "./message/user-message"
import { AgentMessage } from "./message/agent-message"
import {
AgentMessage,
isChatToolDisplayPartType,
} from "./message/agent-message"
import { ChatGraphContextRail } from "./chat-graph-context-rail"
import { ChainOfThought } from "./input/chain-of-thought"
import { useIsMobile } from "@hooks/use-mobile"
@ -1147,16 +1150,14 @@ export function ChatSidebar({
}) => ({
id: m.id,
role: m.role,
// Keep memory retrieval tool outputs for display-only citations and graph highlights.
// Keep chat tool outputs that are meaningful to render after thread reload.
parts: (m.parts || []).filter(
(p) =>
p.type === "text" ||
p.type === "reasoning" ||
p.type === "source-url" ||
p.type === "source-document" ||
p.type === "tool-searchMemories" ||
p.type === "tool-recallContext" ||
p.type === "tool-discoverSpaces",
isChatToolDisplayPartType(p.type),
),
metadata: m.metadata,
createdAt: new Date(m.createdAt),

View file

@ -47,6 +47,9 @@ const TOOL_META: Record<string, { label: string; icon: typeof SearchIcon }> = {
searchMemories: { label: "Search Memories", icon: SearchIcon },
addMemory: { label: "Add Memory", icon: PlusIcon },
fetchMemory: { label: "Fetch Memory", icon: BookOpenIcon },
forgetMemory: { label: "Forget Memory", icon: XCircleIcon },
updateMemory: { label: "Update Memory", icon: BookOpenIcon },
forgetDocument: { label: "Forget Document", icon: XCircleIcon },
scheduleTask: { label: "Schedule Task", icon: ClockIcon },
listSchedules: { label: "List Schedules", icon: ListIcon },
cancelSchedule: { label: "Cancel Schedule", icon: XCircleIcon },
@ -112,6 +115,17 @@ function isMemoryRetrievalToolName(toolName: string): boolean {
)
}
export function isChatToolDisplayPartType(type: string): boolean {
return (
type === "tool-searchMemories" ||
type === "tool-recallContext" ||
type === "tool-discoverSpaces" ||
type === "tool-forgetMemory" ||
type === "tool-updateMemory" ||
type === "tool-forgetDocument"
)
}
function CitationLink({
href,
label,