mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
tweaks to shell abort logic based on feedback (#618)
This commit is contained in:
parent
094b9dc474
commit
a3b557222a
4 changed files with 38 additions and 57 deletions
|
|
@ -161,7 +161,7 @@ export const useGeminiStream = (
|
|||
async (
|
||||
query: PartListUnion,
|
||||
userMessageTimestamp: number,
|
||||
signal: AbortSignal,
|
||||
abortSignal: AbortSignal,
|
||||
): Promise<{
|
||||
queryToSend: PartListUnion | null;
|
||||
shouldProceed: boolean;
|
||||
|
|
@ -199,7 +199,7 @@ export const useGeminiStream = (
|
|||
return { queryToSend: null, shouldProceed: false }; // Handled by scheduling the tool
|
||||
}
|
||||
|
||||
if (shellModeActive && handleShellCommand(trimmedQuery, signal)) {
|
||||
if (shellModeActive && handleShellCommand(trimmedQuery, abortSignal)) {
|
||||
return { queryToSend: null, shouldProceed: false };
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ export const useGeminiStream = (
|
|||
addItem,
|
||||
onDebugMessage,
|
||||
messageId: userMessageTimestamp,
|
||||
signal,
|
||||
signal: abortSignal,
|
||||
});
|
||||
if (!atCommandResult.shouldProceed) {
|
||||
return { queryToSend: null, shouldProceed: false };
|
||||
|
|
@ -493,12 +493,12 @@ export const useGeminiStream = (
|
|||
setShowHelp(false);
|
||||
|
||||
abortControllerRef.current = new AbortController();
|
||||
const signal = abortControllerRef.current.signal;
|
||||
const abortSignal = abortControllerRef.current.signal;
|
||||
|
||||
const { queryToSend, shouldProceed } = await prepareQueryForGemini(
|
||||
query,
|
||||
userMessageTimestamp,
|
||||
signal,
|
||||
abortSignal,
|
||||
);
|
||||
|
||||
if (!shouldProceed || queryToSend === null) {
|
||||
|
|
@ -515,7 +515,7 @@ export const useGeminiStream = (
|
|||
setInitError(null);
|
||||
|
||||
try {
|
||||
const stream = client.sendMessageStream(chat, queryToSend, signal);
|
||||
const stream = client.sendMessageStream(chat, queryToSend, abortSignal);
|
||||
const processingStatus = await processGeminiStreamEvents(
|
||||
stream,
|
||||
userMessageTimestamp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue