rterm-backend 3.1.8 → 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
@@ -391976,8 +391976,6 @@ function createObservability(deps) {
391976
391976
  ),
391977
391977
  onLog: deps.onLog
391978
391978
  });
391979
- void pluginRegistry.reload().catch(() => {
391980
- });
391981
391979
  const prometheusRegistry = new PrometheusRegistry({ prefix: "rterm" });
391982
391980
  const otelEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? process.env.RTERM_OTLP_METRICS_ENDPOINT;
391983
391981
  const otelExporter = otelEndpoint ? new OtelExporter({
@@ -394752,8 +394750,10 @@ async function startGyBackend() {
394752
394750
  settingsService.onDidChange?.(refreshObservabilityFromSettings);
394753
394751
  agentService.setObservability(observability);
394754
394752
  terminalService.setSessionRecorder(observability.recording);
394755
- try {
394756
- 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) => {
394757
394757
  const pluginTools = [];
394758
394758
  for (const record2 of pluginRecords) {
394759
394759
  if (record2.error || !record2.enabled) continue;
@@ -394769,10 +394769,12 @@ async function startGyBackend() {
394769
394769
  if (pluginTools.length > 0) {
394770
394770
  agentService.setPluginTools(pluginTools);
394771
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.");
394772
394774
  }
394773
- } catch (e) {
394774
- console.warn("[gybackend] Plugin tool wiring failed:", e instanceof Error ? e.message : String(e));
394775
- }
394775
+ }).catch((e) => {
394776
+ console.warn("[gybackend] Plugin tool wiring skipped:", e instanceof Error ? e.message : String(e));
394777
+ });
394776
394778
  if (settingsService.getSettings().sessionLogging?.enabled) {
394777
394779
  const logDir = import_node_path28.default.join(
394778
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.8",
4
- "description": "Headless AI-native backend for RTerm / neuralOS — v3.1.8: plugin tools wired into the agent (all 11 plugins 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