From abb98d75719f8076e3509641813d447efc734df4 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Sun, 25 Jan 2026 22:14:09 -0800 Subject: [PATCH] fix: improve /feedback command with more context and consistent styling (#679) Co-authored-by: Letta --- src/cli/App.tsx | 37 +++++++++++++++++- src/cli/components/FeedbackDialog.tsx | 56 ++++++++++++++------------- src/cli/helpers/sessionContext.ts | 4 +- 3 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/cli/App.tsx b/src/cli/App.tsx index fe78164..1dc45e1 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -164,6 +164,7 @@ import { } from "./helpers/pasteRegistry"; import { generatePlanFilePath } from "./helpers/planName"; import { safeJsonParseOr } from "./helpers/safeJsonParse"; +import { getDeviceType, getLocalTime } from "./helpers/sessionContext"; import { type ApprovalRequest, drainStreamWithResume } from "./helpers/stream"; import { collectFinishedTaskToolCalls, @@ -8274,6 +8275,31 @@ ${SYSTEM_REMINDER_CLOSE} version: process.env.npm_package_version || "unknown", platform: process.platform, settings: JSON.stringify(safeSettings), + // Additional context for debugging + system_info: { + local_time: getLocalTime(), + device_type: getDeviceType(), + cwd: process.cwd(), + }, + session_stats: (() => { + const stats = sessionStatsRef.current?.getSnapshot(); + if (!stats) return undefined; + return { + total_api_ms: stats.totalApiMs, + total_wall_ms: stats.totalWallMs, + step_count: stats.usage.stepCount, + prompt_tokens: stats.usage.promptTokens, + completion_tokens: stats.usage.completionTokens, + }; + })(), + agent_info: { + agent_name: agentName, + agent_description: agentDescription, + model: currentModelId, + }, + account_info: { + billing_tier: billingTier, + }, }), }, ); @@ -8309,7 +8335,16 @@ ${SYSTEM_REMINDER_CLOSE} } }); }, - [agentId, refreshDerived, withCommandLock, closeOverlay], + [ + agentId, + agentName, + agentDescription, + currentModelId, + billingTier, + refreshDerived, + withCommandLock, + closeOverlay, + ], ); const handleProfileEscapeCancel = useCallback(() => { diff --git a/src/cli/components/FeedbackDialog.tsx b/src/cli/components/FeedbackDialog.tsx index 6df4c38..fc6d9d2 100644 --- a/src/cli/components/FeedbackDialog.tsx +++ b/src/cli/components/FeedbackDialog.tsx @@ -1,8 +1,11 @@ import { Box, Text, useInput } from "ink"; import { useState } from "react"; +import { useTerminalWidth } from "../hooks/useTerminalWidth"; import { colors } from "./colors"; import { PasteAwareTextInput } from "./PasteAwareTextInput"; +const SOLID_LINE = "─"; + interface FeedbackDialogProps { onSubmit: (message: string) => void; onCancel: () => void; @@ -14,6 +17,9 @@ export function FeedbackDialog({ onCancel, initialValue = "", }: FeedbackDialogProps) { + const terminalWidth = useTerminalWidth(); + const solidLine = SOLID_LINE.repeat(Math.max(terminalWidth, 10)); + const [feedbackText, setFeedbackText] = useState(initialValue); const [error, setError] = useState(""); @@ -43,42 +49,38 @@ export function FeedbackDialog({ }; return ( - - - - Send Feedback to the Letta Team - - + + {/* Command header */} + {"> /feedback"} + {solidLine} - - - Share your thoughts, report issues, or suggest improvements. - - + - - Enter your feedback: - - - > - - + {" "}Enter your feedback: + + + + {"> "} + {error && ( - - {error} + + + {" "} + {error} + )} - - Press Enter to submit • Esc to cancel + + {" "}Enter to submit · Esc cancel ); diff --git a/src/cli/helpers/sessionContext.ts b/src/cli/helpers/sessionContext.ts index b88fe81..711acd1 100644 --- a/src/cli/helpers/sessionContext.ts +++ b/src/cli/helpers/sessionContext.ts @@ -23,7 +23,7 @@ interface SessionContextOptions { /** * Get the current local time in a human-readable format */ -function getLocalTime(): string { +export function getLocalTime(): string { const now = new Date(); return now.toLocaleString(undefined, { weekday: "long", @@ -39,7 +39,7 @@ function getLocalTime(): string { /** * Get device type based on platform */ -function getDeviceType(): string { +export function getDeviceType(): string { const p = platform(); switch (p) { case "darwin":