mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-24 13:01:29 -07:00
fix(workspaces): sync credentials into isolated config directory for remote auth
This commit is contained in:
@@ -53,8 +53,9 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
|
||||
|
||||
const check = await provider.getExecOutput(`ls -d ${hostWorktreeDir}/.git`);
|
||||
|
||||
// FIX: Ensure container user (node) owns the workspaces and config directories
|
||||
await provider.exec(`sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/.workspaces ${containerHome}/.gemini`);
|
||||
// FIX: Ensure container user (node) owns the workspaces, config, and dev directories
|
||||
// This resolves EACCES errors across all shared volumes.
|
||||
await provider.exec(`sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/.workspaces ${containerHome}/.gemini ${containerHome}/dev`);
|
||||
|
||||
if (check.status !== 0) {
|
||||
console.log(' - Provisioning isolated git worktree...');
|
||||
@@ -78,9 +79,8 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
|
||||
// 4. Execution Logic
|
||||
const remoteWorker = `tsx ${persistentScripts}/entrypoint.ts ${prNumber} . ${remotePolicyPath} ${action}`;
|
||||
|
||||
// tmux command inside container. We must ensure the container sees the directory as safe.
|
||||
const remoteTmuxCmd = `git config --global --add safe.directory ${remoteWorktreeDir} && tmux attach-session -t ${sessionName} 2>/dev/null || tmux new-session -s ${sessionName} -n 'workspace' 'cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL'`;
|
||||
const containerWrap = `sudo docker exec -it maintainer-worker sh -c ${q(remoteTmuxCmd)}`;
|
||||
// DEBUG: Run directly in foreground WITHOUT tmux to see immediate errors
|
||||
const containerWrap = `sudo docker exec -it maintainer-worker sh -c 'cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL'`;
|
||||
|
||||
const finalSSH = provider.getRunCommand(containerWrap, { interactive: true });
|
||||
|
||||
|
||||
@@ -242,6 +242,11 @@ and full builds) to a dedicated, high-performance GCP worker.
|
||||
await provider.sync(tmpSettingsPath, `${remoteConfigDir}/settings.json`);
|
||||
fs.unlinkSync(tmpSettingsPath);
|
||||
|
||||
// Sync credentials into the isolated config as well
|
||||
if (fs.existsSync(path.join(env.HOME || '', '.gemini/google_accounts.json'))) {
|
||||
await provider.sync(path.join(env.HOME || '', '.gemini/google_accounts.json'), `${remoteConfigDir}/google_accounts.json`);
|
||||
}
|
||||
|
||||
// Final Repo Sync
|
||||
console.log(`🚀 Finalizing Remote Repository (${userFork})...`);
|
||||
const repoUrl = `https://github.com/${userFork}.git`;
|
||||
|
||||
Reference in New Issue
Block a user