From 226d20fbae3f057d677d1e0e344986ece4ffef5e Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Fri, 12 Dec 2025 15:06:08 -0800 Subject: [PATCH] feat: add /description command to update agent description (#193) Co-authored-by: Letta --- src/cli/App.tsx | 65 ++++++++++++++++++++++++++++++++++++ src/cli/commands/registry.ts | 7 ++++ 2 files changed, 72 insertions(+) diff --git a/src/cli/App.tsx b/src/cli/App.tsx index 2c31e47..b294074 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -1501,6 +1501,71 @@ export default function App({ return { submitted: true }; } + // Special handling for /description command - update agent description + if (msg.trim().startsWith("/description")) { + const parts = msg.trim().split(/\s+/); + const newDescription = parts.slice(1).join(" "); + + if (!newDescription) { + const cmdId = uid("cmd"); + buffersRef.current.byId.set(cmdId, { + kind: "command", + id: cmdId, + input: msg, + output: "Please provide a description: /description ", + phase: "finished", + success: false, + }); + buffersRef.current.order.push(cmdId); + refreshDerived(); + return { submitted: true }; + } + + const cmdId = uid("cmd"); + buffersRef.current.byId.set(cmdId, { + kind: "command", + id: cmdId, + input: msg, + output: "Updating description...", + phase: "running", + }); + buffersRef.current.order.push(cmdId); + refreshDerived(); + + setCommandRunning(true); + + try { + const client = await getClient(); + await client.agents.update(agentId, { + description: newDescription, + }); + + buffersRef.current.byId.set(cmdId, { + kind: "command", + id: cmdId, + input: msg, + output: `Description updated to "${newDescription}"`, + phase: "finished", + success: true, + }); + refreshDerived(); + } catch (error) { + const errorDetails = formatErrorDetails(error, agentId); + buffersRef.current.byId.set(cmdId, { + kind: "command", + id: cmdId, + input: msg, + output: `Failed: ${errorDetails}`, + phase: "finished", + success: false, + }); + refreshDerived(); + } finally { + setCommandRunning(false); + } + return { submitted: true }; + } + // Special handling for /resume command - show session resume selector if (msg.trim() === "/resume") { setResumeSelectorOpen(true); diff --git a/src/cli/commands/registry.ts b/src/cli/commands/registry.ts index e9d04db..b991727 100644 --- a/src/cli/commands/registry.ts +++ b/src/cli/commands/registry.ts @@ -72,6 +72,13 @@ export const commands: Record = { return "Renaming agent..."; }, }, + "/description": { + desc: "Update the current agent's description", + handler: () => { + // Handled specially in App.tsx to access agent ID and client + return "Updating description..."; + }, + }, "/swap": { desc: "Alias for /resume", hidden: true, // Hidden - use /resume instead