diff --git a/.gemini/skills/workspaces/scripts/orchestrator.ts b/.gemini/skills/workspaces/scripts/orchestrator.ts index b3a193f0ab..141fba6aa3 100644 --- a/.gemini/skills/workspaces/scripts/orchestrator.ts +++ b/.gemini/skills/workspaces/scripts/orchestrator.ts @@ -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 });