robot-resources 1.7.4 → 1.7.5

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/lib/tool-config.js +13 -8
  2. package/package.json +1 -1
@@ -223,20 +223,25 @@ export function configureToolRouting() {
223
223
 
224
224
  /**
225
225
  * Restart the OpenClaw gateway so it picks up new plugin + config.
226
- * Spawns a detached process that waits 5s then restarts — lets the wizard
227
- * finish and return output to OC before the gateway dies.
226
+ * Spawns a detached process that waits 30s then restarts — lets the wizard
227
+ * exit and the OC agent deliver the install report + answer at least one
228
+ * follow-up before the gateway dies.
228
229
  *
229
- * If called from inside an OC agent session (exec: npx robot-resources),
230
- * a synchronous restart kills the session before output is captured.
231
- * The deferred approach avoids this: wizard exits OC captures output →
232
- * 5s later gateway restarts next conversation has all tools loaded.
230
+ * Why deferred: a synchronous restart kills the OC session before the
231
+ * install report is captured. The 30s window gives the agent time to
232
+ * respond and handle a follow-up message. After the restart, the next
233
+ * conversation loads the plugin and routing is active.
234
+ *
235
+ * History: PR #89 used synchronous await (worked but required user to
236
+ * ask for updates). Session #26 used 5s delay (too short — killed
237
+ * session mid-conversation). 30s balances report delivery with restart.
233
238
  */
234
239
  async function restartOpenClawGateway() {
235
- spawn('sh', ['-c', 'sleep 5 && openclaw gateway restart'], {
240
+ spawn('sh', ['-c', 'sleep 30 && openclaw gateway restart'], {
236
241
  stdio: 'ignore',
237
242
  detached: true,
238
243
  }).unref();
239
- process.stdout.write(' Restarting gateway...\n');
244
+ process.stdout.write(' Gateway restart scheduled (30s)...\n');
240
245
  }
241
246
 
242
247
  // Exported for testing and direct use
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robot-resources",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Robot Resources — AI agent tools. One command to install everything.",
5
5
  "type": "module",
6
6
  "bin": {