aws / aws/amazon-q-developer-cli
login session not reflecting properly
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
### Checks
- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
macOS 15.7.0 (24G222)
### Expected behaviour
### Context
Randomly getting access-denied errors when the chat session in going for long duration
### Workaround
* Tried to re-initiate the login with `q login` but issue was still occurring
* Tried `q logout` and `q login` - issue gets resolved
**NOTE**: found [Similar issue](https://github.com/aws/amazon-q-developer-cli/issues/1310) but the error message is little bit difference
### Actual behaviour
```
Amazon Q is having trouble responding right now:
0: Failed to send the request: unhandled error (AccessDeniedException)
1: unhandled error (AccessDeniedException)
2: service error
3: unhandled error (AccessDeniedException)
4: Error { code: "AccessDeniedException", message: "The bearer token included in the request is invalid.", aws_request_id: "9f2ffce1-7c6c-4c20-8a80-ef7de4510a27" }
Location:
crates/chat-cli/src/cli/chat/mod.rs:1081
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
```
### Steps to reproduce
try to initiate any query with q in a long duration
### Environment
```yaml
[q-details]
version = "1.17.1"
hash = "b0ef39f91625c36c2ed6f065628e7165fae9012c"
date = "2025-09-30T22:01:25.726592Z (8h ago)"
[system-info]
os = "macOS 15.7.0 (24G222)"
chip = "Apple M1 Pro"
total-cores = 10
memory = "32.00 GB"
[env-vars]
PATH = "/Users/USER/.local/share/mise/installs/node/18.20.2/bin:/Users/USER/.local/share/mise/installs/python/3.12.9/bin:/Users/USER/.local/share/mise/installs/python/3.11.11/bin:/Users/USER/.local/share/mise/installs/python/3.10.16/bin:/Users/USER/.local/share/mise/installs/python/3.9.21/bin:/Users/USER/.local/share/mise/installs/python/3.8.20/bin:/Users/USER/.config/smithy-mcp/mcp-servers:/Users/USER/.pyenv/shims:/Users/USER/.pyenv/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/USER/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/USER/.config/smithy-mcp/mcp-servers:/Users/USER/.pyenv/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/USER/.cargo/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/USER/.toolbox/bin:/Users/USER/.vscode/extensions/ms-python.debugpy-2025.10.0-darwin-arm64/bundled/scripts/noConfigScripts"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
ZDOTDIR = "/Users/USER"
__CFBundleIdentifier = "com.microsoft.VSCode"
```
Contributor guide
Assessment
This issue has not been assessed yet.