Skip to content

feat: add auto submit for recipes that have been accepted#6325

Merged
zanesq merged 9 commits intoblock:mainfrom
Abhijay007:feat/autoSubmit
Feb 24, 2026
Merged

feat: add auto submit for recipes that have been accepted#6325
zanesq merged 9 commits intoblock:mainfrom
Abhijay007:feat/autoSubmit

Conversation

@Abhijay007
Copy link
Copy Markdown
Collaborator

@Abhijay007 Abhijay007 commented Jan 4, 2026

closes #6087

PR description

This PR adds auto-submit functionality for recipes that have been accepted, allowing recipe prompts to be automatically submitted when a session is opened with a recipe but no existing messages.

Type of Change

  • Feature

AI Assistance

  • This PR was created or reviewed with AI assistance, used Copilot for the PR description, and Goose for the change

Testing

Tested in the desktop UI on Windows with recipes that have a prompt

Screenshots/Demos (for UX changes)

Before:
autoSubmitBefore

After:

autoSubmitafter

Copilot AI review requested due to automatic review settings January 4, 2026 18:01
@Abhijay007 Abhijay007 marked this pull request as draft January 4, 2026 18:01
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

This PR adds auto-submit functionality for recipes that have been accepted, allowing recipe prompts to be automatically submitted when a session is opened with a recipe but no existing messages.

Key changes:

  • Added autoSubmit prop that flows from Pair.tsx through BaseChat.tsx to ChatInput.tsx
  • Implemented logic to determine when auto-submission should occur based on recipe presence and conversation state
  • Added useEffect in ChatInput to trigger submission when autoSubmit is true

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ui/desktop/src/components/Pair.tsx Added useChatStream hook and logic to calculate shouldAutoSubmit based on recipe and message state
ui/desktop/src/components/BaseChat.tsx Added autoSubmit prop to component signature and passed it to ChatInput; moved recipe variable declaration earlier
ui/desktop/src/components/ChatInput.tsx Added autoSubmit prop and useEffect to automatically submit initialValue when autoSubmit is true
ui/desktop/src/components/Hub.tsx Explicitly set autoSubmit={false} to maintain existing Hub behavior

@Abhijay007 Abhijay007 marked this pull request as ready for review January 7, 2026 15:50
Copilot AI review requested due to automatic review settings January 7, 2026 15:50
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@taniacryptid
Copy link
Copy Markdown
Collaborator

Thank you for working on this and the other PRs! Tagging @block/goose-maintainers @block/goose-core-maintainers for each to have a look ❤️

Copilot AI review requested due to automatic review settings January 12, 2026 11:11
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

@zanesq zanesq left a comment

Choose a reason for hiding this comment

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

Question about the logic: should this only auto submit if there is an initial prompt in the recipe?

Took it for a spin and noticed a couple usability issues:

  1. The recipe starts running behind the scenes before the param form is filled in, it shouldn't auto submit until the parameters are filled in if there are parameters in the recipe. Note the recipe is running in the screenshot below behind the param form.
Screenshot 2026-01-12 at 8 27 45 AM
  1. I noticed its flashing the accept recipe notice for recipes that have already been accepted and its not happening on main with the same recipe (see attached video, also attached the recipe file)

custom-recipe-from-chat.yaml

Kapture.2026-01-12.at.08.36.52.mp4

@zanesq
Copy link
Copy Markdown
Contributor

zanesq commented Jan 12, 2026

@Abhijay007 appreciate you taking this on.. after looking at this more the current approach feels overcomplex and brittle. I think we might want to rewrite this rather than tacking on more logic. Do you have any ideas to make this better keeping in mind that auto submit from hub is also brittle? It's ok if we decide to punt on this for now and we can come back to it later when we do an upcoming rewrite.

@Abhijay007
Copy link
Copy Markdown
Collaborator Author

@Abhijay007 appreciate you taking this on.. after looking at this more the current approach feels overcomplex and brittle. I think we might want to rewrite this rather than tacking on more logic. Do you have any ideas to make this better keeping in mind that auto submit from hub is also brittle? It's ok if we decide to punt on this for now and we can come back to it later when we do an upcoming rewrite.

