mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
fix: 修复 buddy 命令 ESC 关闭后进入永久 loading 状态
CancelRequestHandler 先于 BuddyPanel 的 ESC handler 拦截按键, 仅清除面板但未 resolve processSlashCommand 中的 Promise, 导致 queryGuard 卡在 dispatching 状态。通过在 setToolJSX 中增加 onDismiss 回调,在面板被外部清除时同步 resolve Promise。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -313,6 +313,15 @@ export async function handlePromptSubmit(
|
||||
shouldHidePromptInput: false,
|
||||
isLocalJSXCommand: true,
|
||||
isImmediate: true,
|
||||
onDismiss: () => {
|
||||
if (doneWasCalled) return
|
||||
doneWasCalled = true
|
||||
setToolJSX({
|
||||
jsx: null,
|
||||
shouldHidePromptInput: false,
|
||||
clearLocalJSX: true,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
return
|
||||
|
||||
@@ -839,6 +839,13 @@ async function getMessagesForSlashCommand(
|
||||
showSpinner: false,
|
||||
isLocalJSXCommand: true,
|
||||
isImmediate: command.immediate === true,
|
||||
// When the panel is dismissed externally (ESC via CancelRequestHandler),
|
||||
// resolve the Promise so executeUserInput doesn't hang forever.
|
||||
onDismiss: () => {
|
||||
if (doneWasCalled) return
|
||||
doneWasCalled = true
|
||||
void resolve({ messages: [], shouldQuery: false, command })
|
||||
},
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
|
||||
Reference in New Issue
Block a user