fix: add conv query param to ADE links
This commit is contained in:
@@ -3480,7 +3480,7 @@ export default function App({
|
||||
|
||||
// Special handling for /ade command - open agent in browser
|
||||
if (trimmed === "/ade") {
|
||||
const adeUrl = `https://app.letta.com/agents/${agentId}`;
|
||||
const adeUrl = `https://app.letta.com/agents/${agentId}?conversation=${conversationIdRef.current}`;
|
||||
const cmdId = uid("cmd");
|
||||
|
||||
// Fire-and-forget browser open
|
||||
@@ -7537,6 +7537,7 @@ Plan file path: ${planFilePath}`;
|
||||
ralphPending={pendingRalphConfig !== null}
|
||||
ralphPendingYolo={pendingRalphConfig?.isYolo ?? false}
|
||||
onRalphExit={handleRalphExit}
|
||||
conversationId={conversationId}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -7845,6 +7846,7 @@ Plan file path: ${planFilePath}`;
|
||||
agentId={agentId}
|
||||
agentName={agentName}
|
||||
onClose={closeOverlay}
|
||||
conversationId={conversationId}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ interface AgentInfoBarProps {
|
||||
agentId?: string;
|
||||
agentName?: string | null;
|
||||
serverUrl?: string;
|
||||
conversationId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,6 +19,7 @@ export const AgentInfoBar = memo(function AgentInfoBar({
|
||||
agentId,
|
||||
agentName,
|
||||
serverUrl,
|
||||
conversationId,
|
||||
}: AgentInfoBarProps) {
|
||||
// Check if current agent is pinned
|
||||
const isPinned = useMemo(() => {
|
||||
@@ -54,7 +56,9 @@ export const AgentInfoBar = memo(function AgentInfoBar({
|
||||
</Box>
|
||||
<Box>
|
||||
{isCloudUser && (
|
||||
<Link url={`https://app.letta.com/agents/${agentId}`}>
|
||||
<Link
|
||||
url={`https://app.letta.com/agents/${agentId}${conversationId ? `?conversation=${conversationId}` : ""}`}
|
||||
>
|
||||
<Text>Open in ADE ↗ </Text>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
@@ -15,6 +15,7 @@ interface InputAssistProps {
|
||||
agentName?: string | null;
|
||||
serverUrl?: string;
|
||||
workingDirectory?: string;
|
||||
conversationId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,6 +35,7 @@ export function InputAssist({
|
||||
agentName,
|
||||
serverUrl,
|
||||
workingDirectory,
|
||||
conversationId,
|
||||
}: InputAssistProps) {
|
||||
const showFileAutocomplete = currentInput.includes("@");
|
||||
const showCommandAutocomplete =
|
||||
@@ -79,6 +81,7 @@ export function InputAssist({
|
||||
agentId={agentId}
|
||||
agentName={agentName}
|
||||
serverUrl={serverUrl}
|
||||
conversationId={conversationId}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -131,6 +131,7 @@ export function Input({
|
||||
ralphPending = false,
|
||||
ralphPendingYolo = false,
|
||||
onRalphExit,
|
||||
conversationId,
|
||||
}: {
|
||||
visible?: boolean;
|
||||
streaming: boolean;
|
||||
@@ -154,6 +155,7 @@ export function Input({
|
||||
ralphPending?: boolean;
|
||||
ralphPendingYolo?: boolean;
|
||||
onRalphExit?: () => void;
|
||||
conversationId?: string;
|
||||
}) {
|
||||
const [value, setValue] = useState("");
|
||||
const [escapePressed, setEscapePressed] = useState(false);
|
||||
@@ -824,6 +826,7 @@ export function Input({
|
||||
agentName={agentName}
|
||||
serverUrl={serverUrl}
|
||||
workingDirectory={process.cwd()}
|
||||
conversationId={conversationId}
|
||||
/>
|
||||
|
||||
<InputFooter
|
||||
|
||||
@@ -14,6 +14,7 @@ interface MemoryViewerProps {
|
||||
agentId: string;
|
||||
agentName: string | null;
|
||||
onClose: () => void;
|
||||
conversationId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,9 +40,10 @@ export function MemoryViewer({
|
||||
agentId,
|
||||
agentName,
|
||||
onClose,
|
||||
conversationId,
|
||||
}: MemoryViewerProps) {
|
||||
// Construct ADE URL for this agent's memory
|
||||
const adeUrl = `https://app.letta.com/agents/${agentId}?view=memory`;
|
||||
const adeUrl = `https://app.letta.com/agents/${agentId}?view=memory${conversationId ? `&conversation=${conversationId}` : ""}`;
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
|
||||
|
||||
@@ -42,8 +42,13 @@ function isCreditExhaustedError(e: APIError): boolean {
|
||||
* Handles APIError, Error, and other error types consistently
|
||||
* @param e The error object to format
|
||||
* @param agentId Optional agent ID to create hyperlinks to the Letta dashboard
|
||||
* @param conversationId Optional conversation ID to include in agent links
|
||||
*/
|
||||
export function formatErrorDetails(e: unknown, agentId?: string): string {
|
||||
export function formatErrorDetails(
|
||||
e: unknown,
|
||||
agentId?: string,
|
||||
conversationId?: string,
|
||||
): string {
|
||||
let runId: string | undefined;
|
||||
|
||||
// Handle APIError from streaming (event: error)
|
||||
@@ -71,7 +76,7 @@ export function formatErrorDetails(e: unknown, agentId?: string): string {
|
||||
|
||||
const baseError = `${errorType}${message}${errorDetail}`;
|
||||
return runId && agentId
|
||||
? `${baseError}\n${createAgentLink(runId, agentId)}`
|
||||
? `${baseError}\n${createAgentLink(runId, agentId, conversationId)}`
|
||||
: baseError;
|
||||
}
|
||||
}
|
||||
@@ -85,7 +90,7 @@ export function formatErrorDetails(e: unknown, agentId?: string): string {
|
||||
|
||||
const baseError = detail ? `${e.message}\nDetail: ${detail}` : e.message;
|
||||
return runId && agentId
|
||||
? `${baseError}\n${createAgentLink(runId, agentId)}`
|
||||
? `${baseError}\n${createAgentLink(runId, agentId, conversationId)}`
|
||||
: baseError;
|
||||
}
|
||||
|
||||
@@ -127,7 +132,11 @@ export function formatErrorDetails(e: unknown, agentId?: string): string {
|
||||
/**
|
||||
* Create a terminal hyperlink to the agent with run ID displayed
|
||||
*/
|
||||
function createAgentLink(runId: string, agentId: string): string {
|
||||
const url = `https://app.letta.com/agents/${agentId}`;
|
||||
function createAgentLink(
|
||||
runId: string,
|
||||
agentId: string,
|
||||
conversationId?: string,
|
||||
): string {
|
||||
const url = `https://app.letta.com/agents/${agentId}${conversationId ? `?conversation=${conversationId}` : ""}`;
|
||||
return `View agent: \x1b]8;;${url}\x1b\\${agentId}\x1b]8;;\x1b\\ (run: ${runId})`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user