ework-daemon 0.4.62 → 0.4.63
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 +18 -1
package/package.json
CHANGED
package/src/opencode.ts
CHANGED
|
@@ -330,6 +330,23 @@ export function wakePolicySkips(
|
|
|
330
330
|
return null;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
// Per-issue npm prefix: `npm install -g <pkg>` inside a session lands in the issue's
|
|
334
|
+
// workdir instead of the system global, so concurrent agents debugging different
|
|
335
|
+
// issues cannot clobber each other's global installs (nor poison the shared daemon env).
|
|
336
|
+
export function spawnEnvFor(
|
|
337
|
+
base: Record<string, string | undefined>,
|
|
338
|
+
hooks: Record<string, string | undefined>,
|
|
339
|
+
workdir: string,
|
|
340
|
+
): Record<string, string> {
|
|
341
|
+
const npmHome = `${workdir}/.npm-global`;
|
|
342
|
+
return {
|
|
343
|
+
...base,
|
|
344
|
+
...hooks,
|
|
345
|
+
NPM_CONFIG_PREFIX: npmHome,
|
|
346
|
+
PATH: `${npmHome}/bin:${base.PATH ?? ""}`,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
333
350
|
export class Engine {
|
|
334
351
|
private cfg: Config;
|
|
335
352
|
private store: Store;
|
|
@@ -1259,7 +1276,7 @@ export class Engine {
|
|
|
1259
1276
|
try { await tracker.setReaction(ref, msg.sourceCommentId, "eyes"); } catch { /* non-critical */ }
|
|
1260
1277
|
}
|
|
1261
1278
|
|
|
1262
|
-
const childEnv =
|
|
1279
|
+
const childEnv = spawnEnvFor(process.env, this.hookEnvFor(issue, session, workdir), workdir);
|
|
1263
1280
|
|
|
1264
1281
|
let exitCode: number | null = null;
|
|
1265
1282
|
|