fix: improve /feedback command with more context and consistent styling (#679)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-25 22:14:09 -08:00
committed by GitHub
parent 74de09d887
commit abb98d7571
3 changed files with 67 additions and 30 deletions

View File

@@ -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(() => {

View File

@@ -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 (
<Box flexDirection="column" paddingY={1}>
<Box marginBottom={1}>
<Text color={colors.approval.header} bold>
Send Feedback to the Letta Team
</Text>
</Box>
<Box flexDirection="column">
{/* Command header */}
<Text dimColor>{"> /feedback"}</Text>
<Text dimColor>{solidLine}</Text>
<Box marginBottom={1}>
<Text dimColor>
Share your thoughts, report issues, or suggest improvements.
</Text>
</Box>
<Box height={1} />
<Box flexDirection="column" marginBottom={1}>
<Box marginBottom={1}>
<Text>Enter your feedback:</Text>
</Box>
<Box>
<Text color={colors.approval.header}>&gt; </Text>
<PasteAwareTextInput
value={feedbackText}
onChange={setFeedbackText}
onSubmit={handleSubmit}
placeholder="Type your feedback here..."
/>
</Box>
<Text>{" "}Enter your feedback:</Text>
</Box>
<Box flexDirection="row">
<Text color={colors.selector.itemHighlighted}>{"> "}</Text>
<PasteAwareTextInput
value={feedbackText}
onChange={setFeedbackText}
onSubmit={handleSubmit}
placeholder="(type your feedback)"
/>
</Box>
{error && (
<Box marginBottom={1}>
<Text color="red">{error}</Text>
<Box marginTop={1}>
<Text color="red">
{" "}
{error}
</Text>
</Box>
)}
<Box>
<Text dimColor>Press Enter to submit Esc to cancel</Text>
<Box marginTop={1}>
<Text dimColor>{" "}Enter to submit · Esc cancel</Text>
</Box>
</Box>
);

View File

@@ -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":