fix(workspaces): restore tmux for persistent sessions

This commit is contained in:
mkorwel
2026-03-18 23:22:00 -07:00
parent da36bb8d01
commit 6414594a4c

View File

@@ -95,9 +95,11 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
const ghTokenRes = await provider.getExecOutput(`cat ${hostWorkspaceRoot}/.gh_token`);
const remoteGhToken = ghTokenRes.stdout.trim();
// DEBUG: Run directly in foreground WITHOUT tmux to see immediate errors
const authEnv = `${remoteApiKey ? `-e GEMINI_API_KEY=${remoteApiKey} ` : ''}${remoteGhToken ? `-e GITHUB_TOKEN=${remoteGhToken} -e GH_TOKEN=${remoteGhToken} ` : ''}`;
const containerWrap = `sudo docker exec -it ${authEnv}maintainer-worker sh -c ${q(`cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL`)}`;
// PERSISTENCE: Wrap the entire execution in a tmux session inside the container
const tmuxCmd = `tmux new-session -A -s ${sessionName} ${q(`cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL`)}`;
const containerWrap = `sudo docker exec -it ${authEnv}maintainer-worker sh -c ${q(tmuxCmd)}`;
const finalSSH = provider.getRunCommand(containerWrap, { interactive: true });