Skip to content

Register camera light render direct tools#70

Merged
Ker102 merged 3 commits into
mainfrom
feature/camera-light-render-tool-registry
May 18, 2026
Merged

Register camera light render direct tools#70
Ker102 merged 3 commits into
mainfrom
feature/camera-light-render-tool-registry

Conversation

@Ker102
Copy link
Copy Markdown
Owner

@Ker102 Ker102 commented May 17, 2026

Summary

  • add tool registry metadata for direct camera, light, render, object, material, transform, parenting, modifier, visibility, export, and addon-status tools
  • add LangGraph wrappers for PolyHaven and Sketchfab status probes so agent surfaces mirror addon MCP command names
  • include all implemented direct tools in tool filtering and the dev test-pipeline allowlist
  • add regression tests for direct tool registry selection and complete agent/addon/registry/filter/test-pipeline surface coverage

Validation

  • npx tsx scripts/test/test-direct-tool-surface-coverage.ts
  • npx tsx scripts/test/test-camera-light-render-tool-registry.ts
  • npx tsx scripts/test/test-direct-tool-planning-prompt.ts
  • npx tsx scripts/test/test-workflow-direct-tool-prompt.ts
  • npx tsx scripts/test/test-workflow-direct-tool-recommendations.ts
  • npx tsc --noEmit --incremental false
  • npm run lint

Summary by CodeRabbit

  • New Features

    • Added status checks for PolyHaven and Sketchfab integrations
    • Expanded scene capabilities: more object manipulation, material management, lights/cameras, render settings, and image rendering
    • Updated tool categorization to improve inspection/geometry/materials/lighting/camera grouping
  • Tests

    • Added tests validating camera/light/render tool registry and prompt guidance
    • Added end-to-end tool surface coverage and registry consistency checks

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ff7e4092-ec70-4993-a130-4af5688121ea

📥 Commits

Reviewing files that changed from the base of the PR and between ee05e3d and 3ed1638.

📒 Files selected for processing (2)
  • lib/orchestration/tool-registry.ts
  • scripts/test/test-direct-tool-surface-coverage.ts

📝 Walkthrough

Walkthrough

Adds external-integration status tools, registers many new material/geometry/lighting/camera/render tools and updates CATEGORY_GROUPS, expands the DEV MCP_TOOLS allowlist, and adds tests that verify registry/filter/allowlist consistency and agent-exposed tool coverage.

Changes

Tool Suite Expansion

Layer / File(s) Summary
New status tools and agent suite registration
lib/ai/agents.ts
Implements getPolyhavenStatus and getSketchfabStatus tools that call MCP status commands; updates PolyHaven/Sketchfab allowlists and ALL_TOOLS to register the new tools for configuration-aware filtering and agent binding.
Tool registry metadata and categorization
lib/orchestration/tool-registry.ts, lib/orchestration/tool-filter.ts
Adds TOOL_REGISTRY entries for material listing/creation/assignment and many geometry operations (object CRUD, transforms, modifiers, shading, parenting, visibility), plus lighting/camera/render controls; updates CATEGORY_GROUPS to reassign tools across inspection, geometry, materials, lighting, camera, and pipeline categories used by filtering and prompt generation.
DEV test pipeline allowlist expansion
app/api/test-pipeline/route.ts
Extends the DEV MCP_TOOLS allowlist with object/material manipulation and lighting/camera/render pipeline tools so planned MCP actions can pass validation and be executed in the dev test pipeline.
Tool coverage and consistency tests
scripts/test/test-camera-light-render-tool-registry.ts, scripts/test/test-direct-tool-surface-coverage.ts
Adds test scripts that assert tool names and metadata exist in the registry, verify selection by filterRelevantTools and formatToolListForPrompt, confirm dev-pipeline allowlisting, and assert the agent-exposed tool set matches expected MCP commands parsed from the addon.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Ker102/ViperMesh#49: Adds the inspect_collection_hierarchy MCP tool implementation that this PR registers and routes.
  • Ker102/ViperMesh#41: Adds material preset/inspection tools overlapping with registry, filter, and allowlist updates here.
  • Ker102/ViperMesh#54: Introduces object constraint tools (add_object_constraint, remove_object_constraint) that are wired through the same registry and category routing.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Register camera light render direct tools' directly matches the main changes: adding tool registry metadata and LangGraph wrappers for camera, light, render, and other direct tools to the agent surface.
Description check ✅ Passed The PR description comprehensively covers all major changes with a clear summary section and includes validation commands, but lacks the structured template format with explicit type classification and related issues.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/camera-light-render-tool-registry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/orchestration/tool-registry.ts`:
- Around line 109-178: The TOOL_REGISTRY entries for direct tools have metadata
that doesn't match their actual wrappers: update the parameter contract strings
for duplicate_object, join_objects, parent_set, parent_clear,
move_to_collection, and set_origin so they reflect the real parameter
names/types and enum values used by the implementation; specifically ensure
duplicate_object uses "name: string, new_name?: string, location?: number[]",
join_objects uses "names: string[], new_name?: string", parent_set uses
"children: string[], parent: string, keep_transform?: boolean", parent_clear
uses "names: string[], keep_transform?: boolean", move_to_collection uses
"names: string[], collection_name: string, create_new?: boolean", and set_origin
uses the exact enum labels the code expects (e.g.,
ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_MASS or the implementation's enum
identifiers) so planner-generated params match the tool wrappers.

In `@scripts/test/test-direct-tool-surface-coverage.ts`:
- Around line 16-33: The current extraction helpers (quotedNames, filterNames,
testPipelineNames) are matching any quoted tokens and produce false positives;
update the matching to target the actual constants/structures used by the test
(e.g., the CATEGORY_GROUPS and MCP_TOOLS definitions) instead of all quoted
strings: change quotedNames or the regexes used for filterSource and
testPipelineSource so they locate the specific constant/array/object
declarations (by matching the identifier names like CATEGORY_GROUPS or MCP_TOOLS
and their array/object literal contents) and extract only the keys/names within
those literals; ensure agentToolNames, addonCommandNames, registryNames keep
their intent but use precise patterns tied to the surrounding constant/property
definitions rather than a generic quoted-string regex.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d306a6f2-d0e6-40c0-987c-f7503ccfeaa1

📥 Commits

Reviewing files that changed from the base of the PR and between 09b62bd and ee05e3d.

📒 Files selected for processing (6)
  • app/api/test-pipeline/route.ts
  • lib/ai/agents.ts
  • lib/orchestration/tool-filter.ts
  • lib/orchestration/tool-registry.ts
  • scripts/test/test-camera-light-render-tool-registry.ts
  • scripts/test/test-direct-tool-surface-coverage.ts

Comment on lines +109 to +178
{
name: "duplicate_object",
description:
"Duplicate an existing object and optionally place it, preserving the source object as-is.",
category: "geometry",
parameters: "name: string, new_name?: string, location?: number[3]",
},
{
name: "join_objects",
description:
"Join multiple mesh objects into one named object when the scene needs a single combined mesh.",
category: "geometry",
parameters: "names: string[], new_name?: string",
},
{
name: "add_modifier",
description:
"Add a Blender modifier to an object using structured parameters before configuring or applying it.",
category: "geometry",
parameters: "name: string, modifier_type: string, modifier_name?: string",
},
{
name: "apply_modifier",
description:
"Apply a named modifier after stack inspection and validation.",
category: "geometry",
parameters: "name: string, modifier: string",
},
{
name: "apply_transforms",
description:
"Apply object location, rotation, or scale transforms with explicit booleans.",
category: "geometry",
parameters: "name: string, location?: boolean, rotation?: boolean, scale?: boolean",
},
{
name: "shade_smooth",
description:
"Set smooth or flat shading for mesh objects without Python.",
category: "geometry",
parameters: "name: string, smooth?: boolean",
},
{
name: "parent_set",
description:
"Parent one or more child objects to a parent while preserving the intended scene hierarchy.",
category: "geometry",
parameters: "children: string[], parent: string, keep_transform?: boolean",
},
{
name: "parent_clear",
description:
"Clear object parenting with optional transform preservation.",
category: "geometry",
parameters: "names: string[], keep_transform?: boolean",
},
{
name: "set_origin",
description:
"Set object origin using a bounded direct tool instead of context-sensitive Python operators.",
category: "geometry",
parameters: "name: string, origin_type?: GEOMETRY_ORIGIN|ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_MASS, center?: MEDIAN|BOUNDS",
},
{
name: "move_to_collection",
description:
"Move objects into an existing or newly created collection for deterministic scene organization.",
category: "geometry",
parameters: "names: string[], collection_name: string, create_new?: boolean",
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix TOOL_REGISTRY parameter contract drift for direct tools.

Several metadata signatures don’t match the actual tool wrappers, which can cause planner-generated invalid params at runtime (e.g., duplicate_object, join_objects, parent_set, parent_clear, move_to_collection, set_origin enum wording).

Proposed metadata fixes
-    parameters: "name: string, new_name?: string, location?: number[3]",
+    parameters: "name: string, new_name?: string, linked?: boolean",

-    parameters: "names: string[], new_name?: string",
+    parameters: "names: string[]",

-    parameters: "children: string[], parent: string, keep_transform?: boolean",
+    parameters: "child_name: string, parent_name: string, parent_type?: string",

-    parameters: "names: string[], keep_transform?: boolean",
+    parameters: "name: string, keep_transform?: boolean",

-    parameters: "name: string, origin_type?: GEOMETRY_ORIGIN|ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_MASS, center?: MEDIAN|BOUNDS",
+    parameters: "name: string, origin_type?: GEOMETRY_ORIGIN|ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_VOLUME, center?: MEDIAN|BOUNDS",

-    parameters: "names: string[], collection_name: string, create_new?: boolean",
+    parameters: "name: string, collection_name: string, create_new?: boolean",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
name: "duplicate_object",
description:
"Duplicate an existing object and optionally place it, preserving the source object as-is.",
category: "geometry",
parameters: "name: string, new_name?: string, location?: number[3]",
},
{
name: "join_objects",
description:
"Join multiple mesh objects into one named object when the scene needs a single combined mesh.",
category: "geometry",
parameters: "names: string[], new_name?: string",
},
{
name: "add_modifier",
description:
"Add a Blender modifier to an object using structured parameters before configuring or applying it.",
category: "geometry",
parameters: "name: string, modifier_type: string, modifier_name?: string",
},
{
name: "apply_modifier",
description:
"Apply a named modifier after stack inspection and validation.",
category: "geometry",
parameters: "name: string, modifier: string",
},
{
name: "apply_transforms",
description:
"Apply object location, rotation, or scale transforms with explicit booleans.",
category: "geometry",
parameters: "name: string, location?: boolean, rotation?: boolean, scale?: boolean",
},
{
name: "shade_smooth",
description:
"Set smooth or flat shading for mesh objects without Python.",
category: "geometry",
parameters: "name: string, smooth?: boolean",
},
{
name: "parent_set",
description:
"Parent one or more child objects to a parent while preserving the intended scene hierarchy.",
category: "geometry",
parameters: "children: string[], parent: string, keep_transform?: boolean",
},
{
name: "parent_clear",
description:
"Clear object parenting with optional transform preservation.",
category: "geometry",
parameters: "names: string[], keep_transform?: boolean",
},
{
name: "set_origin",
description:
"Set object origin using a bounded direct tool instead of context-sensitive Python operators.",
category: "geometry",
parameters: "name: string, origin_type?: GEOMETRY_ORIGIN|ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_MASS, center?: MEDIAN|BOUNDS",
},
{
name: "move_to_collection",
description:
"Move objects into an existing or newly created collection for deterministic scene organization.",
category: "geometry",
parameters: "names: string[], collection_name: string, create_new?: boolean",
},
{
name: "duplicate_object",
description:
"Duplicate an existing object and optionally place it, preserving the source object as-is.",
category: "geometry",
parameters: "name: string, new_name?: string, linked?: boolean",
},
{
name: "join_objects",
description:
"Join multiple mesh objects into one named object when the scene needs a single combined mesh.",
category: "geometry",
parameters: "names: string[]",
},
{
name: "add_modifier",
description:
"Add a Blender modifier to an object using structured parameters before configuring or applying it.",
category: "geometry",
parameters: "name: string, modifier_type: string, modifier_name?: string",
},
{
name: "apply_modifier",
description:
"Apply a named modifier after stack inspection and validation.",
category: "geometry",
parameters: "name: string, modifier: string",
},
{
name: "apply_transforms",
description:
"Apply object location, rotation, or scale transforms with explicit booleans.",
category: "geometry",
parameters: "name: string, location?: boolean, rotation?: boolean, scale?: boolean",
},
{
name: "shade_smooth",
description:
"Set smooth or flat shading for mesh objects without Python.",
category: "geometry",
parameters: "name: string, smooth?: boolean",
},
{
name: "parent_set",
description:
"Parent one or more child objects to a parent while preserving the intended scene hierarchy.",
category: "geometry",
parameters: "child_name: string, parent_name: string, parent_type?: string",
},
{
name: "parent_clear",
description:
"Clear object parenting with optional transform preservation.",
category: "geometry",
parameters: "name: string, keep_transform?: boolean",
},
{
name: "set_origin",
description:
"Set object origin using a bounded direct tool instead of context-sensitive Python operators.",
category: "geometry",
parameters: "name: string, origin_type?: GEOMETRY_ORIGIN|ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_VOLUME, center?: MEDIAN|BOUNDS",
},
{
name: "move_to_collection",
description:
"Move objects into an existing or newly created collection for deterministic scene organization.",
category: "geometry",
parameters: "name: string, collection_name: string, create_new?: boolean",
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/orchestration/tool-registry.ts` around lines 109 - 178, The TOOL_REGISTRY
entries for direct tools have metadata that doesn't match their actual wrappers:
update the parameter contract strings for duplicate_object, join_objects,
parent_set, parent_clear, move_to_collection, and set_origin so they reflect the
real parameter names/types and enum values used by the implementation;
specifically ensure duplicate_object uses "name: string, new_name?: string,
location?: number[]", join_objects uses "names: string[], new_name?: string",
parent_set uses "children: string[], parent: string, keep_transform?: boolean",
parent_clear uses "names: string[], keep_transform?: boolean",
move_to_collection uses "names: string[], collection_name: string, create_new?:
boolean", and set_origin uses the exact enum labels the code expects (e.g.,
ORIGIN_GEOMETRY|ORIGIN_CURSOR|ORIGIN_CENTER_OF_MASS or the implementation's enum
identifiers) so planner-generated params match the tool wrappers.

Comment thread scripts/test/test-direct-tool-surface-coverage.ts Outdated
@Ker102 Ker102 merged commit 274a241 into main May 18, 2026
6 checks passed
@Ker102 Ker102 deleted the feature/camera-light-render-tool-registry branch May 18, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant