Skip to content

feat(cli): auto-resolve queueable step when --step omitted#88

Merged
chubes4 merged 2 commits into
Extra-Chill:mainfrom
saraichinwag:feat/auto-resolve-queue-step
Feb 3, 2026
Merged

feat(cli): auto-resolve queueable step when --step omitted#88
chubes4 merged 2 commits into
Extra-Chill:mainfrom
saraichinwag:feat/auto-resolve-queue-step

Conversation

@saraichinwag
Copy link
Copy Markdown
Contributor

Summary

Fixes #82 - Simplify queue CLI for single-step flows

Before

wp datamachine flows queue add 29 --step=12_e5eda239-5bd7-4ae6-89f1-e21909115c98_29 "My prompt"

After

wp datamachine flows queue add 29 "My prompt"

How It Works

Added resolveQueueableStep() helper that:

  1. Queries flow_config from database
  2. Finds all steps with queue_enabled=true
  3. If exactly 1 → returns that step_id
  4. If 0 → returns error: "Flow X has no queueable steps"
  5. If multiple → returns error listing step IDs

Methods Updated

  • queueAdd
  • queueList
  • queueClear
  • queueRemove
  • queueUpdate
  • queueMove

Testing

Tested locally on Flow 29 (single queueable AI step):

$ wp datamachine flows queue list 29
Total: 28 prompt(s) in queue. (queue_enabled: yes)

$ wp datamachine flows queue add 29 "Test prompt"
Success: Prompt added to queue. Queue now has 29 item(s).

Backward Compatibility

--step flag still works when provided, enabling explicit step selection for flows with multiple queueable steps.

Fixes Extra-Chill#82.

When a flow has exactly one step with queue_enabled=true, the CLI
queue commands now auto-detect it:

  wp datamachine flows queue add 29 "My prompt"
  wp datamachine flows queue list 29

The --step flag is still required when:
- Flow has no queueable steps (error with guidance)
- Flow has multiple queueable steps (error lists step IDs)

Affects: queueAdd, queueList, queueClear, queueRemove, queueUpdate, queueMove
Copy link
Copy Markdown
Member

@chubes4 chubes4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main logic looks good and the auto-resolve behavior is sensible. One request: please update the CLI usage strings and examples in FlowsCommand so they no longer imply --step is required for queue add/list/clear/remove/update/move. Right now multiple error/usage messages still hard-require --step, which conflicts with the new auto-resolve path.

- Updated --step parameter description to note auto-resolution
- Simplified examples to show --step as optional
- Added example showing explicit --step for multiple queueable steps
@saraichinwag
Copy link
Copy Markdown
Contributor Author

Updated CLI usage strings (2758f2e3):

  • Parameter description now mentions auto-resolution when flow has exactly one queueable step
  • Examples simplified to show --step as optional
  • Added explicit example showing when --step is required (multiple queueable steps)

Ready for re-review.

Copy link
Copy Markdown
Member

@chubes4 chubes4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good. Usage text now matches the auto-resolve behavior and includes an explicit --step example for multi-queue flows. Approving.

@chubes4 chubes4 merged commit eabd6d4 into Extra-Chill:main Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify queue CLI for single-step flows

2 participants