Skip to content

Recipe slash command doesn't work with single optional parameter #6232

@stesie

Description

@stesie

Describe the bug

A recipe with a single optional param, cannot be invoked as slash command without given the param.


To Reproduce

Given a recipe with a single optional parameter, like this:

version: "1.0.0"    
title: "Flyway Migration Optimizer"    
description: "Optimize the SQL code for Flyway database migrations."    
parameters:    
  - key: filename    
    input_type: string    
    requirement: optional    
    description: "Name of file to optimize. Leave empty to automatically pick latest file."                                                                                                    
    default: "No filename was provided by the user."    
instructions: |    
  [...]
prompt: |    
  [...]

Given a slash command mapping in config.yaml

slash_commands:
  - command: flyway-optimize
    recipe_path: /home/stesie/.local/share/goose/recipes/flyway-optimize.yaml

When running just /flyway-optimize

Then it shows the error Recipe requires 1 parameter(s): filename. Provided: 0


Expected behavior

Instead of showing the error, I would expect the default value to be used.


Please provide the following information

  • OS & Arch: Arch Linux
  • Interface: CLI
  • Version: 1.18.0
  • Extensions enabled: Developer
  • Provider & Model: Haiku 4.5

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions