aws / aws/amazon-q-developer-cli
Clearing the context after being prompted to give permission for tool calling ignores the next prompt
- 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
Linux 6.8.0-65-generic - Ubuntu 22.04.5 LTS
### Expected behaviour
When running /clear -> y right after permission is asked for a tool calling, the prompt executed after the clear operation should be answered and handled.
Example:
Q asks for permission to call a tool
User run /clear
User type y
User asks a question after the context has been wiped out
Q responses to the question
### Actual behaviour
When running /clear -> y right after permission is asked for a tool calling, the answer to the first prompt executed after the clear operation is "I understand that you cancelled the tool use. Is there anything else I can help you with regarding the MCP server or any other topic?"
Example output:
🛠️ Using tool: code_formatter from mcp server my_mcp
⋮
● Running code_formatter with the param:
⋮ {
⋮ "name": "code_formatter",
⋮ "arguments": {
⋮ "file_path": "/home/myUser/repos/mcpServer/setup.py"
⋮ }
⋮ }
Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
> /clear
Are you sure? This will erase the conversation history and context from hooks for the current session. [y/n]:
> y
Conversation history cleared.
Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
> what is the capital of Sweden?
> I understand that you cancelled the tool use. Is there anything else I can help you with regarding the MCP server or any other
topic?
Q continues to ask for the permission of the previous tool call even when after the context is wiped out.
### Steps to reproduce
1. Ask amazon Q CLI to run an MCP tool (with no prior permission given)
2. Run /clear
3. Allow the clear operation with y
4. Ask any new question
### Environment
```yaml
[q-details]
version = "1.14.1"
date = "2025-08-21T18:28:29.76428Z (3d ago)"
[system-info]
chip = "11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz"
total-cores = 8
memory = "62.47 GB"
[system-info.os.linux]
kernel_version = "6.8.0-65-generic"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 22.04.5 LTS"
version_id = "22.04"
version = "22.04.5 LTS (Jammy Jellyfish)"
[env-vars]
DISPLAY = ":1"
GTK_IM_MODULE = "ibus"
QT_IM_MODULE = "ibus"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.14.1"
SHELL = "/bin/bash"
TERM = "xterm-256color"
XDG_CURRENT_DESKTOP = "Unity"
XDG_SESSION_DESKTOP = "ubuntu"
XDG_SESSION_TYPE = "x11"
XMODIFIERS = "@im=ibus"
```
Contributor guide
Assessment
This issue has not been assessed yet.