ework-daemon 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/opencode.ts +11 -0
package/package.json
CHANGED
package/src/opencode.ts
CHANGED
|
@@ -474,10 +474,21 @@ export class Engine {
|
|
|
474
474
|
|
|
475
475
|
let exitCode: number | null = null;
|
|
476
476
|
|
|
477
|
+
// M-1: build the child env explicitly. When a model IS resolved we push
|
|
478
|
+
// --model above, so opencode ignores OPENCODE_MODEL anyway. When NO model
|
|
479
|
+
// is resolved we must not let a leaked OPENCODE_MODEL from our own env
|
|
480
|
+
// silently win — strip it so opencode falls back to its opencode.json
|
|
481
|
+
// (the operator's explicit config) instead of arbitrary env pollution.
|
|
482
|
+
// Provider keys / Gitea vars are preserved (opencode + its plugin need
|
|
483
|
+
// them); only the explicit model-override var is neutralized.
|
|
484
|
+
const childEnv = { ...process.env };
|
|
485
|
+
if (!msg.model) delete childEnv.OPENCODE_MODEL;
|
|
486
|
+
|
|
477
487
|
try {
|
|
478
488
|
const proc = spawn({
|
|
479
489
|
cmd: args,
|
|
480
490
|
cwd: workdir,
|
|
491
|
+
env: childEnv,
|
|
481
492
|
stdout: "pipe",
|
|
482
493
|
stderr: "pipe",
|
|
483
494
|
stdin: "ignore",
|