Skip to content

Refactor: Optimize Neural Link get_component_tree for token efficiency #8923

@tobiu

Description

@tobiu

The get_component_tree tool 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:

  1. Introduce a lean mode (default: true) to ComponentService.getComponentTree.
  2. Strict Whitelisting: In lean mode, return only the following properties: id, className, ntype, parentId, items.
  3. Ensure the recursion logic respects this whitelist, preventing any other configs (like 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.

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions