Skip to content

fix: improve configure process with error message#919

Merged
yingjiehe-xyz merged 6 commits intomainfrom
yingjiehe/config
Jan 30, 2025
Merged

fix: improve configure process with error message#919
yingjiehe-xyz merged 6 commits intomainfrom
yingjiehe/config

Conversation

@yingjiehe-xyz
Copy link
Copy Markdown
Contributor

@yingjiehe-xyz yingjiehe-xyz commented Jan 29, 2025

Show error message during configuration.

Test:

image

Copy link
Copy Markdown
Contributor

@kalvinnchau kalvinnchau left a comment

Choose a reason for hiding this comment

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

can we make this a nicer message when tools aren't supported? not sure if its possible to capture all variations from providers but would be nice for the user if it was:

The selected model: registry.ollama.ai/library/gemma2:2b does not support tool calling, please select a model that has tool support.

Instead of:
RequestFailed("Request failed with status: 400 Bad Request, message: registry.ollama.ai/library/gemma2:2b does not support tools")

we could handle the tool case in one arm, and just print other failures as we normally do

@yingjiehe-xyz
Copy link
Copy Markdown
Contributor Author

can we make this a nicer message when tools aren't supported? not sure if its possible to capture all variations from providers but would be nice for the user if it was:

The selected model: registry.ollama.ai/library/gemma2:2b does not support tool calling, please select a model that has tool support.

Instead of:
RequestFailed("Request failed with status: 400 Bad Request, message: registry.ollama.ai/library/gemma2:2b does not support tools")

we could handle the tool case in one arm, and just print other failures as we normally do

The reason I use the error message directly is: 1. it is kind of hard to capture all variations for tool not support error as like ollama example, they may not have the associated error code; 2. The original error message can help the user to debug more easily, just copy paste the error message to Google and search for it, hope that sounds good to you

@salman1993
Copy link
Copy Markdown
Contributor

nit: we can remove the outer RequestFailed( from the error msg output

@yingjiehe-xyz
Copy link
Copy Markdown
Contributor Author

nit: we can remove the outer RequestFailed( from the error msg output

Thanks, done

Err(e) => {
println!("{:?}", e);
spin.stop("We could not connect!");
println!("{}", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i tried using cliclack::log::error(e.to_string()); and there is a red dot, not sure if its easier to tell if its an error or not.

Screenshot 2025-01-29 at 11 27 21 PM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

        Err(e) => {
            spin.stop(style( e.to_string()).red());
            cliclack::outro(style("Failed to configure provider: chat completion request with tool did not succeed.").on_red().white())?;
            Ok(false)
        }

Screenshot 2025-01-29 at 11 34 40 PM

i kinda like this one, what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nice! good to know such utils! Updated it

@yingjiehe-xyz yingjiehe-xyz merged commit a420e20 into main Jan 30, 2025
@yingjiehe-xyz yingjiehe-xyz deleted the yingjiehe/config branch January 30, 2025 04:45
salman1993 added a commit that referenced this pull request Jan 30, 2025
* origin/main:
  fix: clarify linux cli install only (#927)
  feat: update ui for ollama host (#912)
  feat: add CONFIGURE=false option in install script (#920)
  fix: truncation agent token calculations (#915)
  fix: request payload for o1 models (#921)
  Update SupportedEnvironments.js so others don't get confused on why they can not open the macos app on x86 (#888)
  fix: improve configure process with error message (#919)
  docs: Goose on Windows via WSL (#901)
  fix: more graceful handling of missing usage in provider response (#907)
  feat: rm uv.lock cause it points to square artifactory (#917)
  feat: Update issue templates for bug report for goose (#913)
  fix: post endpoint url on sse endpoint event (#900)
michaelneale added a commit that referenced this pull request Jan 31, 2025
* main: (28 commits)
  ci: per semver build metadata should be after + (#971)
  fix: temp fix to make CI workflow pass (#970)
  chore: bump patch version to 1.0.3 (#967)
  fix: load shell automatically from env for GUI (#948)
  fix: update versions in release and canary workflows (#911)
  docs: fix typo, name (#963)
  docs: typo fix (#961)
  chore: remove gpt-3.5-turbo UI suggestion, as it is deprecated (#959)
  chore: remove o1-mini suggestion from UI add model view (#957)
  fix: missing field in request (#956)
  docs: update provider docs, fix rate limit link (#943)
  fix: clarify linux cli install only (#927)
  feat: update ui for ollama host (#912)
  feat: add CONFIGURE=false option in install script (#920)
  fix: truncation agent token calculations (#915)
  fix: request payload for o1 models (#921)
  Update SupportedEnvironments.js so others don't get confused on why they can not open the macos app on x86 (#888)
  fix: improve configure process with error message (#919)
  docs: Goose on Windows via WSL (#901)
  fix: more graceful handling of missing usage in provider response (#907)
  ...
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.

3 participants