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.
- package/lib/tool-config.js +13 -8
- package/package.json +1 -1
package/lib/tool-config.js
CHANGED
|
@@ -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
|
|
227
|
-
*
|
|
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
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
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
|
|
240
|
+
spawn('sh', ['-c', 'sleep 30 && openclaw gateway restart'], {
|
|
236
241
|
stdio: 'ignore',
|
|
237
242
|
detached: true,
|
|
238
243
|
}).unref();
|
|
239
|
-
process.stdout.write('
|
|
244
|
+
process.stdout.write(' Gateway restart scheduled (30s)...\n');
|
|
240
245
|
}
|
|
241
246
|
|
|
242
247
|
// Exported for testing and direct use
|