@@ -650,7 +650,7 @@ function FileExplorerPanelInner(props: FileExplorerPanelProps) {
{/* Status bar at bottom */}
{session.fileTreeStats && (
handleRefreshAgent(agent.id)}
refreshingAgent={refreshingAgent === agent.id}
showBuiltInEnvVars
- sshRemotes={sshRemotes}
- sshRemoteConfig={agentSshRemoteConfigs[agent.id]}
- onSshRemoteConfigChange={(config) => {
- setAgentSshRemoteConfigs(prev => ({
- ...prev,
- [agent.id]: config
- }));
- }}
- globalDefaultSshRemoteId={globalDefaultSshRemoteId}
/>
)}
@@ -704,6 +696,22 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, existingSes
)}
+ {/* SSH Remote Execution - Top Level */}
+ {sshRemotes.length > 0 && selectedAgent && (
+
{
+ setAgentSshRemoteConfigs(prev => ({
+ ...prev,
+ [selectedAgent]: config
+ }));
+ }}
+ globalDefaultSshRemoteId={globalDefaultSshRemoteId}
+ />
+ )}
+
{/* Nudge Message */}
- {/* SSH Remote Configuration - only shown when props are provided */}
- {sshRemotes !== undefined && onSshRemoteConfigChange && (
-
-
-
- {/* SSH Remote Selection */}
-
- {/* Dropdown to select remote */}
-
-
-
-
-
- {/* Status indicator showing effective remote */}
- {(() => {
- const effectiveRemoteId = sshRemoteConfig?.enabled === false
- ? null
- : sshRemoteConfig?.remoteId || globalDefaultSshRemoteId || null;
- const effectiveRemote = effectiveRemoteId
- ? sshRemotes.find(r => r.id === effectiveRemoteId && r.enabled)
- : null;
- const isForceLocal = sshRemoteConfig?.enabled === false;
-
- return (
-
- {isForceLocal ? (
- <>
-
-
- Agent will run locally (SSH disabled)
-
- >
- ) : effectiveRemote ? (
- <>
-
-
- Agent will run on {effectiveRemote.name}
- ({effectiveRemote.host})
-
- >
- ) : (
- <>
-
-
- Agent will run locally
-
- >
- )}
-
- );
- })()}
-
- {/* No remotes configured hint */}
- {sshRemotes.filter(r => r.enabled).length === 0 && (
-
- No SSH remotes configured.{' '}
-
- Configure remotes in Settings → SSH Remotes.
-
-
- )}
-
-
-
- Execute this agent on a remote host via SSH instead of locally
-
-
- )}
-
{/* Agent-specific configuration options (contextWindow, model, etc.) */}
{agent.configOptions && agent.configOptions.length > 0 && agent.configOptions.map((option: AgentConfigOption) => (
void;
+ globalDefaultSshRemoteId?: string | null;
+ /** Optional: compact mode with less padding */
+ compact?: boolean;
+}
+
+export function SshRemoteSelector({
+ theme,
+ sshRemotes,
+ sshRemoteConfig,
+ onSshRemoteConfigChange,
+ globalDefaultSshRemoteId,
+ compact = false,
+}: SshRemoteSelectorProps): JSX.Element {
+ const padding = compact ? 'p-2' : 'p-3';
+
+ return (
+
+
+
+ {/* SSH Remote Selection */}
+
+ {/* Dropdown to select remote */}
+
+
+
+
+
+ {/* Status indicator showing effective remote */}
+ {(() => {
+ const effectiveRemoteId = sshRemoteConfig?.enabled === false
+ ? null
+ : sshRemoteConfig?.remoteId || globalDefaultSshRemoteId || null;
+ const effectiveRemote = effectiveRemoteId
+ ? sshRemotes.find(r => r.id === effectiveRemoteId && r.enabled)
+ : null;
+ const isForceLocal = sshRemoteConfig?.enabled === false;
+
+ return (
+
+ {isForceLocal ? (
+ <>
+
+
+ Agent will run locally (SSH disabled)
+
+ >
+ ) : effectiveRemote ? (
+ <>
+
+
+ Agent will run on {effectiveRemote.name}
+ ({effectiveRemote.host})
+
+ >
+ ) : (
+ <>
+
+
+ Agent will run locally
+
+ >
+ )}
+
+ );
+ })()}
+
+ {/* No remotes configured hint */}
+ {sshRemotes.filter(r => r.enabled).length === 0 && (
+
+ No SSH remotes configured.{' '}
+
+ Configure remotes in Settings → SSH Remotes.
+
+
+ )}
+
+
+
+ Execute this agent on a remote host via SSH instead of locally
+
+
+ );
+}