aws / aws/amazon-q-developer-cli

Q chat hangs when file content contains auth tokens

Open
#1,824 0 comments 0 reactions 0 assignees View on GitHub
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.4.1 (24E263)

### Expected behaviour

Q chat should properly display file contents regardless of whether they contain authentication tokens or similar patterns like `auth?token=`.

### Actual behaviour

When asking Q chat to read and print a file that contains strings like `auth?token=`, it doesn't print anything and hangs instead of displaying the file content.

```
> can you help read the content of file_with_access_token.md in current directory and print evething out on the screen

I'll help you read the content of the file_with_access_token.md in your current directory. Let me check if this file exists and display its
contents.

🛠️ Using tool: fs_read (trusted)

● Reading file: /Users/chaoneng/Desktop/file_with_access_token.md, all lines

● Completed in 0.0s

Here's the content of the file_with_access_token.md from your current directory:

markdown
# JupyterLab Access URL Generated 🔗
Space Name: jupyterlab-5b0acdc6
Domain: QuickSetupDomain-20250430T212888 (d-lcamt2amubga)
User Profile: public-internet-domain-user
URL Expiration: 300 seconds

## Access Instructions
Your JupyterLab environment is ready! Use the link below to access it

```

See also

Image

### Steps to reproduce

1. Have a file with content containing strings like `auth?token=`
2. Ask Q chat to read and print the current file
3. Observe that Q chat hangs and doesn't display the file content

For example

```
# JupyterLab Access URL Generated 🔗 Space Name: xxxxx Domain: xxxxx (xxxxxx) User Profile: xxxxx URL Expiration: 300 seconds ## Access Instructions Your JupyterLab environment is ready! Use the link below to access it: **Access URL:**

https://wc9vsi177ly2ums.studio.us-west-2.sagemaker.aws/auth?token=eyJhbGciOiJIUzI1NiJ9.ey
```

### Environment

```yaml

[q-details]
version = "1.10.0"
hash = "defff477d495e672f9873badc9d070c1909c3912"
date = "2025-04-30T20:19:52.680739Z (13d ago)"
variant = "full"

[system-info]
os = "macOS 15.4.1 (24E263)"
chip = "Apple M1 Pro"
total-cores = 10
memory = "32.00 GB"

[environment]
cwd = "/Users/USER/Desktop"
cli-path = "/Users/USER/Desktop"
os = "Mac"
shell-path = "/Users/USER/.toolbox/tools/toolbox/1.1.1860.0/toolbox-exec"
shell-version = "5.9"
terminal = "Hyper"
install-method = "toolbox"

[env-vars]
PATH = "/Users/USER/micromamba/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/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/Library/Application Support/JetBrains/Toolbox/scripts:/Users/USER/.toolbox/bin:/Users/USER/.local/bin"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "co.zeit.hyper"

[chat-settings]
interactive=true

[chat-trusted_tools]

[chat-failed_request_ids]
none

[chat-context]
current_profile=default
profiles=
default

global_context=
.amazonq/rules/**/*.md
README.md
AmazonQ.md
src/*/.amazonq/rules/**/*.md
src/*/AmazonQ.md
src/*/README.md
/Volumes/workplace/q/src/AmazonBuilderGenAIPowerUsersQContext/AmazonQ.md
/Volumes/workplace/q/src/AmazonBuilderGenAIPowerUsersQContext/rules/**/*.md

profile_context=
MCPPythonSDK.md
./MCPPythonSDK.md

files=
/Volumes/workplace/q/src/AmazonBuilderGenAIPowerUsersQContext/AmazonQ.md, 7210 tkns
/Volumes/workplace/q/src/AmazonBuilderGenAIPowerUsersQContext/rules/base.md, 620 tkns
/Volumes/workplace/q/src/AmazonBuilderGenAIPowerUsersQContext/rules/script-format.md, 2150 tkns
total context size=9980 tkns
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.