feat: revert default startup to use "default" conversation (#594)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -1456,22 +1456,33 @@ export default function App({
|
||||
? `Resuming conversation with **${agentName}**`
|
||||
: `Starting new conversation with **${agentName}**`;
|
||||
|
||||
// Command hints - for pinned agents show /memory, for unpinned show /pin
|
||||
const commandHints = isPinned
|
||||
// Command hints - vary based on agent state:
|
||||
// - Resuming: show /new (they may want a fresh conversation)
|
||||
// - New session + unpinned: show /pin (they should save their agent)
|
||||
// - New session + pinned: show /memory (they're already saved)
|
||||
const commandHints = isResumingConversation
|
||||
? [
|
||||
"→ **/agents** list all agents",
|
||||
"→ **/resume** resume a previous conversation",
|
||||
"→ **/memory** view your agent's memory blocks",
|
||||
"→ **/resume** browse all conversations",
|
||||
"→ **/new** start a new conversation",
|
||||
"→ **/init** initialize your agent's memory",
|
||||
"→ **/remember** teach your agent",
|
||||
]
|
||||
: [
|
||||
"→ **/agents** list all agents",
|
||||
"→ **/resume** resume a previous conversation",
|
||||
"→ **/pin** save + name your agent",
|
||||
"→ **/init** initialize your agent's memory",
|
||||
"→ **/remember** teach your agent",
|
||||
];
|
||||
: isPinned
|
||||
? [
|
||||
"→ **/agents** list all agents",
|
||||
"→ **/resume** resume a previous conversation",
|
||||
"→ **/memory** view your agent's memory blocks",
|
||||
"→ **/init** initialize your agent's memory",
|
||||
"→ **/remember** teach your agent",
|
||||
]
|
||||
: [
|
||||
"→ **/agents** list all agents",
|
||||
"→ **/resume** resume a previous conversation",
|
||||
"→ **/pin** save + name your agent",
|
||||
"→ **/init** initialize your agent's memory",
|
||||
"→ **/remember** teach your agent",
|
||||
];
|
||||
|
||||
// Build status lines with optional release notes above header
|
||||
const statusLines: string[] = [];
|
||||
@@ -3185,13 +3196,9 @@ export default function App({
|
||||
// Fetch new agent
|
||||
const agent = await client.agents.retrieve(targetAgentId);
|
||||
|
||||
// Always create a new conversation when switching agents
|
||||
// User can /resume to get back to a previous conversation if needed
|
||||
const newConversation = await client.conversations.create({
|
||||
agent_id: targetAgentId,
|
||||
isolated_block_labels: [...ISOLATED_BLOCK_LABELS],
|
||||
});
|
||||
const targetConversationId = newConversation.id;
|
||||
// Use the agent's default conversation when switching agents
|
||||
// User can /new to start a fresh conversation if needed
|
||||
const targetConversationId = "default";
|
||||
|
||||
// Update project settings with new agent
|
||||
await updateProjectSettings({ lastAgent: targetAgentId });
|
||||
@@ -3225,11 +3232,12 @@ export default function App({
|
||||
setLlmConfig(agent.llm_config);
|
||||
setConversationId(targetConversationId);
|
||||
|
||||
// Build success message - always a new conversation
|
||||
// Build success message - resumed default conversation
|
||||
const agentLabel = agent.name || targetAgentId;
|
||||
const successOutput = [
|
||||
`Started a new conversation with **${agentLabel}**.`,
|
||||
`⎿ Type /resume to resume a previous conversation`,
|
||||
`Resumed the default conversation with **${agentLabel}**.`,
|
||||
`⎿ Type /resume to browse all conversations`,
|
||||
`⎿ Type /new to start a new conversation`,
|
||||
].join("\n");
|
||||
const successItem: StaticItem = {
|
||||
kind: "command",
|
||||
@@ -4270,9 +4278,8 @@ export default function App({
|
||||
return { submitted: true };
|
||||
}
|
||||
|
||||
// Special handling for /clear and /new commands - start new conversation
|
||||
// (/new used to create a new agent, now it's just an alias for /clear)
|
||||
if (msg.trim() === "/clear" || msg.trim() === "/new") {
|
||||
// Special handling for /new command - start new conversation
|
||||
if (msg.trim() === "/new") {
|
||||
const cmdId = uid("cmd");
|
||||
buffersRef.current.byId.set(cmdId, {
|
||||
kind: "command",
|
||||
@@ -4339,14 +4346,14 @@ export default function App({
|
||||
return { submitted: true };
|
||||
}
|
||||
|
||||
// Special handling for /clear-messages command - reset all agent messages (destructive)
|
||||
if (msg.trim() === "/clear-messages") {
|
||||
// Special handling for /clear command - reset all agent messages (destructive)
|
||||
if (msg.trim() === "/clear") {
|
||||
const cmdId = uid("cmd");
|
||||
buffersRef.current.byId.set(cmdId, {
|
||||
kind: "command",
|
||||
id: cmdId,
|
||||
input: msg,
|
||||
output: "Resetting agent messages...",
|
||||
output: "Clearing in-context messages...",
|
||||
phase: "running",
|
||||
});
|
||||
buffersRef.current.order.push(cmdId);
|
||||
@@ -7917,11 +7924,16 @@ Plan file path: ${planFilePath}`;
|
||||
? `letta -n "${agentName}"`
|
||||
: `letta --agent ${agentId}`}
|
||||
</Text>
|
||||
<Text> </Text>
|
||||
<Text dimColor>Resume this conversation with:</Text>
|
||||
<Text color={colors.link.url}>
|
||||
{`letta --conv ${conversationId}`}
|
||||
</Text>
|
||||
{/* Only show conversation hint if not on default (default is resumed automatically) */}
|
||||
{conversationId !== "default" && (
|
||||
<>
|
||||
<Text> </Text>
|
||||
<Text dimColor>Resume this conversation with:</Text>
|
||||
<Text color={colors.link.url}>
|
||||
{`letta --conv ${conversationId}`}
|
||||
</Text>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
|
||||
@@ -77,29 +77,20 @@ export const commands: Record<string, Command> = {
|
||||
},
|
||||
},
|
||||
"/clear": {
|
||||
desc: "Start a new conversation (keep agent memory)",
|
||||
desc: "Clear in-context messages",
|
||||
order: 18,
|
||||
handler: () => {
|
||||
// Handled specially in App.tsx to create new conversation
|
||||
return "Starting new conversation...";
|
||||
},
|
||||
},
|
||||
"/clear-messages": {
|
||||
desc: "Reset all agent messages (destructive)",
|
||||
order: 19,
|
||||
hidden: true, // Advanced command, not shown in autocomplete
|
||||
handler: () => {
|
||||
// Handled specially in App.tsx to reset agent messages
|
||||
return "Resetting agent messages...";
|
||||
return "Clearing in-context messages...";
|
||||
},
|
||||
},
|
||||
|
||||
// === Page 2: Agent management (order 20-29) ===
|
||||
"/new": {
|
||||
desc: "Start a new conversation (same as /clear)",
|
||||
desc: "Start a new conversation (keep agent memory)",
|
||||
order: 20,
|
||||
handler: () => {
|
||||
// Handled specially in App.tsx - same as /clear
|
||||
// Handled specially in App.tsx to create new conversation
|
||||
return "Starting new conversation...";
|
||||
},
|
||||
},
|
||||
@@ -334,7 +325,6 @@ export const commands: Record<string, Command> = {
|
||||
},
|
||||
"/compact": {
|
||||
desc: "Summarize conversation history (compaction)",
|
||||
hidden: true,
|
||||
handler: () => {
|
||||
// Handled specially in App.tsx to access client and agent ID
|
||||
return "Compacting conversation...";
|
||||
|
||||
Reference in New Issue
Block a user