mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 06:59:42 +02:00
fix: COD-24 stabilize remote host sessions
This commit is contained in:
committed by
Aamer Akhter
parent
568d93efb0
commit
26e78daf58
@@ -42,8 +42,10 @@ import {
|
||||
type CodexConfig,
|
||||
type EffortLevel,
|
||||
type GeminiConfig,
|
||||
type SessionRemote,
|
||||
} from './types.js';
|
||||
import { buildEffortCliArgs } from './session-cli-builder.js';
|
||||
import { defaultRemoteCommandForMode, remoteSshTarget } from './remote-hosts.js';
|
||||
import {
|
||||
wrapWithNice,
|
||||
SAFE_PATH_PATTERN,
|
||||
@@ -669,6 +671,16 @@ function buildSpawnCommand(options: {
|
||||
return '$SHELL';
|
||||
}
|
||||
|
||||
export function buildRemoteLaunchCommand(options: { mode: SessionMode; remote: SessionRemote }): string {
|
||||
const { mode, remote } = options;
|
||||
const modeCommand = remote.commands?.[mode] || defaultRemoteCommandForMode(mode);
|
||||
const args = ['ssh', '-o', 'BatchMode=yes', '-t'];
|
||||
if (remote.port) args.push('-p', String(remote.port));
|
||||
const remoteCommand = `cd ${shellescape(remote.remotePath)} && ${modeCommand}`;
|
||||
args.push(remoteSshTarget(remote), `bash -lc ${shellescape(remoteCommand)}`);
|
||||
return args.map((arg) => shellescape(arg)).join(' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set sensitive environment variables on a tmux session via setenv.
|
||||
* These are inherited by panes but not visible in ps output or tmux history.
|
||||
|
||||
Reference in New Issue
Block a user