fix: fallback to message cancel for default convo (#599)
This commit is contained in:
@@ -3132,9 +3132,13 @@ 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.conversations.cancel(conversationIdRef.current),
|
||||
)
|
||||
.then((client) => {
|
||||
// Use agents API for "default" conversation (primary message history)
|
||||
if (conversationIdRef.current === "default") {
|
||||
return client.agents.messages.cancel(agentIdRef.current);
|
||||
}
|
||||
return client.conversations.cancel(conversationIdRef.current);
|
||||
})
|
||||
.catch(() => {
|
||||
// Silently ignore - cancellation already happened client-side
|
||||
});
|
||||
@@ -3153,7 +3157,12 @@ export default function App({
|
||||
setInterruptRequested(true);
|
||||
try {
|
||||
const client = await getClient();
|
||||
await client.conversations.cancel(conversationIdRef.current);
|
||||
// Use agents API for "default" conversation (primary message history)
|
||||
if (conversationIdRef.current === "default") {
|
||||
await client.agents.messages.cancel(agentIdRef.current);
|
||||
} else {
|
||||
await client.conversations.cancel(conversationIdRef.current);
|
||||
}
|
||||
|
||||
if (abortControllerRef.current) {
|
||||
abortControllerRef.current.abort();
|
||||
@@ -3799,9 +3808,13 @@ export default function App({
|
||||
|
||||
// Send cancel request to backend (fire-and-forget)
|
||||
getClient()
|
||||
.then((client) =>
|
||||
client.conversations.cancel(conversationIdRef.current),
|
||||
)
|
||||
.then((client) => {
|
||||
// Use agents API for "default" conversation (primary message history)
|
||||
if (conversationIdRef.current === "default") {
|
||||
return client.agents.messages.cancel(agentIdRef.current);
|
||||
}
|
||||
return client.conversations.cancel(conversationIdRef.current);
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {
|
||||
// Reset flag if cancel fails
|
||||
|
||||
Reference in New Issue
Block a user