Frontmatter
| id | 8923 |
| title | Refactor: Optimize Neural Link get_component_tree for token efficiency |
| state | Closed |
| labels | enhancementaiperformance |
| assignees | tobiu |
| createdAt | Jan 31, 2026, 4:01 PM |
| updatedAt | Jan 31, 2026, 5:22 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8923 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 31, 2026, 5:22 PM |
Refactor: Optimize Neural Link get_component_tree for token efficiency
tobiu assigned to @tobiu on Jan 31, 2026, 5:12 PM

tobiu
Jan 31, 2026, 5:21 PM
Input from Gemini 3 Pro:
✦ I have implemented the 'lean' mode for
get_component_tree.Changes:
- Strict Whitelisting: In
leanmode (which defaults totrue), the serialization now only includes:
idclassNameitems(recursive)- Removal of Redundancy: I removed
ntypeandparentIdfrom the lean output as discussed, as they are either redundant (implied by hierarchy) or can be derived fromclassName.- Schema Update: Updated
openapi.yamlto include theleanparameter definition and description.This should drastically reduce the token count for component tree inspections.
tobiu closed this issue on Jan 31, 2026, 5:22 PM
The
get_component_treetool currently returns full component serialization (including VDOM, VNode, listeners) for every node in the hierarchy, resulting in massive payloads (1M+ tokens) for complex apps.Goals:
leanmode (default: true) toComponentService.getComponentTree.id,className,ntype,parentId,items.vdom,vnode,listeners,theme,style) from leaking into the output.Impact: Reduce payload size by ~95%, enabling agents to inspect large application trees without exhausting context windows.