mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
_declares_variable returned True unconditionally for TOOL nodes, so any invented downstream reference survived generation. ESQ1-296 and ESQ1-289 are the same three lines: code/simple_code is a TOOL node, so the real code-node validation directly above never saw it. They differ only in consumer -- End tolerates the missing variable and yields a silent null, if-else fails at run time and feeds the repair loop. Tool outputs are not opaque: tool_node.py fixes text/files/json and the generator already copies the provider's output_schema onto the node. Validate against both, and alias the invented `result` to `text` so the common mistake self-heals. SHARED WITH CMD+K: fails open when no output_schema is present, so a tool we cannot describe behaves exactly as before. Only provably-wrong references are rejected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>