Avoid duplicate thinking line on cancel
This commit is contained in:
parent
e649731f6b
commit
1f456a732a
@ -539,7 +539,11 @@ function promptWithStatus(force = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildApiMessages() {
|
function buildApiMessages() {
|
||||||
const system = buildSystemPrompt(systemPrompt, { workspace: WORKSPACE, allowMode: state.allowMode });
|
const system = buildSystemPrompt(systemPrompt, {
|
||||||
|
workspace: WORKSPACE,
|
||||||
|
allowMode: state.allowMode,
|
||||||
|
modelId: state.modelId || state.modelKey,
|
||||||
|
});
|
||||||
const messages = [{ role: 'system', content: system }];
|
const messages = [{ role: 'system', content: system }];
|
||||||
for (const msg of state.messages) {
|
for (const msg of state.messages) {
|
||||||
const m = { role: msg.role };
|
const m = { role: msg.role };
|
||||||
@ -668,7 +672,7 @@ async function runAssistantLoop() {
|
|||||||
if (!gotAnswer) {
|
if (!gotAnswer) {
|
||||||
clearTimeout(thinkingDelay);
|
clearTimeout(thinkingDelay);
|
||||||
if (state.thinkingMode) {
|
if (state.thinkingMode) {
|
||||||
spinner.stop(thinkingActive ? '○ 思考完成' : '○');
|
spinner.stop(thinkingActive ? '∙ 思考完成' : '∙');
|
||||||
} else {
|
} else {
|
||||||
spinner.stopSilent();
|
spinner.stopSilent();
|
||||||
}
|
}
|
||||||
@ -695,7 +699,7 @@ async function runAssistantLoop() {
|
|||||||
} else {
|
} else {
|
||||||
clearTimeout(thinkingDelay);
|
clearTimeout(thinkingDelay);
|
||||||
if (state.thinkingMode) {
|
if (state.thinkingMode) {
|
||||||
spinner.stop('○');
|
spinner.stop('∙');
|
||||||
} else {
|
} else {
|
||||||
spinner.stopSilent();
|
spinner.stopSilent();
|
||||||
}
|
}
|
||||||
@ -708,14 +712,18 @@ async function runAssistantLoop() {
|
|||||||
|
|
||||||
clearTimeout(thinkingDelay);
|
clearTimeout(thinkingDelay);
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
|
if (gotAnswer) {
|
||||||
|
spinner.stopSilent();
|
||||||
|
} else {
|
||||||
stopSpinnerForCancel(spinner, thinkingActive, showThinkingLabel, state.thinkingMode);
|
stopSpinnerForCancel(spinner, thinkingActive, showThinkingLabel, state.thinkingMode);
|
||||||
|
}
|
||||||
showCursor();
|
showCursor();
|
||||||
printCancelLine();
|
printCancelLine();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!gotAnswer) {
|
if (!gotAnswer) {
|
||||||
if (state.thinkingMode) {
|
if (state.thinkingMode) {
|
||||||
spinner.stop(thinkingActive ? '○ 思考完成' : '○');
|
spinner.stop(thinkingActive ? '∙ 思考完成' : '∙');
|
||||||
} else {
|
} else {
|
||||||
spinner.stopSilent();
|
spinner.stopSilent();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user