-
Notifications
You must be signed in to change notification settings - Fork 0
Register camera light render direct tools #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import assert from "node:assert/strict" | ||
| import { readFileSync } from "node:fs" | ||
|
|
||
| import { TOOL_REGISTRY } from "../../lib/orchestration/tool-registry" | ||
| import { filterRelevantTools, formatToolListForPrompt } from "../../lib/orchestration/tool-filter" | ||
|
|
||
| const expectedTools = [ | ||
| "add_light", | ||
| "set_light_properties", | ||
| "add_camera", | ||
| "set_camera_properties", | ||
| "set_render_settings", | ||
| ] | ||
|
|
||
| for (const toolName of expectedTools) { | ||
| const metadata = TOOL_REGISTRY.find((tool) => tool.name === toolName) | ||
| assert.ok(metadata, `${toolName} should be described in TOOL_REGISTRY`) | ||
| assert.ok(metadata.description.length > 40, `${toolName} should have useful planner guidance`) | ||
| assert.ok(metadata.parameters?.length, `${toolName} should document its parameters`) | ||
| } | ||
|
|
||
| const lightingTools = filterRelevantTools("Add a warm spotlight, a camera, set render settings, and render a preview") | ||
| for (const toolName of expectedTools) { | ||
| assert.ok(lightingTools.includes(toolName), `${toolName} should be selected for camera/light/render requests`) | ||
| } | ||
|
|
||
| const promptToolList = formatToolListForPrompt(expectedTools) | ||
| assert.match(promptToolList, /Add a new POINT, SUN, SPOT, or AREA light/) | ||
| assert.match(promptToolList, /Make the camera active/) | ||
| assert.match(promptToolList, /Configure render engine/) | ||
|
|
||
| const testPipelineSource = readFileSync("app/api/test-pipeline/route.ts", "utf8") | ||
| for (const toolName of expectedTools) { | ||
| assert.match(testPipelineSource, new RegExp(`"${toolName}"`), `${toolName} should be allowed in the dev test pipeline`) | ||
| } | ||
|
|
||
| console.log("Camera, light, and render tool registry tests passed") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_originenum wording).Proposed metadata fixes
📝 Committable suggestion
🤖 Prompt for AI Agents