fix(ux): clarify credential detection messages to avoid confusion (#2147)

Distinguish between 'no local credentials' and 'using spawn-cached credentials'
so users understand why an initial failure message is followed by a success.

Fixes #2142

Agent: ux-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-03 11:54:18 -08:00 committed by GitHub
parent cfa1ae7a08
commit 931fbed8b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -507,7 +507,7 @@ export async function authenticate(): Promise<void> {
logInfo(`AWS CLI ready, using region: ${region}`);
return;
}
logWarn("AWS CLI found but credentials invalid or expired");
logWarn("No AWS credentials available in local environment");
}
// 2. Check env vars for REST mode
@ -553,10 +553,10 @@ export async function authenticate(): Promise<void> {
]);
if (result.exitCode === 0) {
lightsailMode = "cli";
logInfo(`AWS CLI ready with cached credentials, using region: ${cachedRegion}`);
logInfo(`AWS CLI ready with credentials cached by spawn. Using region: ${cachedRegion}`);
return;
}
logWarn("Cached AWS credentials invalid or expired");
logWarn("Credentials cached by spawn are invalid or expired");
awsAccessKeyId = "";
awsSecretAccessKey = "";
delete process.env.AWS_ACCESS_KEY_ID;