fix: use conversation-scoped cancel instead of agent-scoped (#550)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-14 21:07:59 -08:00
committed by GitHub
parent 3bb4d2d6a0
commit 0e58d71533
3 changed files with 10 additions and 6 deletions

View File

@@ -2799,7 +2799,9 @@ export default function App({
// Send cancel request to backend asynchronously (fire-and-forget)
// Don't wait for it or show errors since user already got feedback
getClient()
.then((client) => client.agents.messages.cancel(agentId))
.then((client) =>
client.conversations.cancel(conversationIdRef.current),
)
.catch(() => {
// Silently ignore - cancellation already happened client-side
});
@@ -2818,7 +2820,7 @@ export default function App({
setInterruptRequested(true);
try {
const client = await getClient();
await client.agents.messages.cancel(agentId);
await client.conversations.cancel(conversationIdRef.current);
if (abortControllerRef.current) {
abortControllerRef.current.abort();
@@ -3400,7 +3402,9 @@ export default function App({
// Send cancel request to backend (fire-and-forget)
getClient()
.then((client) => client.agents.messages.cancel(agentId))
.then((client) =>
client.conversations.cancel(conversationIdRef.current),
)
.then(() => {})
.catch(() => {
// Reset flag if cancel fails