stuck
Skill này làm gì
Skill này quét máy của bạn để tìm các tiến trình Qwen Code khác và tìm dấu hiệu bị treo, chẳng hạn CPU cao hoặc trạng thái dừng, rồi viết một báo cáo chẩn đoán. Dành cho người có phiên Qwen Code ngừng phản hồi.
Khi nào nên dùng
- ✓Khi một phiên Qwen Code khác trên máy tính có vẻ bị treo hoặc rất chậm.
- ✓Khi một tiến trình Qwen Code đang dùng nhiều CPU hoặc bộ nhớ mà không rõ lý do.
- ✓Khi bạn muốn tập trung chẩn đoán vào một ID tiến trình.
Liên kết skill
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/stuck/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cửa sổ Qwen Code khác của tôi có vẻ bị treo. Hãy kiểm tra xem nó có bị kẹt không và cho tôi biết có vấn đề gì.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm các tiến trình Qwen Code, lấy mẫu mức dùng CPU và trạng thái của chúng, rồi kiểm tra log gỡ lỗi. Sau đó nó trình bày báo cáo về các nguyên nhân có khả năng, và không động đến phiên hiện tại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
/stuck — diagnose frozen/slow Qwen Code sessions
The user thinks another Qwen Code session on this machine is frozen, stuck, or very slow. Investigate and present a diagnostic report.
What to look for
Scan for other Qwen Code processes (excluding the current one — exclude the PID you see running this prompt). Since Qwen Code is a Node.js CLI (#!/usr/bin/env node), the process name (comm column) is always node (or bun if run with Bun). Identify Qwen Code sessions by looking at the command column for a script path inside a directory whose name starts with qwen-code (matches qwen-code/, qwen-code-dev/, worktree clones, etc.) — anchored to the start of the path or after / so unrelated names like analyze-qwen-code/ don't false-match — or a bin invocation ending in /qwen (the global symlink). Avoid loose qwen-code substring matching: it false-positives on plugin brokers that merely pass a qwen-code path as --cwd.
Signs of a stuck session:
- High CPU (>=90%) sustained — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.
- Process state
D/U(uninterruptible sleep) — often an I/O hang. Linux usesD, macOS/BSD usesU. Thestatecolumn inpsoutput; first character matters (ignore modifiers like+,s,<). - Process state
T(stopped) — user probably hit Ctrl+Z by accident. - Process state
Z(zombie) — parent isn't reaping. - Very high RSS (>=4GB) — possible memory leak making the session sluggish.
- State
Swith low CPU — the most common hang signature: a hung HTTPS request to the model API. Not a process-level red flag on its own, but combined with the user reporting "stuck", treat it as a strong signal to run the network check in step 3. - Stuck child process — a hung
git,node, or shell subprocess can freeze the parent. Checkpgrep -P <pid>(thenps -pfor state — see step 3) for each session.
Argument validation
If the user gave an argument, treat it as a PID only if it consists entirely of digits 0-9. Anything else — letters, whitespace, punctuation — fails the check, in which case treat it as a free-text symptom description (guidance for the report only, never substituted into shell commands). The strict digit-only whitelist is safer than enumerating shell metacharacters.
Investigation steps
Preamble — resolve the runtime base directory. Required for both paths below (sidecar enumeration in step 1, debug log lookup in step 3, and the PID fast path). The base directory is taken from (in priority order): QWEN_RUNTIME_DIR env var, the advanced.runtimeOutputDir setting, QWEN_HOME env var, and finally ~/.qwen.
RUNTIME_DIR="${QWEN_RUNTIME_DIR:-}"
[ -z "$RUNTIME_DIR" ] && command -v jq >/dev/null && RUNTIME_DIR=$(jq -r '.advanced.runtimeOutputDir // empty' "${QWEN_HOME:-$HOME/.qwen}/settings.json" 2>/dev/null)
# `advanced.runtimeOutputDir` may be `~/...` or relative; mirror Storage.resolvePath() before using in globs
[ -n "$RUNTIME_DIR" ] && RUNTIME_DIR="${RUNTIME_DIR/#\~/$HOME}"
[ -n "$RUNTIME_DIR" ] && case "$RUNTIME_DIR" in /*) ;; *) RUNTIME_DIR="$(cd "$RUNTIME_DIR" 2>/dev/null && pwd)" || RUNTIME_DIR="" ;; esac
RUNTIME_DIR="${RUNTIME_DIR:-${QWEN_HOME:-$HOME/.qwen}}"
(If jq isn't installed, the settings layer is silently skipped — the env-var / default fallback covers the common case.)
Fast path for targeted diagnosis — if a digit-only PID argument was given, skip step 1 enumeration. Validate that the PID is a live current-user Qwen Code process before dumping any details:
kill -0 <pid> 2>/dev/null || { echo "PID <pid> is dead, or owned by another user"; exit 0; }
ps -p <pid> -o command= -ww 2>/dev/null | grep -qE '((^|/)qwen-code[^ /]*/[^ ]*\.(js|ts|mjs|cjs)( |$)|/qwen( |$))' || { echo "PID <pid> is yours but is not a Qwen Code process — refusing to dump details"; exit 0; }
If either guard prints, stop the diagnostic and surface the message verbatim. Otherwise, gather stats and the sidecar mapping, then jump to step 3:
ps -p <pid> -o pid=,pcpu=,rss=,etime=,state=,comm=,command= -ww
grep -El '"pid"[[:space:]]*:[[:space:]]*<pid>\b' "$RUNTIME_DIR"/projects/*/chats/*.runtime.json 2>/dev/null
Note: as in step 2, the command= column may include credentials passed as CLI args (e.g., --openai-api-key=sk-…). Redact such values to *** before quoting them in the report.
-E is required so \b is interpreted as word boundary (BSD `g
Câu hỏi thường gặp
Nó có dừng tiến trình bị treo không?
Skill này dùng để chẩn đoán và trình bày báo cáo, và không mô tả việc kết thúc tiến trình như một bước mặc định.
Làm sao nó tránh nhầm tiến trình?
Nó khớp đường dẫn cài đặt và tên bin của Qwen Code, và loại trừ phiên đang chạy việc kiểm tra.
Tôi có thể kiểm tra một tiến trình cụ thể không?
Có. Bạn có thể cung cấp ID tiến trình để tập trung chẩn đoán vào nó.
Chi tiết
Mô tả gốc của tác giả
Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU/memory usage, hung subprocesses, and debug logs. Use /stuck or /stuck <PID> to focus on a specific process.
repo: QwenLM/qwen-code
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9787
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
codegraph
29kGiúp agent của bạn phân tích một codebase đã lập chỉ mục qua đồ thị gọi, phụ thuộc, mã chết, điểm nóng và tìm kiếm theo ngữ nghĩa.
qwen-code-claw
29kGiúp agent của bạn giao các tác vụ lập trình cho Qwen Code, như tìm hiểu codebase, sửa lỗi, tái cấu trúc mã hoặc tạo một dự án mới.
structured-debugging
29kDạy agent của bạn cách gỡ lỗi khó theo từng bước: đặt giả thuyết, thêm kiểm tra có mục tiêu, kiểm thử và tìm nguyên nhân thật trước khi sửa.
tmux-real-user-testing
29kGiúp agent của bạn kiểm thử một ứng dụng terminal như người dùng thật trong tmux, lưu nhật ký từng bước dễ đọc kèm ảnh chụp màn hình của mỗi hành động.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.