I will look into that and share how we can improve this

@zanesq
Copy link
Copy Markdown
Contributor

zanesq commented Jan 26, 2026

hi @Abhijay007 checking if you still want to work on this or should we close it?

@Abhijay007
Copy link
Copy Markdown
Collaborator Author

Hi @zanesq I will push changes soon am just got occupied I bit I will try to resolve few of my PRs tomorrow

@DOsinga
Copy link
Copy Markdown
Collaborator

DOsinga commented Feb 11, 2026

also this @Abhijay007 - if it is too much everything, just let us know and we can find a hand-off appreciate all the work

Copilot AI review requested due to automatic review settings February 18, 2026 10:54
@Abhijay007 Abhijay007 marked this pull request as draft February 18, 2026 10:57
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

I don't think this is the right approach. we now have 4 scenario's for useAutoSubmit? and it has two extra parameters derived from the recipe state but then does an extra recipe substitution? we need to rethink this instead of making this more complicated

Copilot AI review requested due to automatic review settings February 18, 2026 13:57
@Abhijay007
Copy link
Copy Markdown
Collaborator Author

I don't think this is the right approach. we now have 4 scenario's for useAutoSubmit? and it has two extra parameters derived from the recipe state but then does an extra recipe substitution? we need to rethink this instead of making this more complicated

Hi @DOsinga I tried to simplify the auto-submit implementation based on your feedback. Instead of adding a 4th scenario with extra parameters, I made RecipesView pass the recipe prompt as initialMessage (just like Hub does), which automatically works with existing Scenario 1.

also added a parameter check to Scenario 1 to prevent auto-submit before params are filled. This removes all the complexity that you mentioned, while still addressing all three issues: only auto-submits if recipe has a prompt, waits for parameters to be filled, and no flashing accept modal.

@Abhijay007 Abhijay007 requested a review from DOsinga February 18, 2026 13:58
setView('pair', {
disableAnimation: true,
resumeSessionId: session.id,
initialMessage: recipe.prompt ? { msg: recipe.prompt, images: [] } : undefined,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Passing the recipe prompt as initialMessage so it auto-submits using the existing Scenario 1 logic (same pattern as Hub) for ref see ui/desktop/src/components/Hub.tsx:63-67 where Hub does the same thing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, I understand. ?:undefined === ?? is what I meant

hasAutoSubmittedRef.current = true;
handleSubmit({ msg: '', images: [] });
}
return;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this code is duplicated and I think it belongs in the caller

Copy link
Copy Markdown
Collaborator Author

@Abhijay007 Abhijay007 Feb 18, 2026

Choose a reason for hiding this comment

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

yea, I will extract the parameter checking logic into a hasUnfilledParameters helper function to remove duplication between Scenario 1 and 3

Copy link
Copy Markdown
Collaborator Author

@Abhijay007 Abhijay007 Feb 18, 2026

Choose a reason for hiding this comment

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

Wait, did you mean removing scenario 3?

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Abhijay007 Abhijay007 added this pull request to the merge queue Feb 24, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@Abhijay007 Abhijay007 added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@zanesq zanesq merged commit a6e9ba6 into block:main Feb 24, 2026
20 checks passed
u35tpus pushed a commit to u35tpus/goose that referenced this pull request Feb 26, 2026
blackgirlbytes added a commit that referenced this pull request Mar 4, 2026
Update the 'Use Recipe' Desktop instructions to reflect the auto-submit
change from PR #6325. Recipes now automatically submit and begin
execution after acceptance, removing the need for users to manually
click an activity bubble or send the prompt.
blackgirlbytes added a commit that referenced this pull request Mar 4, 2026
Update the 'Use Recipe' Desktop instructions to reflect the auto-submit
change from PR #6325. Recipes now automatically submit and begin
execution after acceptance, removing the need for users to manually
click an activity bubble or send the prompt.
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.

Add auto submit for recipes that have been accepted

6 participants