bug: Misleading error message: "Error loading global mcp json path" when workspace MCP config fails to load
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu tại crates/chat-cli/src/cli/agent/mod.rs, khoảng dòng 922, nơi q chat tải cấu hình MCP của workspace. Tái hiện bằng q chat từ một thư mục không có .amazonq/mcp.json và xác minh rằng log xác định đường dẫn JSON MCP của workspace thay vì đường dẫn toàn cục. Được xem là hoàn tất khi cách diễn đạt gây hiểu nhầm của lỗi được sửa và hành vi liên quan vẫn được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Checks
- I have searched github.com/aws/amazon-q-developer-cli/issues and there are no duplicates of my issue
- I have run
q doctorin the affected terminal session - I have run
q restartand replicated the issue again
Operating system
Mac OS X
Expected behaviour
When the workspace MCP configuration file (.amazonq/mcp.json) is missing or fails to load, the error message should correctly indicate it's a workspace configuration issue, not a global configuration issue.
Actual behaviour
When .amazonq/mcp.json is missing from the current working directory, Q CLI logs the misleading error message:
Error loading global mcp json path: {error}
This is confusing because the error is actually about the workspace MCP config, not the global one.
Root Cause
In /crates/chat-cli/src/cli/agent/mod.rs at line 922, there's a copy-paste error in the error message:
// Line 919: Loading workspace config
let workspace_mcp_path = directories::chat_legacy_workspace_mcp_config(os)?;
let workspace_mcp_config = match McpServerConfig::load_from_file(os, workspace_mcp_path).await {
Ok(config) => Some(config),
Err(e) => {
// Line 922 - INCORRECT error message
tracing::error!("Error loading global mcp json path: {e}.");
None
},
};
The error message should say "workspace mcp json path" since the code is loading the workspace configuration.
Steps to reproduce
- Navigate to a directory that doesn't have
.amazonq/mcp.json - Run
q chat - Observe the misleading error message in logs
Environment
[q-details]
version = "1.19.0"
hash = "018fd3ce90193a546de1219163c48a495d4f0ee6"
date = "2025-10-23T22:25:42.533604Z (6d ago)"
variant = "full"
[system-info]
os = "macOS 15.7.1 (24G231)"
chip = "Apple M2 Pro"
total-cores = 12
memory = "32.00 GB"
[environment]
cwd = "/Users/USER/Documents/SongWork"
cli-path = "/Users/USER/Documents/SongWork"
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "iTerm 2"
install-method = "unknown"
[env-vars]
PATH = "/Users/USER/.local/share/mise/installs/node/22.19.0/bin:/Users/USER/.local/share/mise/installs/python/3.12.7/bin:/Users/USER/.local/share/mise/installs/python/3.11.10/bin:/Users/USER/.local/share/mise/installs/python/3.10.15/bin:/Users/USER/.local/share/mise/installs/python/3.9.20/bin:/Users/USER/.local/share/mise/installs/python/3.8.20/bin:/Users/USER/.local/share/mise/installs/usage/0.8.4/bin:/Users/USER/.local/share/mise/installs/java/corretto-17.0.12.7.1/bin:/Users/USER/.config/smithy-mcp/mcp-servers:/Users/USER/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/USER/.rbenv/shims:/Applications/kdiff3.app/Contents/MacOS/kdiff3:/opt/local/bin:/opt/local/sbin:/Users/USER/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:/usr/local/share/dotnet:~/.dotnet/tools:/Applications/iTerm.app/Contents/Resources/utilities:/Users/USER/.local/bin:/Users/USER/Library/Application Support/JetBrains/Toolbox/scripts:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/USER/.toolbox/bin"
QTERM_SESSION_ID = "3d0b51dd194640539e4fde55f5383519"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.19.0"
Q_USING_ZSH_AUTOSUGGESTIONS = "1"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.googlecode.iterm2"
- Ngôn ngữ chính
- Rust
- Star
- 2k
- Fork
- 442
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/amazon-q-developer-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/amazon-q-developer-cli#3898 ·
-
bug: invalid JSON in agent-format.md `allowedTools` Examples block (JS `//` comments + unquoted `@builtin`) breaks copy-pasteCó thể đã có người làm @ken-jo đã nhận 122 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
aws/amazon-q-developer-cli#3851 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aws/amazon-q-developer-cli#3023 · 2 bình luận ·
-
远程 SSH 连接 macOS (darwin-arm64)失败Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
aws/amazon-q-developer-cli#3929 ·
-
Amazon q not respondingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
aws/amazon-q-developer-cli#3928 ·
Tất cả issue của aws/amazon-q-developer-cli
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
charles-hood/DiagramCraft#73 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
ontologyportal/sigma-rs#200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
chipsalliance/caliptra-sw#4311 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)Có thể đã có người làm @ericz7900 đã nhận hôm nay. Đang mởllm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày