openclawsetup 2.4.1 → 2.4.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/bin/cli.mjs +28 -4
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -991,13 +991,25 @@ async function runHealthCheck(cliName, autoFix = false) {
991
991
  fixCmd: `${cliName} config set gateway.port 18790 && ${cliName} gateway restart`,
992
992
  });
993
993
  } else {
994
- issues.push({
994
+ const issue = {
995
995
  level: 'error',
996
996
  title: `端口 ${port} 未监听`,
997
997
  detail: 'Gateway 端口未开放,服务可能未正常启动',
998
998
  solution: `运行 ${cliName} gateway restart`,
999
999
  fixCmd: `${cliName} gateway restart`,
1000
- });
1000
+ };
1001
+ if (autoFix) {
1002
+ console.log(colors.yellow(' 尝试重启 Gateway...'));
1003
+ const restartResult = safeExec(`${cliName} gateway restart`);
1004
+ if (restartResult.ok) {
1005
+ log.success('Gateway 已重启');
1006
+ fixed.push('Gateway 已自动重启');
1007
+ } else {
1008
+ issues.push(issue);
1009
+ }
1010
+ } else {
1011
+ issues.push(issue);
1012
+ }
1001
1013
  }
1002
1014
  }
1003
1015
 
@@ -1025,13 +1037,25 @@ async function runHealthCheck(cliName, autoFix = false) {
1025
1037
  }
1026
1038
  }
1027
1039
  } else {
1028
- issues.push({
1040
+ const issue = {
1029
1041
  level: 'error',
1030
1042
  title: 'API 无响应',
1031
1043
  detail: '无法连接到 Gateway API',
1032
1044
  solution: `重启服务: ${cliName} gateway restart`,
1033
1045
  fixCmd: `${cliName} gateway restart`,
1034
- });
1046
+ };
1047
+ if (autoFix) {
1048
+ console.log(colors.yellow(' 尝试重启 Gateway...'));
1049
+ const restartResult = safeExec(`${cliName} gateway restart`);
1050
+ if (restartResult.ok) {
1051
+ log.success('Gateway 已重启');
1052
+ fixed.push('Gateway 已自动重启(API 无响应)');
1053
+ } else {
1054
+ issues.push(issue);
1055
+ }
1056
+ } else {
1057
+ issues.push(issue);
1058
+ }
1035
1059
  }
1036
1060
 
1037
1061
  // 5. 检查模型配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclawsetup",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "OpenClaw 安装向导 - 智能安装、诊断、自动修复",
5
5
  "type": "module",
6
6
  "bin": {