mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-24 13:01:29 -07:00
fix(offload): implement robust fork detection and refine boot disk allocation
This commit is contained in:
@@ -92,10 +92,7 @@ export class GceCosProvider implements WorkerProvider {
|
||||
'--project', this.projectId,
|
||||
'--zone', this.zone,
|
||||
'--machine-type', 'n2-standard-8',
|
||||
'--image-family', 'cos-stable',
|
||||
'--image-project', 'cos-cloud',
|
||||
'--boot-disk-size', '200GB',
|
||||
'--boot-disk-type', 'pd-balanced',
|
||||
'--create-disk', `auto-delete=yes,boot=yes,device-name=${this.instanceName},image=projects/cos-cloud/global/images/family/cos-stable,mode=rw,size=200,type=projects/${this.projectId}/zones/${this.zone}/diskTypes/pd-balanced`,
|
||||
'--metadata-from-file', `startup-script=${tmpScriptPath}`,
|
||||
'--metadata', 'enable-oslogin=TRUE',
|
||||
'--network-interface', `network=${vpcName},subnet=${subnetName},no-address`,
|
||||
|
||||
@@ -112,9 +112,26 @@ This script will:
|
||||
const sshConfigPath = path.join(offloadDir, 'ssh_config');
|
||||
const knownHostsPath = path.join(offloadDir, 'known_hosts');
|
||||
|
||||
// 1b. Security Fork Management (Temporarily Disabled)
|
||||
const upstreamRepo = 'google-gemini/gemini-cli';
|
||||
const userFork = upstreamRepo; // Fallback for now
|
||||
// 1b. Security Fork Management
|
||||
console.log('🔍 Detecting repository origins...');
|
||||
const repoInfoRes = spawnSync('gh', ['repo', 'view', '--json', 'nameWithOwner,parent,isFork'], { stdio: 'pipe' });
|
||||
let upstreamRepo = 'google-gemini/gemini-cli';
|
||||
let userFork = upstreamRepo;
|
||||
|
||||
if (repoInfoRes.status === 0) {
|
||||
try {
|
||||
const repoInfo = JSON.parse(repoInfoRes.stdout.toString());
|
||||
if (repoInfo.isFork && repoInfo.parent) {
|
||||
upstreamRepo = repoInfo.parent.nameWithOwner;
|
||||
userFork = repoInfo.nameWithOwner;
|
||||
console.log(` - Detected Fork: ${userFork} (Upstream: ${upstreamRepo})`);
|
||||
} else {
|
||||
console.log(` - Working on Upstream: ${upstreamRepo}`);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(' ⚠️ Failed to parse repo info. Using defaults.');
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve Paths
|
||||
const remoteWorkDir = `~/dev/main`;
|
||||
|
||||
Reference in New Issue
Block a user