Skip to content

Conversation

@lifeizhou-ap
Copy link
Collaborator

@lifeizhou-ap lifeizhou-ap commented Jul 22, 2025

Why
This is a temporary implementation to get sub recipe working in Desktop as some of our users would like to use it in the Desktop

What

  • Added the route /agent/add_sub_recipes to add subrecipe tools to agent
  • Client calls the /agent/add_sub_recipes
    • when initialising the system for recipe without params
    • when updating parameters after users enters the parameters
  • Move the strip_ansi_codes to agent package instead of goose-cli so that the sub_agent_execution_tool tool result does not contain the ansi_codes from the goose run --recipe subrecipe cli output

Limitation

  • This requires users to install goose cli as we still use the goose cli to run the sub recipe
  • The subrecipe path has to be fully path
  • We still rely the on the client side to parse the recipe and load the recipe so the the retry does not work.

What needs to do properly

  • Build the routes in server side to encapsulate the recipe logic from client side
  • Switch the client side to user these routes

* main: (28 commits)
  fix: multi-tool calls in streamed openai-compatible responses (#3609)
  feat: subagent turn count, simple agent loop (#3597)
  feat: subagent independent extension manager (#3596)
  Improve session history loading resiliency (#3588)
  Added logging and changed default route case to not redirect to home when there is an invalid route (#3610)
  fix: chat sidebar layout overlapping content occasionally (#3590)
  fix: loading shared sessions (#3607)
  docs: use installer component for tutorial, add updating extensions section (#3608)
  fix: show token alert popover during agent responses and agent failure cases (#3536)
  reuse the cancellation token in the agent level (#3599)
  Docs: Move MongoDB tutorial to MCP section (#3602)
  docs: desktop recipe format (#3594)
  Fix model display name not being updated immediately after leaving settings (#3587)
  Added option to summarize the chat when an error is triggered (#3598)
  Remove mcp_macros and unused types (#3581)
  fix: add fallback id to messages if none provided (#3584)
  feat: migrate ErrorData from internal mcp crates to rmcp version (#3586)
  fix: adjust subrecipe description to allow running tests (#3585)
  Scenario tests (#3430)
  feat: migrate JsonRpcMessage/Request/Response/Error/Notification from internal mcp crates to rmcp versions (#3564)
  ...
@lifeizhou-ap lifeizhou-ap marked this pull request as ready for review July 24, 2025 06:10
truncate_with_ellipsis(&clean_output, OUTPUT_PREVIEW_LENGTH)
}

fn truncate_with_ellipsis(text: &str, max_len: usize) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is wrong by the way, we should use use goose::utils::safe_truncate;

}
}

fn strip_ansi_codes(text: &str) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe move this to utils?

import { SubRecipe } from '../api';
import { getApiUrl, getSecretKey } from '../config';

export async function addSubRecipes(subRecipes: SubRecipe[]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

eh, shouldn't this be generated code through our openapi thing?

if (subRecipes && subRecipes?.length > 0) {
for (const subRecipe of subRecipes) {
if (subRecipe.values) {
// Iterate over each key in subRecipe.values and substitute parameters
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the comment

@lifeizhou-ap lifeizhou-ap merged commit e682940 into main Jul 24, 2025
8 checks passed
@lifeizhou-ap lifeizhou-ap deleted the lifei/sub-recipe-desktop-temp branch July 24, 2025 13:37
katzdave added a commit that referenced this pull request Jul 24, 2025
* 'main' of github.com:block/goose:
  Adds the `WaitingForUserInput` state (#3620)
  docs: update extensions library (#3612)
  Fixing grants path (#3632)
  docs: June 2024 Community All-Stars Spotlight (#3631)
  grant program (#3630)
  Lifei/sub recipe desktop temp (#3576)
  docs: local LLMs context size tip (#3454)
  fix: Handle non-default base path for OpenAI compatible model fetching (#3566)
  Goose security updates (#3579)
  fix: multi-tool calls in streamed openai-compatible responses (#3609)
  feat: subagent turn count, simple agent loop (#3597)
  feat: subagent independent extension manager (#3596)
  Improve session history loading resiliency (#3588)
  Added logging and changed default route case to not redirect to home when there is an invalid route (#3610)
  fix: chat sidebar layout overlapping content occasionally (#3590)
  fix: loading shared sessions (#3607)
lifeizhou-ap added a commit that referenced this pull request Jul 25, 2025
* main:
  docs: Quick spotlight fix (#3633)
  alexhancock/rmcp-tools-annotations (#3617)
  fix: clean up subagent (#3565)
  Adds the `WaitingForUserInput` state (#3620)
  docs: update extensions library (#3612)
  Fixing grants path (#3632)
  docs: June 2024 Community All-Stars Spotlight (#3631)
  grant program (#3630)
  Lifei/sub recipe desktop temp (#3576)
atarantino pushed a commit to atarantino/goose that referenced this pull request Aug 5, 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.

3 participants