claw-subagent-service 0.0.53 → 0.0.54
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
CHANGED
|
@@ -343,6 +343,16 @@ class OpenClawClient {
|
|
|
343
343
|
|
|
344
344
|
// 关键:不设置 OPENCLAW_GATEWAY_URL,避免触发 "gateway url override requires explicit credentials"
|
|
345
345
|
// 让 openclaw agent 通过默认方式自动发现本地 gateway
|
|
346
|
+
|
|
347
|
+
// 修复:如果父进程 cwd 已失效(如目录被删除/替换),先修复自身 cwd,避免子进程继承无效路径
|
|
348
|
+
try {
|
|
349
|
+
process.cwd();
|
|
350
|
+
} catch (e) {
|
|
351
|
+
if (e.code === 'ENOENT') {
|
|
352
|
+
try { process.chdir(os.tmpdir()); } catch {}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
346
356
|
const env = getOpenClawEnv();
|
|
347
357
|
// 将 gateway token 通过环境变量传递(openclaw agent 不支持 --token CLI 参数)
|
|
348
358
|
if (gatewayToken) {
|
|
@@ -353,6 +363,7 @@ class OpenClawClient {
|
|
|
353
363
|
shell: true,
|
|
354
364
|
windowsHide: true,
|
|
355
365
|
env,
|
|
366
|
+
cwd: os.tmpdir(),
|
|
356
367
|
});
|
|
357
368
|
|
|
358
369
|
this.log?.info(`[OpenClawClient] CLI 子进程 PID=${child.pid}`);
|