fix duplicate ask

This commit is contained in:
axb 2025-03-10 12:12:25 +08:00
parent 621fc0e867
commit 8917ab7591

View file

@ -1402,8 +1402,12 @@ export class Cline {
isCheckpointPossible = true
}
const askApproval = async (type: ClineAsk, partialMessage?: string) => {
const { response, text, images } = await this.ask(type, partialMessage, false)
const askApproval = async (
type: ClineAsk,
partialMessage?: string,
progressStatus?: ToolProgressStatus,
) => {
const { response, text, images } = await this.ask(type, partialMessage, false, progressStatus)
if (response !== "yesButtonClicked") {
// Handle both messageResponse and noButtonClicked with text
if (text) {
@ -1819,11 +1823,8 @@ export class Cline {
if (this.diffStrategy && this.diffStrategy.getProgressStatus) {
toolProgressStatus = this.diffStrategy.getProgressStatus(block, diffResult)
}
await this.ask("tool", completeMessage, block.partial, toolProgressStatus).catch(
() => {},
)
const didApprove = await askApproval("tool", completeMessage)
const didApprove = await askApproval("tool", completeMessage, toolProgressStatus)
if (!didApprove) {
await this.diffViewProvider.revertChanges() // This likely handles closing the diff view
break