Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion site/src/api/queries/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export const deploymentStats = () => {
};
};

export const deploymentSSHConfigQueryKey = ["deployment", "sshConfig"];

export const deploymentSSHConfig = () => {
return {
...disabledRefetchOptions,
queryKey: ["deployment", "sshConfig"],
queryKey: deploymentSSHConfigQueryKey,
queryFn: API.getDeploymentSSHConfig,
};
};
Expand Down
4 changes: 3 additions & 1 deletion site/src/api/queries/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ export const deleteUserAIBudgetOverride = (
};
};

export const apiKeyQueryKey = [...meKey, "apiKey"];

export function apiKey(): UseQueryOptions<GenerateAPIKeyResponse> {
return {
queryKey: [...meKey, "apiKey"],
queryKey: apiKeyQueryKey,
queryFn: () => API.getApiKey(),
};
}
Expand Down
9 changes: 0 additions & 9 deletions site/src/pages/AgentsPage/AgentChatPage/AgentChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
updateInfiniteChatsCache,
userChatDebugLogging,
} from "#/api/queries/chats";
import { deploymentSSHConfig } from "#/api/queries/deployment";
import {
organizationSkillPreferences,
organizationSkills,
Expand Down Expand Up @@ -237,7 +236,6 @@ const AgentChatPage: React.FC = () => {
agentId,
chatAgentId,
});
const sshConfigQuery = useQuery(deploymentSSHConfig());
const workspaceAgent = getWorkspaceAgent(workspace, chatAgentId);
const { proxy } = useProxy();

Expand Down Expand Up @@ -620,11 +618,6 @@ const AgentChatPage: React.FC = () => {

const chatTitle = chatQuery.data?.title;

const sshCommand =
workspace && workspaceAgent && sshConfigQuery.data?.hostname_suffix
? `ssh ${workspaceAgent.name}.${workspace.name}.${workspace.owner_name}.${sshConfigQuery.data.hostname_suffix}`
: undefined;

// Signal ready only after the store has synced fetched messages,
// so the DOM actually contains them when the parent scrolls.
const chatReadyFiredRef = useRef<string | null>(null);
Expand Down Expand Up @@ -796,7 +789,6 @@ const AgentChatPage: React.FC = () => {
<AgentChatPageNotFoundView />
) : (
<AgentChatPageView
key={agentId}
chat={chat}
persistedError={persistedError}
workspace={workspace}
Expand Down Expand Up @@ -838,7 +830,6 @@ const AgentChatPage: React.FC = () => {
onSetShowSidebarPanel={handleSetShowSidebarPanel}
debugLoggingEnabled={debugLoggingEnabled}
gitWatcher={gitWatcher}
sshCommand={sshCommand}
handleInterrupt={handleInterrupt}
handleDeleteQueuedMessage={handleDeleteQueuedMessage}
handlePromoteQueuedMessage={handlePromoteQueuedMessage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ const StoryAgentChatPageView: React.FC<StoryProps> = ({
onSetShowSidebarPanel: fn(),
debugLoggingEnabled: false,
gitWatcher: buildGitWatcher(),
sshCommand: undefined as string | undefined,
handleInterrupt: fn(),
handleDeleteQueuedMessage: fn(),
handlePromoteQueuedMessage: fn(),
Expand Down Expand Up @@ -663,7 +662,6 @@ export const WithWorkspace: Story = {
<StoryAgentChatPageView
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
};
Expand Down Expand Up @@ -1498,7 +1496,6 @@ export const RestoresPersistedSidebarTab: Story = {
showSidebarPanel
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
};
Expand All @@ -1519,7 +1516,6 @@ export const PersistsSidebarTabClick: Story = {
showSidebarPanel
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand Down Expand Up @@ -1616,7 +1612,6 @@ export const BrowserTabForHealthyAgentBrowserApp: Story = {
showSidebarPanel
workspace={MockWorkspace}
workspaceAgent={mockAgentWithBrowserApp}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand All @@ -1637,7 +1632,6 @@ export const BrowserTabForHealthDisabledAgentBrowserApp: Story = {
...MockWorkspaceAgent,
apps: [{ ...mockAgentBrowserApp, health: "disabled" }],
}}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand All @@ -1659,7 +1653,6 @@ export const NoBrowserTabForUnhealthyAgentBrowserApp: Story = {
...MockWorkspaceAgent,
apps: [{ ...mockAgentBrowserApp, health: "unhealthy" }],
}}
sshCommand="ssh coder.workspace"
/>
),
};
Expand Down Expand Up @@ -1691,7 +1684,6 @@ export const NoBrowserTabForAppOnNonBoundAgent: Story = {
},
}}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
};
Expand All @@ -1708,7 +1700,6 @@ export const PreservesUnavailableBrowserTab: Story = {
showSidebarPanel
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand All @@ -1732,7 +1723,6 @@ const renderWithSingletonSupport = () => (
workspace={MockWorkspace}
workspaceAgent={mockAgentWithBrowserApp}
desktopChatId={AGENT_ID}
sshCommand="ssh coder.workspace"
/>
);

Expand Down Expand Up @@ -1883,7 +1873,6 @@ export const DoesNotPersistSingletonTabsForArchivedChat: Story = {
workspace={MockWorkspace}
workspaceAgent={mockAgentWithBrowserApp}
desktopChatId={AGENT_ID}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand Down Expand Up @@ -1918,7 +1907,6 @@ export const HidesUnsupportedSingletonPanels: Story = {
showSidebarPanel
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand Down Expand Up @@ -1964,7 +1952,6 @@ export const DoesNotPersistForArchivedChat: Story = {
isInputDisabled
workspace={MockWorkspace}
workspaceAgent={MockWorkspaceAgent}
sshCommand="ssh coder.workspace"
/>
),
play: async ({ canvasElement }) => {
Expand Down
Loading
Loading