rterm-backend 3.1.9 → 3.1.10

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/bin/gybackend.cjs CHANGED
@@ -394750,8 +394750,10 @@ async function startGyBackend() {
394750
394750
  settingsService.onDidChange?.(refreshObservabilityFromSettings);
394751
394751
  agentService.setObservability(observability);
394752
394752
  terminalService.setSessionRecorder(observability.recording);
394753
- try {
394754
- const pluginRecords = await observability.pluginRegistry.reload();
394753
+ Promise.race([
394754
+ observability.pluginRegistry.reload(),
394755
+ new Promise((_, reject) => setTimeout(() => reject(new Error("plugin reload timeout (10s)")), 1e4))
394756
+ ]).then((pluginRecords) => {
394755
394757
  const pluginTools = [];
394756
394758
  for (const record2 of pluginRecords) {
394757
394759
  if (record2.error || !record2.enabled) continue;
@@ -394767,10 +394769,12 @@ async function startGyBackend() {
394767
394769
  if (pluginTools.length > 0) {
394768
394770
  agentService.setPluginTools(pluginTools);
394769
394771
  console.log(`[gybackend] Wired ${pluginTools.length} plugin tools from ${pluginRecords.filter((r) => !r.error && r.enabled).length} plugins into the agent.`);
394772
+ } else {
394773
+ console.log("[gybackend] No plugin tools found to wire.");
394770
394774
  }
394771
- } catch (e) {
394772
- console.warn("[gybackend] Plugin tool wiring failed:", e instanceof Error ? e.message : String(e));
394773
- }
394775
+ }).catch((e) => {
394776
+ console.warn("[gybackend] Plugin tool wiring skipped:", e instanceof Error ? e.message : String(e));
394777
+ });
394774
394778
  if (settingsService.getSettings().sessionLogging?.enabled) {
394775
394779
  const logDir = import_node_path28.default.join(
394776
394780
  import_node_process2.default.env.GYSHELL_STORE_DIR || "",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rterm-backend",
3
- "version": "3.1.9",
4
- "description": "Headless AI-native backend for RTerm / neuralOS — v3.1.9: fix plugin tool wiring race condition (all 11 plugins now callable in chat). 11 plugins. Transports (SSH/serial/local), SQLite, and NATS libs install automatically.",
3
+ "version": "3.1.10",
4
+ "description": "Headless AI-native backend for RTerm / neuralOS — v3.1.10: non-blocking plugin tool wiring (all 11 plugins callable in chat, no boot hang). 11 plugins. Transports (SSH/serial/local), SQLite, and NATS libs install automatically.",
5
5
  "main": "bin/gybackend.cjs",
6
6
  "bin": { "gybackend": "bin/gybackend.cjs" },
7
7
  "license": "MIT",
@@ -415,10 +415,17 @@ export function register(ctx) {
415
415
  // ─── auto-start the full-duplex responder on boot (when enabled + autoServe) ───
416
416
  // Makes "be tasked by them" always-on, not opt-in per session. Best-effort: a
417
417
  // failed auto-start logs but never blocks plugin registration (server may be down).
418
+ // Wrapped in setTimeout(0) to ensure register() returns synchronously BEFORE the
419
+ // async NATS connect — so PluginRegistry.loadFromDir() never hangs on the auto-serve.
418
420
  if (cfg.enabled && cfg.autoServe) {
419
- serveSkills(defaultServeSkills())
420
- .then((skills) => log(`[synapse] auto-started responder on ${cfg.prefix}.agent.${cfg.agentId}.inbox (skills: ${skills.join(', ')})`))
421
- .catch((e) => log(`[synapse] auto-serve deferred: ${e?.message ?? e} (responder will start on first synapse_serve call)`))
421
+ setTimeout(() => {
422
+ Promise.race([
423
+ serveSkills(defaultServeSkills()),
424
+ new Promise((_, reject) => setTimeout(() => reject(new Error('auto-serve connect timeout (5s)')), 5000)),
425
+ ])
426
+ .then((skills) => log(`[synapse] auto-started responder on ${cfg.prefix}.agent.${cfg.agentId}.inbox (skills: ${skills.join(', ')})`))
427
+ .catch((e) => log(`[synapse] auto-serve deferred: ${e?.message ?? e} (responder will start on first synapse_serve call)`))
428
+ }, 0)
422
429
  }
423
430
  }
424
431