Skip to content

Commit 9d23a3f

Browse files
committed
Remove context usage code
1 parent 14813d6 commit 9d23a3f

File tree

8 files changed

+1
-334
lines changed

8 files changed

+1
-334
lines changed

apps/sim/app/api/copilot/context-usage/route.ts

Lines changed: 0 additions & 134 deletions
This file was deleted.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/components/context-usage-indicator/context-usage-indicator.tsx

Lines changed: 0 additions & 76 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export { AttachedFilesDisplay } from './attached-files-display/attached-files-display'
22
export { ContextPills } from './context-pills/context-pills'
3-
export { ContextUsageIndicator } from './context-usage-indicator/context-usage-indicator'
43
export { MentionMenu } from './mention-menu/mention-menu'
54
export { ModeSelector } from './mode-selector/mode-selector'
65
export { ModelSelector } from './model-selector/model-selector'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/user-input.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ const UserInput = forwardRef<UserInputRef, UserInputProps>(
117117
const selectedModel =
118118
selectedModelOverride !== undefined ? selectedModelOverride : copilotStore.selectedModel
119119
const setSelectedModel = onModelChangeOverride || copilotStore.setSelectedModel
120-
const contextUsage = copilotStore.contextUsage
121120

122121
// Internal state
123122
const [internalMessage, setInternalMessage] = useState('')

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(({ panelWidth }, ref
100100
loadChats,
101101
messageCheckpoints,
102102
currentChat,
103-
fetchContextUsage,
104103
selectChat,
105104
deleteChat,
106105
areChatsFresh,
@@ -119,7 +118,6 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(({ panelWidth }, ref
119118
chatsLoadedForWorkflow,
120119
setCopilotWorkflowId,
121120
loadChats,
122-
fetchContextUsage,
123121
loadAutoAllowedTools,
124122
currentChat,
125123
isSendingMessage,

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/hooks/use-copilot-initialization.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface UseCopilotInitializationProps {
1111
chatsLoadedForWorkflow: string | null
1212
setCopilotWorkflowId: (workflowId: string | null) => Promise<void>
1313
loadChats: (forceRefresh?: boolean) => Promise<void>
14-
fetchContextUsage: () => Promise<void>
1514
loadAutoAllowedTools: () => Promise<void>
1615
currentChat: any
1716
isSendingMessage: boolean
@@ -30,7 +29,6 @@ export function useCopilotInitialization(props: UseCopilotInitializationProps) {
3029
chatsLoadedForWorkflow,
3130
setCopilotWorkflowId,
3231
loadChats,
33-
fetchContextUsage,
3432
loadAutoAllowedTools,
3533
currentChat,
3634
isSendingMessage,
@@ -102,18 +100,6 @@ export function useCopilotInitialization(props: UseCopilotInitializationProps) {
102100
isSendingMessage,
103101
])
104102

105-
/**
106-
* Fetch context usage when component is initialized and has a current chat
107-
*/
108-
useEffect(() => {
109-
if (isInitialized && currentChat?.id && activeWorkflowId) {
110-
logger.info('[Copilot] Component initialized, fetching context usage')
111-
fetchContextUsage().catch((err) => {
112-
logger.warn('[Copilot] Failed to fetch context usage on mount', err)
113-
})
114-
}
115-
}, [isInitialized, currentChat?.id, activeWorkflowId, fetchContextUsage])
116-
117103
/**
118104
* Load auto-allowed tools once on mount
119105
*/

0 commit comments

Comments
 (0)