Refactor workflow syntax tool and improve variable validation#796
Conversation
…fy syntax reference Rename the workflow_examples tool to workflow_syntax to better reflect its purpose of providing syntax documentation rather than just examples. Streamline the syntax reference helpers and reduce redundant instructions in workflow tool descriptions.
…tSteps port validation Rename the output step config field from `outputMapping` to `mapping` with backward compatibility for existing workflows. Add validation that nextSteps port names match allowed ports per step type (e.g. start/llm/action use "success", condition uses "true"/"false"). Expand syntax reference with hello_world example and explicit port documentation to reduce agent mistakes.
… and validate sources Introduce explicit namespacing for variable references: config.* for workflow config variables, variables.* for set_variables action output. Bare variable names are now flagged as errors with suggestions. Also adds LLM output format awareness to validation (text vs json schemas) and detects invalid sub-field access on scalar outputs.
…nd builder agent tools
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (40)
📝 WalkthroughWalkthroughThis pull request refactors the workflow automation tooling and variable handling system. It replaces the Estimated code review effort🎯 5 (Critical) | ⏱️ ~95 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Summary
workflow_examplestool toworkflow_syntaxwith a streamlined syntax reference focused on documentation over examplesconfig.*/variables.*prefixes and validate sources (bare names now error with suggestions)outputMappingtomapping(with backward compat) and addnextStepsport validation per step typeTest plan
workflow_syntax_tool.test.tsfor the renamed toolvalidate_variable_references_known_sources.test.tsfor namespaced variable validationvalidate_llm_output_path.test.tsfor LLM output format awarenessvalidate_next_steps_ports.test.tsfor port validationoutput.test.tsfor themappingrename🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor
Tests