Skip to content

fix(use_aws): stop defaulting profile_name to 'default'#3735

Open
sandikodev wants to merge 1 commit intoaws:mainfrom
sandikodev:fix/use-aws-default-profile
Open

fix(use_aws): stop defaulting profile_name to 'default'#3735
sandikodev wants to merge 1 commit intoaws:mainfrom
sandikodev:fix/use-aws-default-profile

Conversation

@sandikodev
Copy link
Copy Markdown

Issue

Closes #1045

Problem

When a user has no AWS profile named default, the use_aws tool fails with:

Unable to locate credentials. You can configure credentials by running "aws configure".

This happens because:

  1. The profile_name field description says "Defaults to default profile if not specified" — the model reads this and always fills in profile_name: "default"
  2. All 13 tool examples in use_aws.rs hardcode "profile_name": "default", reinforcing this behavior

The invoke logic already handles None correctly — when profile_name is None, no --profile flag is passed and the AWS default credential chain is used. The bug is entirely in the tool description and examples.

Fix

  1. Update profile_name description to clarify it should only be set when the user explicitly names a profile:

    "Only specify if the user explicitly mentions a profile name. If omitted, the AWS default credential chain is used (environment variables, instance profile, etc)."

  2. Remove "profile_name": "default" from all tool examples so the model does not learn to always include it.

No runtime code change needed.

Testing

cargo test -p chat_cli

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When no AWS profile named 'default' exists, the use_aws tool fails with
'Unable to locate credentials' because the model always fills in
profile_name: "default" based on the tool description and examples.

Two changes:
1. Update profile_name description to clarify it should only be set
   when the user explicitly names a profile — otherwise the AWS default
   credential chain (env vars, instance profile, etc) should be used.
2. Remove hardcoded profile_name: "default" from all tool examples so
   the model does not learn to always include it.

The invoke logic already handles None correctly (no --profile flag is
passed), so no runtime change is needed.

Fixes aws#1045
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.

set default aws cli profile for q cli to use

1 participant