Use precomputed runtime env in OpenCode execute
This commit is contained in:
parent
f4f9d6fd3f
commit
0078fa66a3
1 changed files with 6 additions and 2 deletions
|
|
@ -108,7 +108,11 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
|
||||||
if (!hasExplicitApiKey && authToken) {
|
if (!hasExplicitApiKey && authToken) {
|
||||||
env.PAPERCLIP_API_KEY = authToken;
|
env.PAPERCLIP_API_KEY = authToken;
|
||||||
}
|
}
|
||||||
const runtimeEnv = ensurePathInEnv({ ...process.env, ...env });
|
const runtimeEnv = Object.fromEntries(
|
||||||
|
Object.entries(ensurePathInEnv({ ...process.env, ...env })).filter(
|
||||||
|
(entry): entry is [string, string] => typeof entry[1] === "string",
|
||||||
|
),
|
||||||
|
);
|
||||||
await ensureCommandResolvable(command, cwd, runtimeEnv);
|
await ensureCommandResolvable(command, cwd, runtimeEnv);
|
||||||
|
|
||||||
await ensureOpenCodeModelConfiguredAndAvailable({
|
await ensureOpenCodeModelConfiguredAndAvailable({
|
||||||
|
|
@ -216,7 +220,7 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
|
||||||
|
|
||||||
const proc = await runChildProcess(runId, command, args, {
|
const proc = await runChildProcess(runId, command, args, {
|
||||||
cwd,
|
cwd,
|
||||||
env,
|
env: runtimeEnv,
|
||||||
stdin: prompt,
|
stdin: prompt,
|
||||||
timeoutSec,
|
timeoutSec,
|
||||||
graceSec,
|
graceSec,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue