fix(offload): implement robust fork detection and refine boot disk allocation

This commit is contained in:
mkorwel
2026-03-18 11:01:40 -07:00
parent 32e3d3e68e
commit 5dfc91cca5
2 changed files with 21 additions and 7 deletions

View File

@@ -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`,

View File

@@ -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`;