Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(hetero-agent): hide device switcher in regular agent chat input (#15257)

Arvin Xue8275a93ffe8
diff --git a/src/features/ChatInput/RuntimeConfig/index.tsx b/src/features/ChatInput/RuntimeConfig/index.tsx
index b1980b87160..c45e0006ec1 100644
--- a/src/features/ChatInput/RuntimeConfig/index.tsx
+++ b/src/features/ChatInput/RuntimeConfig/index.tsx
@@ -19,8 +19,6 @@ import { useAgentStore } from '@/store/agent';
import { agentByIdSelectors, chatConfigByIdSelectors } from '@/store/agent/selectors';
import { useChatStore } from '@/store/chat';
import { topicSelectors } from '@/store/chat/selectors';
-import { useUserStore } from '@/store/user';
-import { labPreferSelectors } from '@/store/user/selectors';
import ContextWindow from '../ActionBar/Token';
import { useAgentId } from '../hooks/useAgentId';
@@ -29,7 +27,6 @@ import { useChatInputStore } from '../store';
import ApprovalMode from './ApprovalMode';
import CloudRepoSwitcher from './CloudRepoSwitcher';
import GitStatus from './GitStatus';
-import HeteroDeviceSwitcher from './HeteroDeviceSwitcher';
import ModeSelector from './ModeSelector';
import { useRepoType } from './useRepoType';
import WorkingDirectory from './WorkingDirectory';
@@ -121,15 +118,6 @@ const RuntimeConfig = memo(() => {
agentByIdSelectors.getAgentEnableModeById(agentId)(s),
]);
- const enableExecutionDeviceSwitcher = useUserStore(
- labPreferSelectors.enableExecutionDeviceSwitcher,
- );
-
- // When the execution device switcher is visible, it takes over sandbox/runtime routing.
- // Hide the runtimeMode selector to avoid two conflicting controls for the same decision.
- const showDeviceSwitcher =
- enableAgentMode && !isHeterogeneous && enableExecutionDeviceSwitcher && !!agentId;
-
const topicWorkingDirectory = useChatStore(topicSelectors.currentTopicWorkingDirectory);
const agentWorkingDirectory = useAgentStore((s) =>
agentId ? agentByIdSelectors.getAgentWorkingDirectoryById(agentId)(s) : undefined,
@@ -297,27 +285,24 @@ const RuntimeConfig = memo(() => {
{/* Left: Chat mode switcher + (agent-only) runtime env + working directory */}
<Flexbox horizontal align={'center'} gap={4}>
<ModeSelector />
- {showDeviceSwitcher && <HeteroDeviceSwitcher agentId={agentId} />}
{enableAgentMode && (
<>
- {!showDeviceSwitcher && (
- <Popover
- content={modeContent}
- open={modePopoverOpen}
- placement="top"
- styles={{ content: { padding: 4 } }}
- trigger="click"
- onOpenChange={setModePopoverOpen}
- >
- <div>
- {modePopoverOpen ? (
- modeButton
- ) : (
- <Tooltip title={t('runtimeEnv.selectMode')}>{modeButton}</Tooltip>
- )}
- </div>
- </Popover>
- )}
+ <Popover
+ content={modeContent}
+ open={modePopoverOpen}
+ placement="top"
+ styles={{ content: { padding: 4 } }}
+ trigger="click"
+ onOpenChange={setModePopoverOpen}
+ >
+ <div>
+ {modePopoverOpen ? (
+ modeButton
+ ) : (
+ <Tooltip title={t('runtimeEnv.selectMode')}>{modeButton}</Tooltip>
+ )}
+ </div>
+ </Popover>
{rightContent()}
</>
)}