mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 21:41:12 -07:00
fix(offload): switch to global gemini binary for remote execution
This commit is contained in:
@@ -24,13 +24,9 @@ async function main() {
|
||||
const workDir = process.cwd(); // This is remoteWorkDir as set in review.ts
|
||||
const targetDir = path.join(workDir, branchName);
|
||||
|
||||
// Use global tsx or fallback to local
|
||||
// Use global tools pre-installed in the maintainer image
|
||||
const tsxBin = 'tsx';
|
||||
// Gemini bin will be needed by the interactive session later
|
||||
// We'll try to find it in the main repo or current worktree
|
||||
const geminiBin = fs.existsSync(path.join(workDir, 'node_modules/.bin/gemini'))
|
||||
? path.join(workDir, 'node_modules/.bin/gemini')
|
||||
: path.join(path.dirname(workDir), 'main/node_modules/.bin/gemini');
|
||||
const geminiBin = 'gemini';
|
||||
|
||||
const action = process.argv[5] || 'review';
|
||||
|
||||
|
||||
@@ -174,6 +174,9 @@ This script will:
|
||||
// Wipe existing dir for a clean clone and use absolute paths
|
||||
const cloneCmd = `rm -rf ${remoteWorkDir} && git clone --filter=blob:none ${repoUrl} ${remoteWorkDir} && cd ${remoteWorkDir} && git remote add upstream https://github.com/${upstreamRepo}.git && git fetch upstream`;
|
||||
await provider.exec(cloneCmd);
|
||||
|
||||
console.log('📦 Installing remote dependencies (this may take a few minutes)...');
|
||||
await provider.exec(`cd ${remoteWorkDir} && npm ci`);
|
||||
}
|
||||
|
||||
// Save Settings
|
||||
|
||||
@@ -39,17 +39,8 @@ export async function runWorker(args: string[]) {
|
||||
process.chdir(targetDir);
|
||||
}
|
||||
|
||||
// Find gemini binary (try worktree, then fallback to main repo)
|
||||
let geminiBin = path.join(targetDir, 'node_modules/.bin/gemini');
|
||||
if (!fs.existsSync(geminiBin)) {
|
||||
geminiBin = path.join(path.dirname(targetDir), 'main/node_modules/.bin/gemini');
|
||||
}
|
||||
|
||||
console.log(` - Gemini Bin: ${geminiBin} (Exists: ${fs.existsSync(geminiBin)})`);
|
||||
if (fs.existsSync(geminiBin)) {
|
||||
const versionCheck = spawnSync(geminiBin, ['--version'], { stdio: 'pipe' });
|
||||
console.log(` - Gemini Version: ${versionCheck.stdout.toString().trim() || 'Error fetching version'}`);
|
||||
}
|
||||
// Use global gemini command pre-installed in the maintainer image
|
||||
const geminiBin = 'gemini';
|
||||
|
||||
// 2. Dispatch to Playbook
|
||||
switch (action) {
|
||||
|
||||
Reference in New Issue
Block a user