Skip to content

Conversation

@jsibbison-square
Copy link
Contributor

@jsibbison-square jsibbison-square commented Jul 4, 2025

The gui recipes (ones saved in recipe library) have a nested yaml structure where the actual recipe is under a recipe key. This PR enables the cli to handle this when loading a recipe.

standard format:

id: untitled
name: Untitled Recipe
title: asd
description: sdfsdf
instructions: All numbers must be in roman numerals
activities:
  - Start a new task
  - Ask for help
  - Explore available tools
  - Begin coding project
  - Request assistance
prompt: "What's 2+2"
extensions: []

gui format

name: asd2
recipe:
  id: untitled
  name: Untitled Recipe
  title: asd
  description: sdfsdf
  instructions: All numbers must be in roman numerals
  activities:
    - Start a new task
    - Ask for help
    - Explore available tools
    - Begin coding project
    - Request assistance
  prompt: "What's 2+2"
  extensions: []
isGlobal: true
lastModified: 2025-07-02T03:46:46.778Z
isArchived: false

@lifeizhou-ap
Copy link
Collaborator

lifeizhou-ap commented Jul 4, 2025

I am just thinking one step back. Why do we have different structures for recipe yaml file? Shall we make them identical?

Accept different structure as it may ends with multiple version of recipe file schemas and it will be hard to manage and maintain.

Shall we fix this on the GUI to make the schema consistent?

@DOsinga
Copy link
Collaborator

DOsinga commented Jul 4, 2025

I agree w @lifeizhou-ap that this seems weird that we would have two formats. And these have a name in the root and then in the recipe another name and a title?

Ok(serde_json::from_str(content)?)
} else if serde_yaml::from_str::<serde_yaml::Value>(content).is_ok() {
Ok(serde_yaml::from_str(content)?)
if let Ok(json_value) = serde_json::from_str::<serde_json::Value>(content) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm - @lifeizhou-ap does looks like we reverted the code to trying both json and yaml again. why is that? every json file is also a yaml file, so we shouldn't need to do this twice here

Copy link
Collaborator

Choose a reason for hiding this comment

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

 if serde_json::from_str::<serde_json::Value>(content).is_ok() {
            Ok(serde_json::from_str(content)?)
        } else if serde_yaml::from_str::<serde_yaml::Value>(content).is_ok() {
            Ok(serde_yaml::from_str(content)?)

yes, that was me. It was missed out during a refactoring a while ago. will update in another PR

@DOsinga
Copy link
Collaborator

DOsinga commented Jul 4, 2025

Looks like this is where this happened:
https://github.com/block/goose/pull/2946/files

@jsibbison-square
Copy link
Contributor Author

We will look to separate the storage of recipe and recipe library metadata so recipes are the same in gui and cli.

@DOsinga
Copy link
Collaborator

DOsinga commented Jul 5, 2025

eh, I don't know - we already merged the other thing so even if we fix it there, we might still want to have this in for at least a while... Also thanks for spotting this!

@DOsinga
Copy link
Collaborator

DOsinga commented Jul 5, 2025

I mean

@DOsinga DOsinga reopened this Jul 5, 2025
@jsibbison-square
Copy link
Contributor Author

Alright let me get a passing build and I'll merge it

@DOsinga
Copy link
Collaborator

DOsinga commented Jul 7, 2025

Thanks!

@jsibbison-square jsibbison-square merged commit 991e3a9 into main Jul 7, 2025
16 of 17 checks passed
@jsibbison-square jsibbison-square deleted the jsibbison-20250704-recipes-cli-handle-gui-version branch July 7, 2025 08:56
dianed-square added a commit to dianed-square/goose that referenced this pull request Jul 8, 2025
* update-to-v1.0.35: (57 commits)
  chore(release): release version 1.0.35 (block#3292)
  docs: enhanced code editing topic (block#3287)
  fix cu (block#3291)
  feat: Add environment variables to override model context limits (block#3260)
  chore(release): release version 1.0.34 (block#3285)
  fix(devcontainer): install protoc to fix build (block#3267)
  Enabling npx command to install on Windows Desktop (block#3283)
  Fix: Allow native Cmd+Up/Down cursor movement when user has typed text (block#3246)
  chore(release): release version 1.0.33 (block#3284)
  fix Windows Env Vars (block#3282)
  feat: bedrock image content support (block#3266)
  Add support in goose configure for streaming http mcp tools (block#3256)
  docs: add Alby MCP tutorial (block#3217)
  refactor(tests): make logging test in goose-cli less flaky on macos (block#3273)
  feat: cli can work with gui generated recipes (block#3254)
  Goose projects docs (block#3272)
  feat: add support for 'cu' command in extension installation (block#3261)
  Docs: Add cloudinary mcp tutorial (block#3268)
  fix: Enable agent to see instruction to use final output tool when it wasn't called (block#3253)
  Use command line to run sub agent and sub recipe (in sequence or parallel) (block#3190)
  ...
GaryZhous pushed a commit to GaryZhous/goose that referenced this pull request Jul 9, 2025
atarantino pushed a commit to atarantino/goose that referenced this pull request Jul 14, 2025
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
kwsantiago pushed a commit to kwsantiago/goose that referenced this pull request Jul 19, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
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.

5 participants