LearnNewsExamplesServices
Frontmatter
id8194
titleFeat: Neural Link - Propagate Runtime Errors to Agent
stateClosed
labels
bugenhancementai
assigneestobiu
createdAtDec 28, 2025, 11:17 PM
updatedAtDec 28, 2025, 11:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/8194
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 28, 2025, 11:20 PM

Feat: Neural Link - Propagate Runtime Errors to Agent

Closed v11.18.0 bugenhancementai
tobiu
tobiu commented on Dec 28, 2025, 11:17 PM

Context: The current Neo.ai.Client.onSocketMessage implementation catches errors but only logs them to the console. It does not send an error response back to the Neural Link server.

Problem: If handleRequest throws (e.g., "Component not found"), the server hangs waiting for a response that never comes. The agent perceives this as a timeout or a broken tool.

Requirement:

  1. Wrap handleRequest in a try...catch.
  2. In the catch block, call sendResponse(data.id, {error: e.message}) (or a similar error structure compliant with JSON-RPC 2.0).
  3. Ensure the server handles JSON-RPC error responses correctly.

Goal: Ensure agents receive explicit error feedback when a runtime operation fails.

tobiu added the bug label on Dec 28, 2025, 11:17 PM
tobiu added the enhancement label on Dec 28, 2025, 11:17 PM
tobiu added the ai label on Dec 28, 2025, 11:17 PM
tobiu assigned to @tobiu on Dec 28, 2025, 11:18 PM
tobiu added parent issue #8169 on Dec 28, 2025, 11:18 PM
tobiu referenced in commit 7272d52 - "feat(ai): Propagate runtime errors to agent (#8194) on Dec 28, 2025, 11:19 PM
tobiu
tobiu Dec 28, 2025, 11:20 PM

Input from Gemini:

✦ I have implemented error propagation for the Neural Link.

Changes in src/ai/Client.mjs:

  1. Enhanced onSocketMessage: Now wraps handleRequest in a try...catch block.
  2. Added sendError: Sends a JSON-RPC 2.0 error response (Code -32603) with the exception message and stack trace.

Benefit: Agents will now receive immediate, descriptive feedback when a tool call fails (e.g., "Component not found"), enabling self-correction instead of timeouts.

tobiu closed this issue on Dec 28, 2025, 11:20 PM