feat: add /plan command and allow gh commands in plan mode (#544)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-14 15:29:44 -08:00
committed by GitHub
parent 38b86b756e
commit 565010f4f7
4 changed files with 131 additions and 2 deletions

View File

@@ -4818,6 +4818,27 @@ export default function App({
return { submitted: true };
}
// Special handling for /plan command - enter plan mode
if (trimmed === "/plan") {
// Generate plan file path and enter plan mode
const planPath = generatePlanFilePath();
permissionMode.setPlanFilePath(planPath);
permissionMode.setMode("plan");
setUiPermissionMode("plan");
// Add status message to transcript
const statusId = uid("status");
buffersRef.current.byId.set(statusId, {
kind: "status",
id: statusId,
lines: [`Plan mode enabled. Plan file: ${planPath}`],
});
buffersRef.current.order.push(statusId);
refreshDerived();
return { submitted: true };
}
// Special handling for /init command - initialize agent memory
if (trimmed === "/init") {
// Check for pending approvals before sending

View File

@@ -68,9 +68,17 @@ export const commands: Record<string, Command> = {
return "Opening message search...";
},
},
"/plan": {
desc: "Enter plan mode",
order: 17,
handler: () => {
// Handled specially in App.tsx
return "Entering plan mode...";
},
},
"/clear": {
desc: "Start a new conversation (keep agent memory)",
order: 17,
order: 18,
handler: () => {
// Handled specially in App.tsx to create new conversation
return "Starting new conversation...";
@@ -78,7 +86,7 @@ export const commands: Record<string, Command> = {
},
"/clear-messages": {
desc: "Reset all agent messages (destructive)",
order: 18,
order: 19,
hidden: true, // Advanced command, not shown in autocomplete
handler: () => {
// Handled specially in App.tsx to reset agent messages