fix(workflows): ensure workflow-builder injects $ARGUMENTS in generated YAMLs#1733
Conversation
…ed YAMLs Fixes coleam00#1535 The workflow-builder's generate-yaml node did not explicitly require generated workflows to reference $ARGUMENTS (or $USER_MESSAGE). When the AI generated single-node workflows that accept user input, it described the input in prose but omitted the $ARGUMENTS substitution variable. The harness captured the user's invocation message but never injected it into the node's conversation. Changes: - Add rule 13 to generate-yaml prompt: every workflow that accepts user input MUST reference $ARGUMENTS in at least one node prompt - Add validation warning in validate-yaml when neither $ARGUMENTS nor $USER_MESSAGE appears in the generated YAML - Regenerate bundled defaults
📝 WalkthroughWalkthroughThis PR adds a generation constraint and validation check to the ChangesWorkflow user input validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.archon/workflows/defaults/archon-workflow-builder.yaml (1)
227-229: 💤 Low valueConsider enhancing the warning message with an actionable suggestion.
The validation correctly detects missing input tokens and emits a warning without blocking the workflow. The implementation is sound. The warning message could be slightly more actionable by suggesting the fix.
💡 Optional: More actionable warning message
if ! grep -q '\$ARGUMENTS\|\$USER_MESSAGE' "$FILE"; then - echo "WARNING: workflow does not reference \$ARGUMENTS or \$USER_MESSAGE — user input will not be injected into node prompts" + echo "WARNING: workflow does not reference \$ARGUMENTS or \$USER_MESSAGE — user input will not be injected into node prompts. Consider adding '\$ARGUMENTS' to a prompt node if this workflow should accept user input." fi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.archon/workflows/defaults/archon-workflow-builder.yaml around lines 227 - 229, The current warning emitted when the grep check for '$ARGUMENTS' or '$USER_MESSAGE' on FILE fails is informative but not actionable; update the echo message inside the conditional that checks if ! grep -q '\$ARGUMENTS\|\$USER_MESSAGE' "$FILE" to include a concise remediation hint (e.g., instruct users to add $ARGUMENTS or $USER_MESSAGE into the relevant node prompt or point them to the workflow docs/example) so the message suggests how to fix the missing tokens.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.archon/workflows/defaults/archon-workflow-builder.yaml:
- Around line 227-229: The current warning emitted when the grep check for
'$ARGUMENTS' or '$USER_MESSAGE' on FILE fails is informative but not actionable;
update the echo message inside the conditional that checks if ! grep -q
'\$ARGUMENTS\|\$USER_MESSAGE' "$FILE" to include a concise remediation hint
(e.g., instruct users to add $ARGUMENTS or $USER_MESSAGE into the relevant node
prompt or point them to the workflow docs/example) so the message suggests how
to fix the missing tokens.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 603ff632-7728-4db4-ae07-8d93b3a163f9
📒 Files selected for processing (2)
.archon/workflows/defaults/archon-workflow-builder.yamlpackages/workflows/src/defaults/bundled-defaults.generated.ts
Review SummaryVerdict: ready-to-merge This PR adds a runtime validation step to the workflow builder that warns when a generated workflow may silently drop user input by omitting references to Blocking issuesNone. Suggested fixesNone. Minor / nice-to-haveNone — the implementation is clean and the soft WARNING approach (vs. hard Compliments
Reviewed via maintainer-review-pr workflow (Pi/Minimax). Aspects run: code-review. |
Summary
archon-workflow-buildergenerates single-node workflows whose prompt templates describe user input in prose but never include the$ARGUMENTSsubstitution variable. The harness captures the user's invocation message asworkflow_start.contentbut it is never injected into the node's conversation — the agent asks the user to re-provide input they already gave.$ARGUMENTS.generate-yamlprompt requiring$ARGUMENTSin generated workflows that accept user input. Added validation warning invalidate-yamlwhen the variable is missing.Closes #1535
UX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
Label Snapshot
risk: lowsize: XSworkflowsworkflows:builderChange Metadata
bugworkflowsLinked Issue
Validation Evidence (required)
$ bun run check:bundled bundled-defaults.generated.ts is up to date (36 commands, 20 workflows). $ bun run type-check All packages: Exited with code 0 $ bun run lint # lint-staged passes on commitbun run testskipped: change is prompt-only (YAML text), no TypeScript logic affected.Security Impact (required)
Compatibility / Migration
Human Verification (required)
bun run generate:bundledregenerates cleanly with the new contentSide Effects / Blast Radius (required)
archon-workflow-builderbundled default workflow$ARGUMENTSeven in workflows that don't need user input — but since rule 13 says "that accepts user input", the AI should discriminate correctlyRollback Plan (required)
bun run generate:bundledRisks and Mitigations
$ARGUMENTSinto workflows that purely scan without user input$ARGUMENTSreferenceSummary by CodeRabbit