fix tool cancellation while executing (#575)

This commit is contained in:
Olcan
2025-05-27 15:22:30 -07:00
committed by GitHub
parent c1395a8808
commit 0d5f7686d7

View File

@@ -186,7 +186,7 @@ export function useToolScheduler(
setAbortController(new AbortController());
setToolCalls((tc) =>
tc.map((c) =>
c.status !== 'error'
c.status !== 'error' && c.status !== 'executing'
? {
...c,
status: 'cancelled',
@@ -229,7 +229,7 @@ export function useToolScheduler(
.then((result) => {
if (signal.aborted) {
setToolCalls(
setStatus(callId, 'cancelled', 'Cancelled during execution'),
setStatus(callId, 'cancelled', String(result.llmContent)),
);
return;
}