Merge pull request #6476 from continuedev/dallin/allow-interruptions

Allow tool call interruptions
This commit is contained in:
Patrick Erichsen 2025-07-07 11:28:29 -07:00 • committed by GitHub
commit f36c6c2cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View file

@ -33,6 +33,7 @@ import {
selectCurrentToolCallApplyState,
} from "../../redux/selectors/selectCurrentToolCall";
import {
cancelToolCall,
newSession,
updateToolCallOutput,
} from "../../redux/slices/sessionSlice";
@ -108,7 +109,6 @@ export function Chat() {
(state) => state.config.config.ui?.showChatScrollbar,
);
const codeToEdit = useAppSelector((state) => state.editModeState.codeToEdit);
const toolCallState = useAppSelector(selectCurrentToolCall);
const mode = useAppSelector((store) => store.session.mode);
const isInEdit = useAppSelector((store) => store.session.isInEdit);
@ -147,6 +147,7 @@ export function Chat() {
isStreaming,
);
const currentToolCallState = useAppSelector(selectCurrentToolCall);
const currentToolCallApplyState = useAppSelector(
selectCurrentToolCallApplyState,
);
@ -158,20 +159,19 @@ export function Chat() {
index?: number,
editorToClearOnSend?: Editor,
) => {
if (toolCallState?.status === "generated") {
return console.error(
"Cannot submit message while awaiting tool confirmation",
if (currentToolCallState) {
dispatch(
cancelToolCall({
toolCallId: currentToolCallState.toolCallId,
}),
);
}
if (
currentToolCallApplyState &&
currentToolCallApplyState.status !== "closed"
) {
return console.error(
"Cannot submit message while awaiting tool call apply",
);
ideMessenger.post("rejectDiff", currentToolCallApplyState);
}
const model = isInEdit
? (selectedModels?.edit ?? selectedModels?.chat)
: selectedModels?.chat;
@ -241,7 +241,7 @@ export function Chat() {
mode,
isInEdit,
codeToEdit,
toolCallState,
currentToolCallState,
currentToolCallApplyState,
],
);

View file

@ -27,7 +27,7 @@ export function ToolCallDisplay({
return (
<>
<div className="flex flex-col justify-center p-4 pb-0">
<div className="flex flex-col justify-center p-4 pb-1">
<div className="mb-4 flex flex-col">
<div className="flex flex-row items-center justify-between gap-1.5">
<div className="flex min-w-0 flex-row items-center gap-2">