diff --git a/.gemini/skills/workspaces/scripts/entrypoint.ts b/.gemini/skills/workspaces/scripts/entrypoint.ts index 6327e5b6ef..7f4c77f3e1 100644 --- a/.gemini/skills/workspaces/scripts/entrypoint.ts +++ b/.gemini/skills/workspaces/scripts/entrypoint.ts @@ -13,7 +13,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); const prNumber = process.argv[2]; const branchName = process.argv[3]; const policyPath = process.argv[4]; -const ISOLATED_CONFIG = process.env.GEMINI_CLI_HOME || path.join(process.env.HOME || '', '.workspace/gemini-cli-config'); +const ISOLATED_CONFIG = process.env.GEMINI_CLI_HOME || path.join(process.env.HOME || '', '.workspaces/gemini-cli-config'); async function main() { if (!prNumber || !branchName || !policyPath) { diff --git a/.gemini/skills/workspaces/scripts/playbooks/fix.ts b/.gemini/skills/workspaces/scripts/playbooks/fix.ts index 2ee36c33c8..5c06ac1837 100644 --- a/.gemini/skills/workspaces/scripts/playbooks/fix.ts +++ b/.gemini/skills/workspaces/scripts/playbooks/fix.ts @@ -6,9 +6,9 @@ export async function runFixPlaybook(prNumber: string, targetDir: string, policy console.log('Switching to agentic fix loop inside Gemini CLI...'); // Use the nightly gemini binary to activate the fix-pr skill and iterate + // Note: Gemini doesn't support --cwd, so the caller (worker.ts) must ensure we are already in targetDir const result = spawnSync(geminiBin, [ '--policy', policyPath, - '--cwd', targetDir, '-p', `Please activate the 'fix-pr' skill and use it to iteratively fix PR #${prNumber}. Ensure you handle CI failures, merge conflicts, and unaddressed review comments until the PR is fully passing and mergeable.` diff --git a/.gemini/skills/workspaces/scripts/setup.ts b/.gemini/skills/workspaces/scripts/setup.ts index 0abd716b8a..7149b923f7 100644 --- a/.gemini/skills/workspaces/scripts/setup.ts +++ b/.gemini/skills/workspaces/scripts/setup.ts @@ -225,6 +225,22 @@ and full builds) to a dedicated, high-performance GCP worker. await provider.exec(`mkdir -p ~/.workspaces && echo ${githubToken} > ~/.workspaces/.gh_token && chmod 600 ~/.workspaces/.gh_token`); } + // Initialize Remote Gemini Config with Auth + console.log('⚙️ Initializing remote Gemini configuration...'); + const remoteConfigDir = `~/.workspaces/gemini-cli-config/.gemini`; + await provider.exec(`mkdir -p ${remoteConfigDir}`); + + // Create a minimal settings.json on the remote to enable auth + const remoteSettings = { + general: { + authMethod: 'google_accounts' + } + }; + const tmpSettingsPath = path.join(os.tmpdir(), `remote-settings-${Date.now()}.json`); + fs.writeFileSync(tmpSettingsPath, JSON.stringify(remoteSettings, null, 2)); + await provider.sync(tmpSettingsPath, `${remoteConfigDir}/settings.json`); + fs.unlinkSync(tmpSettingsPath); + // Final Repo Sync console.log(`🚀 Finalizing Remote Repository (${userFork})...`); const repoUrl = `https://github.com/${userFork}.git`;