aws / aws/amazon-q-developer-cli

When loading a conversation with /load using a different agent than the current agent, the tools list seems to try to use the tools available for the agent from the saved conversation. If you call /tools after loading, Q crashes

Open
#2,914 0 comments 1 reaction 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.6.1 (24G90)

### Expected behaviour

I can load the conversation from the previous agent (with different mcp servers and tools) and continue.

### Actual behaviour

```
% RUST_BACKTRACE=full q chat --agent amazon

⢠⣶⣶⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣶⣦⡀⠀
⠀⠀⠀⣾⡿⢻⣿⡆⠀⠀⠀⢀⣄⡄⢀⣠⣤⣤⡀⢀⣠⣤⣤⡀⠀⠀⢀⣠⣤⣤⣤⣄⠀⠀⢀⣤⣤⣤⣤⣤⣤⡀⠀⠀⣀⣤⣤⣤⣀⠀⠀⠀⢠⣤⡀⣀⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠋⠀⠀⠀⠙⣿⣿⡆
⠀⠀⣼⣿⠇⠀⣿⣿⡄⠀⠀⢸⣿⣿⠛⠉⠻⣿⣿⠛⠉⠛⣿⣿⠀⠀⠘⠛⠉⠉⠻⣿⣧⠀⠈⠛⠛⠛⣻⣿⡿⠀⢀⣾⣿⠛⠉⠻⣿⣷⡀⠀⢸⣿⡟⠛⠉⢻⣿⣷⠀⠀⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⢸⣿⣿
⠀⢰⣿⣿⣤⣤⣼⣿⣷⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⢀⣴⣶⣶⣶⣿⣿⠀⠀⠀⣠⣾⡿⠋⠀⠀⢸⣿⣿⠀⠀⠀⣿⣿⡇⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⢹⣿⣇⠀⠀⠀⠀⠀⢸⣿⡿
⢀⣿⣿⠋⠉⠉⠉⢻⣿⣇⠀⢸⣿⣿⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⠀⠀⣿⣿⡀⠀⣠⣿⣿⠀⢀⣴⣿⣋⣀⣀⣀⡀⠘⣿⣿⣄⣀⣠⣿⣿⠃⠀⢸⣿⡇⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣦⣀⣀⣀⣴⣿⡿⠃
⠚⠛⠋⠀⠀⠀⠀⠘⠛⠛⠀⠘⠛⠛⠀⠀⠀⠛⠛⠀⠀⠀⠛⠛⠀⠀⠙⠻⠿⠟⠋⠛⠛⠀⠘⠛⠛⠛⠛⠛⠛⠃⠀⠈⠛⠿⠿⠿⠛⠁⠀⠀⠘⠛⠃⠀⠀⠘⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠿⢿⣿⣿⣋⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⢿⡧

╭─────────────────────────────── Did you know? ────────────────────────────────╮
│ │
│ /usage shows you a visual breakdown of your current context window │
│ usage │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯

/help all commands • ctrl + j new lines • ctrl + s fuzzy search
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 You are chatting with claude-sonnet-4

[amazon] > /load issues-with-kb

✔ Imported conversation state from issues-with-kb

[amazon] > /tools

Tool Permission
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔Built-in:
- execute_bash * trust read-only commands
- fs_read * trusted
- fs_write * not trusted
- introspect * trusted
- report_issue * trusted
- use_aws * trust read-only commands

context7 (MCP):
- getlibrarydocs * not trusted
- resolvelibraryid * not trusted

The application panicked (crashed).
Message: Formatting argument out of range
Location: crates/chat-cli/src/cli/chat/cli/tools.rs:123

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 10 frames hidden ⋮
11: chat_cli::cli::chat::cli::tools::ToolsArgs::execute::{{closure}}::h11e5fcde973de97e
at :
12: chat_cli::cli::chat::cli::SlashCommand::execute::{{closure}}::hd6cfb622c86c33f1
at :
13: chat_cli::cli::chat::ChatSession::next::{{closure}}::{{closure}}::he2d07c50d1ae14e3
at :
14: chat_cli::cli::chat::ChatSession::next::{{closure}}::h737a7f5f7dd030b4
at :
15: chat_cli::cli::chat::ChatArgs::execute::{{closure}}::h23076189569cc1e2
at :
16: chat_cli::cli::RootSubcommand::execute::{{closure}}::he1142c139f093536
at :
17: chat_cli::cli::Cli::execute::{{closure}}::h05bba3cb1de0e328
at :
18: tokio::runtime::park::CachedParkThread::block_on::h13cabf946d04ed62
at :
19: tokio::runtime::context::runtime::enter_runtime::h666370a67088e289
at :
20: chat_cli::main::h66d72aed380c81c6
at :
21: std::sys::backtrace::__rust_begin_short_backtrace::h8f4a2cab62b120ef
at :
22: std::rt::lang_start::{{closure}}::h3b9ffcecaf10b3b8
at :
23: std::rt::lang_start_internal::hdff9e551ec0db2ea
at :
24: _main
at :

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
```

### Steps to reproduce

Start conversation with agent with one set of MCP servers, /save, /load with agent with different set of MCP servers, call /tools.

### Environment

```yaml

[q-details]
version = "1.16.0"
hash = "8417df71be2c2090b5fd08c91561fda44d7e7566"
date = "2025-09-16T21:41:07.357109Z (18h ago)"

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

[environment]
cwd = "/Users/USER/ASV/rewards"
cli-path = "/Users/USER/ASV/rewards"
install-method = "toolbox"

[env-vars]
DISPLAY = "c889f3bc7462"
PATH = "/opt/homebrew/opt/curl/bin:/Users/USER/.nvm/versions/node/v22.14.0/bin:/Users/USER/.nvm/versions/node/v22.14.0/bin:/Users/USER/.asdf/shims:/opt/homebrew/opt/curl/bin:/Users/USER/.nvm/versions/node/v22.14.0/bin:/Users/USER/.nvm/versions/node/v22.14.0/bin:/Users/USER/.asdf/shims:/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:/opt/homebrew/opt/curl/bin:/Users/USER/.nvm/versions/node/v22.14.0/bin:/Users/USER/.asdf/shims:/Applications/Emacs.app/Contents/MacOS/bin-arm64-11:/Applications/Emacs.app/Contents/MacOS/libexec-arm64-11:/Library/TeX/texbin:/Users/USER/.toolbox/bin:/Users/USER/.cargo/bin:/Users/USER/.toolbox/bin:/Users/USER/.cargo/bin:/Users/USER/.toolbox/bin:/Users/USER/.cargo/bin"
SHELL = "/bin/zsh"
TERM = "eterm-color"
__CFBundleIdentifier = "org.gnu.Emacs"
```

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.