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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/opencode.ts +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
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",