diff --git a/core/context/providers/utils.ts b/core/context/providers/utils.ts index 7bc20e491..fd73a9bec 100644 --- a/core/context/providers/utils.ts +++ b/core/context/providers/utils.ts @@ -4,4 +4,5 @@ export const INSTRUCTIONS_BASE_ITEM: ContextItem = { name: "Instructions", description: "Instructions", content: "", + hidden: true, }; diff --git a/core/index.d.ts b/core/index.d.ts index 6da58c81b..178cf5b4c 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -364,6 +364,7 @@ export interface ContextItem { editable?: boolean; icon?: string; uri?: ContextItemUri; + hidden?: boolean; } export interface ContextItemWithId extends ContextItem { diff --git a/gui/src/components/mainInput/ContextItemsPeek.tsx b/gui/src/components/mainInput/ContextItemsPeek.tsx index ddac0046c..80ed7243a 100644 --- a/gui/src/components/mainInput/ContextItemsPeek.tsx +++ b/gui/src/components/mainInput/ContextItemsPeek.tsx @@ -5,7 +5,6 @@ import { } from "@heroicons/react/24/outline"; import { ContextItemWithId } from "core"; import { ctxItemToRifWithContents } from "core/commands/util"; -import { INSTRUCTIONS_BASE_ITEM } from "core/context/providers/utils"; import { getBasename } from "core/util"; import { useContext, useMemo, useState } from "react"; import { useSelector } from "react-redux"; @@ -136,11 +135,7 @@ function ContextItemsPeek({ const [open, setOpen] = useState(false); const ctxItems = useMemo(() => { - return ( - contextItems?.filter( - (ctxItem) => !ctxItem.name.includes(INSTRUCTIONS_BASE_ITEM.name), - ) ?? [] - ); + return contextItems?.filter((ctxItem) => !ctxItem.hidden) ?? []; }, [contextItems]); const isGatheringContext = useSelector( diff --git a/gui/src/redux/thunks/cancelTool.ts b/gui/src/redux/thunks/cancelTool.ts index 8bd09e911..c93c4585c 100644 --- a/gui/src/redux/thunks/cancelTool.ts +++ b/gui/src/redux/thunks/cancelTool.ts @@ -27,7 +27,15 @@ export const cancelTool = createAsyncThunk( dispatch( streamResponseAfterToolCall({ toolCallId: toolCallState.toolCallId, - toolOutput: [], + toolOutput: [ + { + name: "Tool Cancelled", + description: "Tool Cancelled", + content: + "The tool call was cancelled by the user. Please try something else or request further instructions.", + hidden: true, + }, + ], }), ); },