Fix AuthProfile deserialization for social login profiles#3704
Open
Fix AuthProfile deserialization for social login profiles#3704
Conversation
The wrapper binary writes the auth profile with camelCase field names
("profileName") but AuthProfile expects snake_case ("profile_name"),
causing deserialization to fail silently. This results in a missing
profileArn when sending chat requests, producing the error:
"profileArn is required but no profiles are available"
Add #[serde(alias = "profileName")] to accept both formats.
Fixes aws#3703
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
#[serde(alias = "profileName")]toAuthProfile.profile_nameso it deserializes correctly from both snake_case and camelCase JSONProblem
The wrapper binary (
q_cli/fig_auth) writes the auth profile to the database with camelCase:{"arn":"...","profileName":"Social_Default_Profile"}But
AuthProfileinchat-cliexpects snake_case (profile_name), causingget_auth_profile()to fail with:This results in
profileArnbeingNone, which triggers the lazyListAvailableProfilesfallback. When that also fails (returns empty for social auth tokens), users see:Debug log (
KIRO_LOG_LEVEL=debug KIRO_CHAT_LOG_FILE=/tmp/debug.log) confirms this:Verification
Running the chat binary directly after manually fixing the JSON to
"profile_name"confirms chat works. The#[serde(alias)]fix makes this automatic.Test plan
profile_nameandprofileNameJSON formatsFixes #3703