mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: simplify yolo mode implementation by removing env vars
Remove HAPPY_GEMINI_ARGS and HAPPY_GEMINI_COMMAND environment variables. Refactor gemini.ts to export registerGeminiAgent(yolo) function that directly configures args instead of reading from environment.
This commit is contained in:
+2
-11
@@ -157,18 +157,9 @@ import { getCliArgs } from './utils/cliArgs'
|
||||
}
|
||||
}
|
||||
|
||||
if (yolo) {
|
||||
const existingArgs = process.env.HAPPY_GEMINI_ARGS ?? process.env.GEMINI_ACP_ARGS ?? '';
|
||||
if (!existingArgs.includes('--yolo')) {
|
||||
const nextArgs = existingArgs.trim().length > 0
|
||||
? `${existingArgs} --yolo`
|
||||
: '--yolo';
|
||||
process.env.HAPPY_GEMINI_ARGS = nextArgs;
|
||||
}
|
||||
}
|
||||
|
||||
await import('./agent/runners/gemini');
|
||||
const { registerGeminiAgent } = await import('./agent/runners/gemini');
|
||||
const { runAgentSession } = await import('./agent/runners/runAgentSession');
|
||||
registerGeminiAgent(yolo);
|
||||
|
||||
await initializeToken();
|
||||
await authAndSetupMachineIfNeeded();
|
||||
|
||||
Reference in New Issue
Block a user