fix(resolver): tool configs must take precedence#2876
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryFixed output schema validation to use tool config outputs when available. Previously, when validating block output paths (e.g., Key Changes:
This ensures that when tools define their output schemas, those definitions take precedence during path validation, which is the correct behavior for maintaining consistency between tool definitions and runtime validation. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant BlockResolver
participant Block
participant ToolConfig
participant Schema
User->>BlockResolver: resolve("<blockName.path>")
BlockResolver->>Block: Get block by ID
BlockResolver->>BlockResolver: Navigate to output path
alt Path not found
BlockResolver->>Block: Get toolId from block.config.tool
BlockResolver->>ToolConfig: getTool(toolId)
alt Tool config exists
ToolConfig-->>BlockResolver: Return tool config
BlockResolver->>Schema: Use toolConfig.outputs (precedence)
else Tool config not found
BlockResolver->>Schema: Use block.outputs (fallback)
end
BlockResolver->>Schema: Validate path exists in schema
alt Path invalid
BlockResolver-->>User: Throw error with available fields
else Path valid but data missing
BlockResolver-->>User: Return undefined
end
else Path found
BlockResolver-->>User: Return value
end
|
Summary
Tool config must take precedence when they exist
Type of Change
Testing
Tested manually
Checklist