Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support markdown plans #79

Merged
merged 2 commits into from
Sep 20, 2024
Merged

feat: support markdown plans #79

merged 2 commits into from
Sep 20, 2024

Conversation

elenazherdeva
Copy link
Collaborator

@elenazherdeva elenazherdeva commented Sep 19, 2024

Supported Markdown plans, made them Jinja-templated, and allowed passing parameters.

The plan.md file can be in a free format, but the last group of lines that start with “-” is considered the plan.

Some examples:

Example 1:

# plan.md

Here is the python repo

-use {{ dep }}
-use poetry

Here is a plan:

- Open a file
- Run a test
- Setup {{ repo }}

the plan is:

- Open a file
- Run a test
- Setup {{ repo }}

Example 2:

Here is the python repo.

You should follow these steps:

- Open a file
- Run a test
- Setup {{ repo }}

the plan is:

- Open a file
- Run a test
- Setup {{ repo }}

To start a session with a plan:

goose session planned --plan plan.md --args arg1:value1,arg2:value2

@elenazherdeva
Copy link
Collaborator Author

should we get rid of plan.yaml in the goose session start command?



def test_parse_plan_simple():
plan_str = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

just curious: is this our recommended style for multiline strings? what are the trade offs for this over triple-quoted multiline strings or even keeping the markdown as a fixture?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be honest, I did it to pass the ruff checks. Not sure if we've discussed it before

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

I like this myself - but would want to see others sure as it kind of is a UX/api change (not that plans are well known). I guess main benefit of yaml is if you had a tool emitting it etc for goose to consume

@lily-de
Copy link
Collaborator

lily-de commented Sep 19, 2024

do we have to use - or will it also pick up * ? because i tend to use * and I think we should be very explicit to users writing their own plans if a certain formatting is needed. We should also add a page in the docs for custom plans -- I don't think I added one

@elenazherdeva
Copy link
Collaborator Author

yes @lily-de I agree, we should mention it in the docs somehow, because now only the last group of lines that start with “-” is considered the plan

Copy link
Contributor

@lukealvoeiro lukealvoeiro left a comment

Choose a reason for hiding this comment

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

LGTM! Some small nits, nothing blocking

Comment on lines 93 to 94
@click.option("--plan", type=click.Path(exists=True))
@click.option("-p", "--params", callback=parse_params, help="Parameters in the format param1:value1,param2:value2")
Copy link
Contributor

Choose a reason for hiding this comment

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

i can see -p being confusing for plan and params... maybe -a/--args instead? up to you tho!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, makes sense! agree

"-Run a test\n\n"
"Now actually follow the steps:"
),
"tasks": ["-Step1", "-Step2"],
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit/maybe not even applicable]should we be stripping - from the tasks? Just wondering because if someone happens to type in a plan:

-1:do this 
-2:do that

then that could be inferred as negative numbers which maybe would change the order of events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree!

@elenazherdeva elenazherdeva merged commit 3615a35 into main Sep 20, 2024
2 checks passed
Kvadratni added a commit to Kvadratni/goose that referenced this pull request Sep 23, 2024
* origin/main:
  docs: add in ollama (block#82)
  chore: add just command for releasing goose (block#55)
  feat: support markdown plans  (block#79)
  feat: add version options (block#74)
  docs: fixing exchange url to public version (block#67)
  docs: Update CONTRIBUTING.md (block#69)
  chore: create mkdocs for goose (block#70)
  docs: fix broken link (block#71)
  feat: give commands the ability to execute logic (block#63)
  feat: jira toolkit (block#59)
  feat: run goose in a docker-style sandbox (block#44)
lily-de pushed a commit that referenced this pull request Oct 7, 2024
@lamchau lamchau deleted the ez/plan branch October 24, 2024 11:45
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