Mirror Google API key env aliases into managed OpenCode.
OpenCode can mark Google connected via GEMINI_API_KEY while the Generative AI SDK only reads GOOGLE_GENERATIVE_AI_API_KEY, so chat asked for a key that was already present. Alias unset sibling names on managed launch for web and VS Code. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
This commit is contained in:
co-authored by
Serhii Dziupin
parent
9cccc8d667
commit
321794a621
@@ -1,6 +1,7 @@
|
||||
import { spawn, spawnSync } from 'node:child_process';
|
||||
import net from 'node:net';
|
||||
import { registerManagedProcess, unregisterManagedProcess, reapOrphanedProcesses } from './managed-process-registry.js';
|
||||
import { applyProviderEnvAliases } from './provider-env-aliases.js';
|
||||
import { recordStartupPerformance } from './startup-performance.js';
|
||||
|
||||
const parsePositiveInt = (value, fallback) => {
|
||||
@@ -518,13 +519,13 @@ export const createOpenCodeLifecycleRuntime = (deps) => {
|
||||
timeout: 30000,
|
||||
cwd: state.openCodeWorkingDirectory,
|
||||
shellEnvKeysCount: Object.keys(shellEnv).length,
|
||||
env: {
|
||||
env: applyProviderEnvAliases({
|
||||
...shellEnv,
|
||||
...process.env,
|
||||
...managedOpenCodeEnv,
|
||||
PATH: envPath,
|
||||
OPENCODE_SERVER_PASSWORD: openCodePassword,
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
if (!serverInstance || !serverInstance.url) {
|
||||
|
||||
Reference in New Issue
Block a user