aws / aws/amazon-q-developer-cli
PERSISTENT: Chat prompt shows incorrect agent name after switching default agent
- 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
The chat prompt should update to reflect the currently active agent. After setting 'default' as the default agent and restarting Q CLI multiple times, it should show "[default] >" or no agent indicator, not continue showing the previous agent name.
### Actual behaviour
UPDATE: The chat prompt bug persists after multiple Q CLI restarts and sessions. Despite successfully switching to 'default' agent (confirmed by `q agent list` and `q mcp list` showing 7 global MCP servers), the prompt continues to display "[amzn-builder] >" across all new chat sessions. This confirms the UI is not syncing with the actual agent configuration.
```
[chat-transcript]
## **Current Reality:**
❌ **No API Key Support**: Q CLI doesn't have API keys for programmatic access
✅ **Session-based Works**: Your current integration works through your authenticated session
## **Alternatives:**
**1. Keep using session-based approach** (recommended):
\```javascript
// Your current approach works well
const qResponse = execSync('q chat "your query"', { encoding: 'utf8' });
\```
**2. Direct Amazon Q API** (if available):
- Check if Amazon Q has a direct REST API
- Would require separate authentication setup
- Not the same as Q CLI
**3. Hybrid approach**:
\```javascript
// Check auth status before each call
function ensureQAuth() {
try {
execSync('q whoami', { encoding: 'utf8' });
return true;
} catch {
console.log('Q CLI auth expired - please run: q login');
return false;
}
}
\```
[Tool uses: none]
> btw, the prompt still appears as "[amzn-builder]" despite the work we did yesterday. a new bug?
That's the same bug we filed yesterday! The prompt is still showing `[amzn-builder]` even though we:
1. Created the `default` agent
2. Set it as default with `q agent set-default --name default`
3. Restarted Q CLI multiple times
Let me check the current agent status:
[Tool uses: execute_bash]
[Tool uses: execute_bash]
**Confirmed:** Same bug persists!
- ✅ **Functionality works**: You're using the `default` agent (see all 7 MCP servers)
- ❌ **UI bug**: Prompt still shows `[amzn-builder]` instead of `[default]` or no indicator
This confirms the bug report we filed yesterday is valid - the prompt display isn't syncing with the actual agent configuration. The Q CLI team should fix this UI inconsistency.
**Current status:**
- **Actual agent**: `default` (working correctly)
- **Displayed prompt**: `[amzn-builder]` (incorrect/stale)
- **Impact**: Cosmetic only - functionality is correct
The bug persists across sessions and restarts, so it's definitely a Q CLI issue, not something we can fix on our end.
```
### Steps to reproduce
1. Start with 'amzn-builder' as default agent (prompt shows "[amzn-builder] >")
2. Run 'q agent set-default --name default'
3. Run 'q restart' multiple times
4. Start multiple new chat sessions over 24+ hours
5. Verify functionality works (q mcp list shows global servers)
6. Notice prompt STILL shows "[amzn-builder] >" despite agent switch working functionally
### Environment
```yaml
[q-details]
version = "1.16.2"
hash = "c4c80bb44cb22b6e19129ed7475f2793ff20135d"
date = "2025-09-19T01:27:56.356289Z (7d ago)"
[system-info]
os = "macOS 15.7.0 (24G222)"
chip = "Apple M2 Pro"
total-cores = 10
memory = "16.00 GB"
[environment]
cwd = "/Users/USER"
cli-path = "/Users/USER"
install-method = "toolbox"
[env-vars]
PATH = "/Users/USER/.local/bin:/Users/USER/.toolbox/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/.local/bin"
QTERM_SESSION_ID = "269eee9b69794b3da536b395d53163be"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.16.2"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "org.tabby"
[chat-settings]
[chat-trusted_tools]
@builder-mcp/TaskeiGetTask=trusted
@builder-mcp/TaskeiGetRooms=trusted
@builder-mcp/TicketingReadActions=trusted
fs_read=trusted
execute_bash=trusted
fs_write=trusted
@builder-mcp/ReadInternalWebsites=trusted
@builder-mcp/InternalSearch=trusted
@builder-mcp/InternalCodeSearch=trusted
@builder-mcp/TaskeiListTasks=trusted
[chat-failed_request_ids]
none
[chat-context]
current_profile=amzn-builder
profile_context=none
files=none
```
Contributor guide
Assessment
This issue has not been assessed yet.