close
Skip to content

fix(goose): declare args parameter in generated recipes#2402

Open
natelastname wants to merge 1 commit intogithub:mainfrom
natelastname:fix/goose-args-parameter
Open

fix(goose): declare args parameter in generated recipes#2402
natelastname wants to merge 1 commit intogithub:mainfrom
natelastname:fix/goose-args-parameter

Conversation

@natelastname
Copy link
Copy Markdown

Description

Fixes an issue in the Goose integration where generated recipes include {{args}} in the prompt but do not declare a corresponding args parameter.

This causes goose recipe validate to fail with:

Missing definitions for parameters in the recipe file: args.

The fix overrides _render_yaml in GooseIntegration to include a parameters section declaring the args parameter, ensuring all generated recipes are valid.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync --extra test && uv run pytest
  • Tested with a sample project (generated recipes and validated all with goose recipe validate)

AI Disclosure

  • I did use AI assistance (describe below)

Consulted ChatGPT to reason through the root cause and propose an implementation approach. Final code and validation were done manually.

@natelastname natelastname requested a review from mnriem as a code owner April 29, 2026 01:24
Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

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

Can you add some positive and negative tests?

@natelastname
Copy link
Copy Markdown
Author

natelastname commented Apr 29, 2026

Can you add some positive and negative tests?

Sure, please let me know if there's anything else I can do.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Goose YAML recipe generation so recipes that include {{args}} also declare an args parameter, preventing goose recipe validate failures.

Changes:

  • Override GooseIntegration._render_yaml to emit a parameters section declaring args.
  • Add integration tests asserting generated Goose recipes declare args when {{args}} appears in the prompt.
  • Add a control test confirming the base YamlIntegration renderer does not declare parameters.
Show a summary per file
File Description
src/specify_cli/integrations/goose/__init__.py Adds Goose-specific YAML rendering that includes an args parameter definition.
tests/integrations/test_integration_goose.py Adds tests verifying the new Goose renderer behavior and documenting the base renderer behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +3 to +4
import re

@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented Apr 29, 2026

Please address Copilot feedback

@natelastname natelastname force-pushed the fix/goose-args-parameter branch from 87641b3 to 5cbe958 Compare April 29, 2026 23:21
@natelastname
Copy link
Copy Markdown
Author

Please address Copilot feedback

I just edited my previous commit to remove the unused import.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Goose integration YAML recipe generation so recipes that reference {{args}} declare a corresponding args parameter, preventing goose recipe validate failures.

Changes:

  • Override GooseIntegration._render_yaml to emit a parameters section containing an args parameter.
  • Add Goose-specific tests to ensure generated recipes that contain {{args}} include an args parameter declaration.
Show a summary per file
File Description
src/specify_cli/integrations/goose/__init__.py Overrides YAML rendering to include an args parameter in the recipe header.
tests/integrations/test_integration_goose.py Adds regression tests for args parameter declaration behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment thread tests/integrations/test_integration_goose.py Outdated
Comment thread tests/integrations/test_integration_goose.py
Comment thread src/specify_cli/integrations/goose/__init__.py Outdated
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 1, 2026

Please address Copilot feedback. If not applicable, please explain why

@natelastname natelastname force-pushed the fix/goose-args-parameter branch from 5cbe958 to ef16b21 Compare May 2, 2026 23:37
@natelastname
Copy link
Copy Markdown
Author

Please address Copilot feedback. If not applicable, please explain why

Ok, done

@natelastname
Copy link
Copy Markdown
Author

I added an additional check to ensure the ACP “Running recipe” notification only fires when the mapped recipe path actually exists, which brings it in line with the current behavior in execute_command (where a missing file results in Ok(None) and no execution).

Longer term, it might be worth introducing a dedicated event type in the agent.reply stream (e.g., RecipeStarted or CommandStarted). That would allow integrations built on top of agent.reply (e.g., ACP, the HTTP server, CLI) to react to command execution in a consistent and reliable way, rather than needing to duplicate execution heuristics on the caller side.

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.

3 participants