Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

bug: Misleading error message: "Error loading global mcp json path" when workspace MCP config fails to load

Đang mở Phù hợp với người mới
#3,316 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
cli

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
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
  1. Navigate to a directory that doesn't have .amazonq/mcp.json
  2. Run q chat
  3. 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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/amazon-q-developer-cli

Tất cả issue của aws/amazon-q-developer-cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.