Assistant: Improves AWS SSO refresh flow #10617
Open
+218
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assistant now intercepts errors related to expired AWS Bedrock credentials, and prompts the user to refresh them. It provides an affordance on the error notification to automatically run

aws sso refresh, which opens the browser and starts the flow. It also returns Positron to the foreground once the refresh is complete.Addresses #9652
Release Notes
New Features
awsCLI tool.Bug Fixes
QA Notes
To "expire" your token:
~/.aws/sso/cache/[key].json. I identified it as the most recently updated file in that directory.expiresAtandregistrationExpiresAtto dates prior to present, and changeaccessTokenandrefreshTokenrandomly (I removed the first character).Cases to test
Adding Bedrock model
Expire your token, then signin to Bedrock in the Configure Model Providers dialog. This should trigger the refresh flow automatically.
Starting Positron with a Bedrock provider added
Expire your token, then refresh Positron. You should receive a notification to refresh credential. Clicking the button will launch the refresh flow in browser.
Token expires while Positron is open
Expire your token, then try to send a message. You will receive an error in chat, and the notification to prompt refresh. Note: Token credentials are cached in memory, so simply changing on disk is not sufficient. We may need to expire the token within AWS itself to test this properly. In dev, I created a command (removed from PR) to refresh the AWS token from disk.
e2e: @:assistant