fix(offload): add sudo to docker commands for COS compatibility

This commit is contained in:
mkorwel
2026-03-17 14:03:30 -07:00
parent 0c3f836682
commit 38f1627e9b
2 changed files with 2 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
// We launch a tmux session INSIDE the container for persistence and tool access
const tmuxCmd = `cd /home/node/dev/worktrees/${sessionName} && ${remoteWorker}; exec $SHELL`;
const containerTmux = `docker exec -it maintainer-worker sh -c ${q(`tmux attach-session -t ${sessionName} 2>/dev/null || tmux new-session -s ${sessionName} -n 'offload' ${q(tmuxCmd)}`)}`;
const containerTmux = `sudo docker exec -it maintainer-worker sh -c ${q(`tmux attach-session -t ${sessionName} 2>/dev/null || tmux new-session -s ${sessionName} -n 'offload' ${q(tmuxCmd)}`)}`;
const finalSSH = provider.getRunCommand(containerTmux, { interactive: true });

View File

@@ -140,7 +140,7 @@ Host ${this.sshAlias}
getRunCommand(command: string, options: ExecOptions = {}): string {
let finalCmd = command;
if (options.wrapContainer) {
finalCmd = `docker exec ${options.interactive ? '-it' : ''} ${options.cwd ? `-w ${options.cwd}` : ''} ${options.wrapContainer} sh -c ${this.quote(command)}`;
finalCmd = `sudo docker exec ${options.interactive ? '-it' : ''} ${options.cwd ? `-w ${options.cwd}` : ''} ${options.wrapContainer} sh -c ${this.quote(command)}`;
}
return this.conn.getRunCommand(finalCmd, { interactive: options.interactive });
}