feat: add command step, loop step, and swe-tdd workflow#537
feat: add command step, loop step, and swe-tdd workflow#537dataforxyz wants to merge 1 commit intoendorhq:mainfrom
Conversation
91f8d7b to
d869d4a
Compare
Add command step type for running shell commands directly in workflows, loop step type for iterating agent steps with conditions, and the swe-tdd workflow that uses these to implement test-driven development. Includes placeholder resolution, condition evaluation, step executor refactoring, and comprehensive test coverage.
052f102 to
7dc8c13
Compare
ereslibre
left a comment
There was a problem hiding this comment.
Thank you for your contribution @dataforxyz!
Some comments regarding the change :)
There was a problem hiding this comment.
type: 'command' was already implemented in #526.
Could you update this PR to remove this part, or do you miss anything on the current implementation?
There was a problem hiding this comment.
The workflow itself looks great, this would be a great workflow addition as a whole!
| filename: changes.md | ||
|
|
||
| - id: test_fix_loop | ||
| type: loop |
There was a problem hiding this comment.
Although this looks interesting, I think using it in practice could be a bit cumbersome.
E.g. can until refer only to 'lexical' previous steps? Or, can it access data from the last previous iteration?
It would be interesting to understand if we can get this same feature through prompting. Something along the lines of 'Fix the code so that all tests pass, or the failures are reduced. Ensure tests pass, retry this loop at most 5 times'. Would something like that work?
In that case we might not need to add a new loop building block.
| - id: fix_code | ||
| type: agent | ||
| name: 'Fix Failing Tests' | ||
| if: steps.run_tests.outputs.exit_code != 0 |
There was a problem hiding this comment.
The if building block looks great, would be a great addition!
Summary
commandstep type for running shell commands in workflows (with timeout, args, and output capture)loopstep type for iterating sub-steps until a condition is met (with configurable max iterations)steps.<id>.outputs.<name> == <value>expressionsswe-tddworkflow: a test-driven development workflow that writes tests first, then implements and iterates until tests passfindStep()method to WorkflowManager for non-throwing recursive step lookupKey changes
packages/agent/src/lib/command-runner.ts- New command step executor that runs commands throughsh -cfor proper shell handlingpackages/agent/src/lib/condition.ts- Condition evaluator for loopuntilexpressionspackages/agent/src/lib/step-executor.ts- Step dispatcher that routes agent/command/loop steps to their executorspackages/cli/src/lib/workflows/swe-tdd.yml- Full TDD workflow with test writing, implementation, test-fix loop, and code review stagespackages/schemas/src/workflow/schema.ts- Schema additions for command and loop step typespackages/core/src/files/workflow.ts-findStep()for safe recursive lookupsTest plan
🤖 Generated with Claude Code