Frontmatter
| id | 8223 |
| title | Investigate and Fix get_component_tree Timeout |
| state | Closed |
| labels | bugaiperformance |
| assignees | tobiu |
| createdAt | Dec 30, 2025, 7:48 PM |
| updatedAt | Dec 31, 2025, 12:47 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8223 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | 8169 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 31, 2025, 12:47 AM |
Investigate and Fix get_component_tree Timeout

Input from Gemini 3:
✦ I have instrumented
ai/mcp/server/neural-link/services/ConnectionService.mjswith detailed logging to diagnose the timeout issue.Changes:
- Redirected
spawnBridgestdout/stderr to a local./bridge.logfile.- Added
logger.infotocallto track outgoing requests.- Added
logger.infotohandleAppMessageto track incoming responses from the App Worker.Next Steps: Restart the MCP server (and Gemini CLI) to load the instrumented code, then reproduce the timeout and analyze
./bridge.log.

Input from Antigravity:
◆ Resolution Report
We have successfully diagnosed and resolved the
get_component_treetimeout and correctness issues.1. Root Cause Analysis
- Timeout (30s): The timeout was not caused by slow component serialization, but by an unhandled edge case in
Bridge.mjs. When an App Worker reloaded and obtained a new session ID, the Agent continued sending requests to the old (stale) ID. The Bridge dropped these messages silently, causing the Agent to hang until the 30s timeout.- Incorrect Tree Data: The original implementation used
Neo.manager.Component.getChildren(), which relied onVNodeUtil.getChildIds(). This method stops at component boundaries, failing to return the deep component tree.2. Fixes Implemented
A. Logic & Correctness (ComponentService.mjs)
We replaced the retrieval method with
getChildComponents, which correctly traverses the full hierarchy.// src/ai/client/ComponentService.mjs - const children = Neo.manager.Component.getChildren(component); + const children = Neo.manager.Component.getChildComponents(component);Status: Verified 1-line change cleanliness.
B. Transport Reliability (Bridge.mjs)
Updated
handleAgentMessageto send an immediate JSON-RPC error response if the target App ID is not found.// ai/mcp/server/neural-link/Bridge.mjs if (agentWs && payload.message && payload.message.id) { agentWs.send(JSON.stringify({ type: 'app_message', appWorkerId: payload.target, message: { id: payload.message.id, error: { code: -32000, message: `Target App [${payload.target}] not found` } } })); }Status: Verified. Eliminates the 30s hang, failing fast instead.
3. Process Improvements
- Established Anti-Reformatting Protocol in
.agent/ANTIGRAVITY_RULES.mdand linked it to the agent context.- Enforced
sedusage for surgical edits to prevent "formatting noise" in diffs.The issue is resolved and the codebase is clean.
During testing of the Neural Link capabilities, the
get_component_treetool consistently timed out (30s limit) when querying an active App Worker session (2aad7032-5222-4817-90d5-8e7fa7539eca).Tasks: