Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/orchestration/tool-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { TOOL_REGISTRY } from "./tool-registry"

const CATEGORY_GROUPS: Record<string, string[]> = {
inspection: ["get_scene_info", "get_object_info", "get_all_object_info", "inspect_blend_file_health", "inspect_modifier_constraint_stack", "inspect_rigging_data", "inspect_weight_paint_readiness", "inspect_animation_data", "inspect_collection_hierarchy", "inspect_viewport_areas", "set_viewport_shading", "focus_viewport_on_objects", "select_scene_objects", "set_active_collection", "get_viewport_screenshot", "render_viewport_to_path", "list_materials", "list_installed_addons"],
geometry: ["create_mesh_from_data", "validate_mesh_geometry", "inspect_retopology_readiness", "inspect_modifier_constraint_stack", "inspect_rigging_data", "inspect_weight_paint_readiness", "normalize_vertex_group_weights", "delete_object", "set_object_transform", "rename_object", "duplicate_object", "join_objects", "add_modifier", "configure_modifier", "configure_constraint", "add_object_constraint", "remove_object_constraint", "apply_modifier", "apply_transforms", "shade_smooth", "set_origin", "execute_code"],
animation: ["inspect_animation_data", "execute_code"],
geometry: ["create_mesh_from_data", "validate_mesh_geometry", "inspect_retopology_readiness", "inspect_modifier_constraint_stack", "inspect_rigging_data", "inspect_weight_paint_readiness", "normalize_vertex_group_weights", "delete_object", "set_object_transform", "rename_object", "duplicate_object", "join_objects", "add_modifier", "configure_modifier", "configure_constraint", "add_object_constraint", "remove_object_constraint", "apply_modifier", "apply_transforms", "shade_smooth", "set_origin"],
animation: ["inspect_animation_data"],
organization: ["inspect_collection_hierarchy", "organize_collection_hierarchy", "select_scene_objects", "set_active_collection", "parent_set", "parent_clear", "move_to_collection", "set_visibility"],
materials: ["list_materials", "create_material", "assign_material", "create_material_preset", "inspect_material_node_graph", "set_texture"],
pipeline: ["prepare_uv_layout", "validate_export_readiness", "export_object"],
Expand Down
20 changes: 20 additions & 0 deletions scripts/test/test-execute-code-filter-fallback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import assert from "node:assert/strict"

import { filterRelevantTools } from "../../lib/orchestration/tool-filter"

const meshTools = filterRelevantTools("create a custom mesh from vertices and validate the mesh geometry")
assert.ok(meshTools.includes("create_mesh_from_data"))
assert.ok(meshTools.includes("validate_mesh_geometry"))
assert.ok(!meshTools.includes("execute_code"), "mesh factory prompts should not expose execute_code by default")

const animationTools = filterRelevantTools("inspect the animation keyframes and f-curves on this scene")
assert.ok(animationTools.includes("inspect_animation_data"))
assert.ok(!animationTools.includes("execute_code"), "animation inspection prompts should not expose execute_code by default")

const explicitFallbackTools = filterRelevantTools("write a custom python script for unsupported procedural particle effects")
assert.ok(explicitFallbackTools.includes("execute_code"), "explicit custom-code prompts should still expose execute_code")

const largePlanTools = filterRelevantTools("build a large production scene with many dependent steps", 8)
assert.ok(largePlanTools.includes("execute_code"), "large multi-step plans should still expose execute_code as an escape hatch")

console.log("execute_code filter fallback tests passed")
Loading