[BUG] Failed awsAuthRefresh output shown even after auth succeeds

Status Fixed / completed
Reported on v2.1.107
Maintainer reply None cached
Activity 5 comments · opened Apr 15, 2026 · closed May 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

My awsAuthRefresh command failed, causing an error message to appear. I addressed the cause of the auth error and submitted another prompt, which succeeded, indicating successful auth refresh. However, the error from the failed auth refresh is still shown, and it's sticky-positioned below the conversation.

This screenshot captures the issue: The agent output is shown above the auth error message, even though the auth error was resolved. I can continue the conversation, but it continues _above_ the no-longer-applicable auth error message.

<img width="1014" height="419" alt="Image" src="https://github.com/user-attachments/assets/23f2f195-10f3-479a-ab40-729d92827ff9" />

What Should Happen?

After awsAuthRefresh succeeds, the auth error message should either 1) be dismissed or 2) be positioned at the point in the conversation where auth failed, instead of being stuck to the tail of the conversation.

Error Messages/Logs

Steps to Reproduce

  1. In ~/.claude/settings.json, set awsAuthRefresh to a valid AWS auth command that lets you control its exit code. Have it return exit code 0 initially.
  2. Start a session with Claude Code and enter a prompt.
  3. Set the AWS auth command to return exit code 1, then enter another prompt, triggering the auth error.
  4. Set the AWS auth command to return exit code 0, then enter another prompt.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.107 (Claude Code)

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/47704
  2. https://github.com/anthropics/claude-code/issues/13518
  3. https://github.com/anthropics/claude-code/issues/26699

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

TrevorBurnham · 6 months ago

The "sticky" error message behavior here seems similar to #13518 and #26699. But I wouldn't consider those duplicates, since neither relates specifically to the awsAuthRefresh output.

imih · 5 months ago

Postulating from from minified 1.118:

  K.on("close", (exitCode, signal) => {  
      if (exitCode === 0) { endAuthentication(true); q(true); }                                                                                                                                                            
      else { ...; endAuthentication(false); q(false); }                                                                                                                                                                    
  })                                                                                                                                                                                                                       
  ```
                                                                    
  `endAuthentication(true)` clears the state fully.` endAuthentication(false)` (on non-zero exit) sets `isAuthenticating=false` but leaves `.error` in place — which keeps the dialog on screen.                         
                                                                                          
The dialog persists because the last run of the wrapper exited non-zero and set `.error="<output>"`. That `.error` never clears until the next successful run of `awsAuthRefresh`, which will only happen if `get-caller-idenity` guard suceceds. 

This can happen if another process has requested credentials making `get-caller-identity` guard succeed on the next attempt, so the `awsAuthRefresh` never gets called to clear that `.error`. 
TrevorBurnham · 5 months ago

This bug seems to have been resolved in a recent release.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.