LearnNewsExamplesServices
Frontmatter
id8283
title[Neural Link] Feature: inspect_class tiered detail (compact mode)
stateClosed
labels
enhancementaiperformance
assigneestobiu
createdAtJan 2, 2026, 1:35 AM
updatedAtJan 4, 2026, 1:12 PM
githubUrlhttps://github.com/neomjs/neo/issues/8283
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 4, 2026, 1:12 PM

[Neural Link] Feature: inspect_class tiered detail (compact mode)

Closed v11.18.0 enhancementaiperformance
tobiu
tobiu commented on Jan 2, 2026, 1:35 AM

Enhance the inspect_class tool to support a detail parameter for token-efficient querying.

Problem: Currently, inspect_class returns the full class blueprint (inheritance, all configs, all methods), which can consume ~10K tokens. This is expensive for simple discovery tasks (e.g., "Does this class have a text config?").

Solution: Add an optional detail parameter:

  • compact: Returns ONLY "Own" configs and methods (defined on this class).
  • standard (Default): Returns full inheritance (current behavior).

Implementation:

  • Compare ctor.config with superCtor.config to identify "Own" configs (new keys or changed values).
  • Use proto.hasOwnProperty to identify "Own" methods.
  • Update RuntimeService.inspectClass and openapi.yaml.
tobiu added the enhancement label on Jan 2, 2026, 1:35 AM
tobiu added the ai label on Jan 2, 2026, 1:35 AM
tobiu added the performance label on Jan 2, 2026, 1:35 AM
tobiu added parent issue #8169 on Jan 2, 2026, 1:36 AM
tobiu assigned to @tobiu on Jan 4, 2026, 10:45 AM
tobiu referenced in commit 2c68522 - "feat(ai): Implement inspect_class tiered detail (compact mode) (#8283) on Jan 4, 2026, 1:11 PM
tobiu
tobiu Jan 4, 2026, 1:11 PM

Input from Gemini 2.5 pro:

✦ Implemented inspect_class tiered detail support.

Changes:

  1. Client-Side (src/ai/client/RuntimeService.mjs):
    • Added detail parameter ('standard' | 'compact') to inspectClass.
    • Implemented logic for 'compact' mode:
      • Configs: Returns only configs defined or overridden in the target class (compares against superclass).
      • Methods: Returns only methods defined on the target class prototype (no inheritance traversal).
  2. Server-Side (ai/mcp/server/neural-link/services/RuntimeService.mjs):
    • Updated proxy method to pass detail parameter.
  3. OpenAPI (ai/mcp/server/neural-link/openapi.yaml):
    • Added detail parameter to InspectClassRequest schema.

This significantly reduces token usage for class discovery tasks where full inheritance context is not required.

tobiu closed this issue on Jan 4, 2026, 1:12 PM