agentgui 1.0.527 → 1.0.528
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/lib/claude-runner.js +15 -2
- package/package.json +1 -1
package/lib/claude-runner.js
CHANGED
|
@@ -7,6 +7,9 @@ function getSpawnOptions(cwd, additionalOptions = {}) {
|
|
|
7
7
|
if (isWindows) {
|
|
8
8
|
options.shell = true;
|
|
9
9
|
}
|
|
10
|
+
if (!options.env) {
|
|
11
|
+
options.env = { ...process.env };
|
|
12
|
+
}
|
|
10
13
|
return options;
|
|
11
14
|
}
|
|
12
15
|
|
|
@@ -50,6 +53,7 @@ class AgentRunner {
|
|
|
50
53
|
this.adapterCommand = config.adapterCommand || null;
|
|
51
54
|
this.adapterArgs = config.adapterArgs || [];
|
|
52
55
|
this.npxPackage = config.npxPackage || null;
|
|
56
|
+
this.spawnEnv = config.spawnEnv || {};
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
defaultBuildArgs(prompt, config) {
|
|
@@ -81,7 +85,11 @@ class AgentRunner {
|
|
|
81
85
|
} = config;
|
|
82
86
|
|
|
83
87
|
const args = this.buildArgs(prompt, config);
|
|
84
|
-
const
|
|
88
|
+
const spawnOpts = getSpawnOptions(cwd);
|
|
89
|
+
if (Object.keys(this.spawnEnv).length > 0) {
|
|
90
|
+
spawnOpts.env = { ...spawnOpts.env, ...this.spawnEnv };
|
|
91
|
+
}
|
|
92
|
+
const proc = spawn(this.command, args, spawnOpts);
|
|
85
93
|
|
|
86
94
|
if (config.onPid) {
|
|
87
95
|
try { config.onPid(proc.pid); } catch (e) {}
|
|
@@ -256,7 +264,11 @@ class AgentRunner {
|
|
|
256
264
|
args = [...resolved.prefixArgs, ...this.buildArgs(prompt, config)];
|
|
257
265
|
}
|
|
258
266
|
|
|
259
|
-
const
|
|
267
|
+
const spawnOpts = getSpawnOptions(cwd);
|
|
268
|
+
if (Object.keys(this.spawnEnv).length > 0) {
|
|
269
|
+
spawnOpts.env = { ...spawnOpts.env, ...this.spawnEnv };
|
|
270
|
+
}
|
|
271
|
+
const proc = spawn(cmd, args, spawnOpts);
|
|
260
272
|
|
|
261
273
|
if (config.onPid) {
|
|
262
274
|
try { config.onPid(proc.pid); } catch (e) {}
|
|
@@ -568,6 +580,7 @@ registry.register({
|
|
|
568
580
|
protocol: 'direct',
|
|
569
581
|
supportsStdin: true,
|
|
570
582
|
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip'],
|
|
583
|
+
spawnEnv: { MAX_THINKING_TOKENS: '0' },
|
|
571
584
|
|
|
572
585
|
buildArgs(prompt, config) {
|
|
573
586
|
const {
|