@@ -258,6 +258,8 @@ export interface AgentConfigPanelProps {
258258 compact ?: boolean ;
259259 // Show built-in environment variables section
260260 showBuiltInEnvVars ?: boolean ;
261+ // SSH remote execution enabled for this session
262+ isSshEnabled ?: boolean ;
261263}
262264
263265export function AgentConfigPanel ( {
@@ -287,6 +289,7 @@ export function AgentConfigPanel({
287289 refreshingAgent = false ,
288290 compact = false ,
289291 showBuiltInEnvVars = false ,
292+ isSshEnabled = false ,
290293} : AgentConfigPanelProps ) : JSX . Element {
291294 const padding = compact ? 'p-2' : 'p-3' ;
292295 const spacing = compact ? 'space-y-2' : 'space-y-3' ;
@@ -350,6 +353,7 @@ export function AgentConfigPanel({
350353 return (
351354 < div className = { spacing } >
352355 { /* Path input - pre-filled with detected path, editable to override */ }
356+ { /* When SSH is enabled and no custom path is set, show the remote binary name instead of local path */ }
353357 < div
354358 className = { `${ padding } rounded border` }
355359 style = { { borderColor : theme . colors . border , backgroundColor : theme . colors . bgMain } }
@@ -358,8 +362,8 @@ export function AgentConfigPanel({
358362 className = "block text-xs font-medium mb-2 flex items-center justify-between"
359363 style = { { color : theme . colors . textDim } }
360364 >
361- < span > Path</ span >
362- { onRefreshAgent && (
365+ < span > { isSshEnabled ? 'Remote Command' : ' Path' } </ span >
366+ { onRefreshAgent && ! isSshEnabled && (
363367 < button
364368 onClick = { onRefreshAgent }
365369 className = "p-1 rounded hover:bg-white/10 transition-colors flex items-center gap-1"
@@ -374,30 +378,39 @@ export function AgentConfigPanel({
374378 < div className = "flex gap-2" >
375379 < input
376380 type = "text"
377- value = { customPath || agent . path || '' }
381+ value = { customPath || ( isSshEnabled ? agent . binaryName : agent . path ) || '' }
378382 onChange = { ( e ) => onCustomPathChange ( e . target . value ) }
379383 onBlur = { onCustomPathBlur }
380384 onClick = { ( e ) => e . stopPropagation ( ) }
381385 placeholder = { `/path/to/${ agent . binaryName } ` }
386+ // When showing default SSH binary name, make field read-only to prevent accidental modification
387+ readOnly = { isSshEnabled && ! customPath }
382388 className = "flex-1 p-2 rounded border bg-transparent outline-none text-xs font-mono"
383- style = { { borderColor : theme . colors . border , color : theme . colors . textMain } }
389+ style = { {
390+ borderColor : theme . colors . border ,
391+ color : theme . colors . textMain ,
392+ // Slightly dim read-only fields to show they're not editable
393+ opacity : isSshEnabled && ! customPath ? 0.7 : 1 ,
394+ } }
384395 />
385- { customPath && customPath !== agent . path && (
396+ { customPath && (
386397 < button
387398 onClick = { ( e ) => {
388399 e . stopPropagation ( ) ;
389400 onCustomPathClear ( ) ;
390401 } }
391402 className = "px-2 py-1.5 rounded text-xs"
392403 style = { { backgroundColor : theme . colors . bgActivity , color : theme . colors . textDim } }
393- title = " Reset to detected path"
404+ title = { isSshEnabled ? ' Reset to remote binary name' : 'Reset to detected path' }
394405 >
395406 Reset
396407 </ button >
397408 ) }
398409 </ div >
399410 < p className = "text-xs opacity-50 mt-2" >
400- Path to the { agent . binaryName } binary. Edit to override the auto-detected path.
411+ { isSshEnabled
412+ ? `Remote command/binary for ${ agent . binaryName } . Leave empty to use default.`
413+ : `Path to the ${ agent . binaryName } binary. Edit to override the auto-detected path.` }
401414 </ p >
402415 </ div >
403416
0 commit comments