LearnNewsExamplesServices
Frontmatter
id8515
titleRefactor Neural Link ConnectionService to support autoConnect config
stateClosed
labels
airefactoringarchitecture
assigneestobiu
createdAtJan 10, 2026, 7:44 PM
updatedAtJan 10, 2026, 7:48 PM
githubUrlhttps://github.com/neomjs/neo/issues/8515
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 10, 2026, 7:48 PM

Refactor Neural Link ConnectionService to support autoConnect config

Closed v11.20.0 airefactoringarchitecture
tobiu
tobiu commented on Jan 10, 2026, 7:44 PM

To prevent scripts using the AI SDK (like createLabelIndex.mjs) from hanging due to persistent Neural Link connections, we need to introduce a configuration option to control the auto-connection behavior.

Plan:

  1. Config: Update ai/mcp/server/neural-link/config.mjs to include autoConnect: true (default).
  2. Service: Update ai/mcp/server/neural-link/services/ConnectionService.mjs to check aiConfig.autoConnect in initAsync.
  3. SDK: Update ai/services.mjs to set NeuralLink_Config.data.autoConnect = false for SDK consumers.
  4. Cleanup: Remove the manual stop hack from buildScripts/createLabelIndex.mjs.

Why: This aligns the Neural Link service with other SDK services (like GitHub and Knowledge Base) which already have autoSync flags disabled by default in the SDK context.

tobiu added the ai label on Jan 10, 2026, 7:44 PM
tobiu added the refactoring label on Jan 10, 2026, 7:44 PM
tobiu added the architecture label on Jan 10, 2026, 7:44 PM
tobiu
tobiu Jan 10, 2026, 7:47 PM

Input from Gemini 3 Pro:

✦ Refactoring complete.

Changes:

  1. Config: Added autoConnect: true to ai/mcp/server/neural-link/config.mjs.
  2. Service: Updated ConnectionService.mjs to respect aiConfig.autoConnect in initAsync.
  3. SDK: Updated ai/services.mjs to set NeuralLink_Config.data.autoConnect = false.
  4. Cleanup: Reverted manual connection handling in createLabelIndex.mjs.

Verification: Ran node buildScripts/createLabelIndex.mjs and confirmed it exits cleanly without hanging and without explicit connection management code.

tobiu referenced in commit 266f0c0 - "refactor: Add autoConnect config to NeuralLink to prevent SDK hangs (#8515)" on Jan 10, 2026, 7:47 PM
tobiu assigned to @tobiu on Jan 10, 2026, 7:48 PM
tobiu
tobiu Jan 10, 2026, 7:48 PM

Input from Gemini 3 Pro:

✦ Closing ticket as the refactoring is complete and verified.

tobiu closed this issue on Jan 10, 2026, 7:48 PM