From 5bc6553fc7346411900a940c82f63739a8773eaa Mon Sep 17 00:00:00 2001 From: Jake Howell Date: Wed, 9 Sep 2026 00:38:18 +1000 Subject: [PATCH] refactor(site/src/pages/AgentsPage): derive workspace skills in ChatPageInput (#29071) ChatPageInput now derives workspace skills from chat instead of taking a sliced list from AgentChatPage and the view. The page still computes that list for slash-command send. Depends on #29070 - Drop workspaceSkills from AgentChatPage and AgentChatPageView - ChatPageInput calls workspaceSkillsFromChat(chat) --- site/src/pages/AgentsPage/AgentChatPage.tsx | 1 - site/src/pages/AgentsPage/AgentChatPageView.tsx | 5 ----- site/src/pages/AgentsPage/components/ChatPageContent.tsx | 5 +---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/site/src/pages/AgentsPage/AgentChatPage.tsx b/site/src/pages/AgentsPage/AgentChatPage.tsx index fa4446ca2cd..bb24ac512f5 100644 --- a/site/src/pages/AgentsPage/AgentChatPage.tsx +++ b/site/src/pages/AgentsPage/AgentChatPage.tsx @@ -1196,7 +1196,6 @@ const AgentChatPage: FC = () => { selectedMCPServerIds={effectiveMCPServerIds} onMCPSelectionChange={handleMCPSelectionChange} onMCPAuthComplete={handleMCPAuthComplete} - workspaceSkills={chatWorkspaceSkills} /> )} diff --git a/site/src/pages/AgentsPage/AgentChatPageView.tsx b/site/src/pages/AgentsPage/AgentChatPageView.tsx index f7c590ee75d..e42be8a265d 100644 --- a/site/src/pages/AgentsPage/AgentChatPageView.tsx +++ b/site/src/pages/AgentsPage/AgentChatPageView.tsx @@ -42,7 +42,6 @@ import { import { QueuedForCapacityCallout } from "./components/ChatConversation/QueuedForCapacityCallout"; import { DesktopPanelContext } from "./components/ChatElements/tools/DesktopPanelContext"; -import type { SkillMetadata } from "./components/ChatMessageInput/SkillsTriggerMenu"; import type { PendingAttachment } from "./components/ChatPageContent"; import { ChatPageInput, ChatPageTimeline } from "./components/ChatPageContent"; import { ChatSharingPopoverContent } from "./components/ChatSharingPopover"; @@ -190,8 +189,6 @@ interface AgentChatPageViewProps { // Desktop chat ID (optional). desktopChatId?: string; - - workspaceSkills?: readonly SkillMetadata[]; } const UnavailableTabMessage: FC<{ message: string }> = ({ message }) => ( @@ -335,7 +332,6 @@ export const AgentChatPageView: FC = ({ onMCPSelectionChange, onMCPAuthComplete, desktopChatId, - workspaceSkills, }) => { const queryClient = useQueryClient(); const { proxy } = useProxy(); @@ -962,7 +958,6 @@ export const AgentChatPageView: FC = ({ selectedMCPServerIds={selectedMCPServerIds} onMCPSelectionChange={onMCPSelectionChange} onMCPAuthComplete={onMCPAuthComplete} - workspaceSkills={workspaceSkills} workspace={workspace} workspaceAgent={workspaceAgent} sshCommand={sshCommand} diff --git a/site/src/pages/AgentsPage/components/ChatPageContent.tsx b/site/src/pages/AgentsPage/components/ChatPageContent.tsx index 6c330c35b2f..016e25f5973 100644 --- a/site/src/pages/AgentsPage/components/ChatPageContent.tsx +++ b/site/src/pages/AgentsPage/components/ChatPageContent.tsx @@ -293,9 +293,6 @@ interface ChatPageInputProps { selectedMCPServerIds?: readonly string[]; onMCPSelectionChange?: (ids: string[]) => void; onMCPAuthComplete?: (serverId: string) => void; - // Workspace skill menu data derived from the resolved chat detail; - // undefined while the chat is still loading. - workspaceSkills?: readonly SkillMetadata[]; workspaceOptions: readonly TypesGen.Workspace[]; onWorkspaceChange?: (workspaceId: string | null) => void; isWorkspaceLoading: boolean; @@ -344,7 +341,6 @@ export const ChatPageInput: FC = ({ selectedMCPServerIds, onMCPSelectionChange, onMCPAuthComplete, - workspaceSkills, workspaceOptions, onWorkspaceChange, isWorkspaceLoading, @@ -359,6 +355,7 @@ export const ChatPageInput: FC = ({ const chatContext = chat.context; const planModeEnabled = chat.plan_mode === "plan"; const selectedWorkspaceId = chat.workspace_id ?? null; + const workspaceSkills = workspaceSkillsFromChat(chat); const thresholdsQuery = useQuery(userCompactionThresholds()); const compressionThreshold = resolveCompactionThreshold( chat.last_model_config_id,