Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions crates/goose-cli/src/session/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,19 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> Session {

// Create the agent
let agent: Agent = Agent::new();
let new_provider = create(&provider_name, model_config).unwrap();

let new_provider = match create(&provider_name, model_config) {
Ok(provider) => provider,
Err(e) => {
output::render_error(&format!(
"Error {}.\n\
Please check your system keychain and run 'goose configure' again.\n\
If your system is unable to use the keyring, please try setting secret key(s) via environment variables.\n\
Copy link
Contributor

Choose a reason for hiding this comment

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

can we check the error here? the error may not be related to keyring

Copy link
Contributor Author

@GaryZhous GaryZhous Jun 13, 2025

Choose a reason for hiding this comment

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

If you go the goose doc link I attached in the PR description, you can see the error I got when I ran goose session without api key configured as an ent variable is the same as what they mentioned in the doc.
image
It is just that the actual error message is fuzzier than what it is supposed to be.

For more info, see: https://block.github.io/goose/docs/troubleshooting/#keychainkeyring-errors",
e
));
process::exit(1);
}
};
// Keep a reference to the provider for display_session_info
let provider_for_display = Arc::clone(&new_provider);

Expand Down
Loading