fix tool inclusion logic for edit

This commit is contained in:
Dallin Romney 2025-02-20 15:08:27 -08:00
parent 6a487e25ad
commit 0ffb30e35c
3 changed files with 6 additions and 8 deletions

View file

@ -109,7 +109,6 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
hideImageUpload: false,
hideUseCodebase: true,
hideSelectModel: false,
hideTools: true,
enterText: editModeState.editStatus === "accepting" ? "Retry" : "Edit",
}
: {};

View file

@ -67,7 +67,6 @@ export interface ToolbarOptions {
hideAddContext?: boolean;
enterText?: string;
hideSelectModel?: boolean;
hideTools?: boolean;
}
interface InputToolbarProps {
@ -91,10 +90,7 @@ function InputToolbar(props: InputToolbarProps) {
const hasCodeToEdit = useAppSelector(selectHasCodeToEdit);
const isEditModeAndNoCodeToEdit = isInEditMode && !hasCodeToEdit;
const isEnterDisabled = props.disabled || isEditModeAndNoCodeToEdit;
const toolsSupported =
defaultModel &&
modelSupportsTools(defaultModel) &&
!props.toolbarOptions?.hideTools;
const toolsSupported = defaultModel && modelSupportsTools(defaultModel);
const supportsImages =
defaultModel &&
@ -158,7 +154,7 @@ function InputToolbar(props: InputToolbarProps) {
</HoverItem>
)}
<ToggleToolsButton disabled={!toolsSupported} />
{!isInEditMode && <ToggleToolsButton disabled={!toolsSupported} />}
</div>
</div>

View file

@ -27,7 +27,10 @@ export const streamNormalInput = createAsyncThunk<
throw new Error("Default model not defined");
}
const includeTools = useTools && modelSupportsTools(defaultModel);
const includeTools =
useTools &&
modelSupportsTools(defaultModel) &&
state.session.mode === "chat";
// Send request
const gen = extra.ideMessenger.llmStreamChat(