[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-qwen-stuck":3,"mdc--um5xbf-key":34,"related-repo-qwen-stuck":1333,"related-org-qwen-stuck":1442},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"stuck","diagnose and debug stuck Qwen Code sessions","Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU\u002Fmemory usage, hung subprocesses, and debug logs. Use \u002Fstuck or \u002Fstuck \u003CPID> to focus on a specific process.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"qwen","Qwen","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fqwen.png","QwenLM",[13,17,20],{"name":14,"slug":15,"type":16},"Performance","performance","tag",{"name":18,"slug":19,"type":16},"Engineering","engineering",{"name":21,"slug":22,"type":16},"Debugging","debugging",26008,"https:\u002F\u002Fgithub.com\u002FQwenLM\u002Fqwen-code","2026-07-16T05:59:25.838629",null,2643,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"An open-source AI coding agent that lives in your terminal.","https:\u002F\u002Fgithub.com\u002FQwenLM\u002Fqwen-code\u002Ftree\u002FHEAD\u002Fpackages\u002Fcore\u002Fsrc\u002Fskills\u002Fbundled\u002Fstuck","---\nname: stuck\ndescription: Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU\u002Fmemory usage, hung subprocesses, and debug logs. Use \u002Fstuck or \u002Fstuck \u003CPID> to focus on a specific process.\nargument-hint: '[PID or symptom]'\nallowedTools:\n  - run_shell_command\n  - read_file\n---\n\n# \u002Fstuck — diagnose frozen\u002Fslow Qwen Code sessions\n\nThe user thinks another Qwen Code session on this machine is frozen, stuck, or very slow. Investigate and present a diagnostic report.\n\n## What to look for\n\nScan 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 (`#!\u002Fusr\u002Fbin\u002Fenv 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\u002F`, `qwen-code-dev\u002F`, worktree clones, etc.) — anchored to the start of the path or after `\u002F` so unrelated names like `analyze-qwen-code\u002F` don't false-match — or a bin invocation ending in `\u002Fqwen` (the global symlink). Avoid loose `qwen-code` substring matching: it false-positives on plugin brokers that merely pass a qwen-code path as `--cwd`.\n\nSigns of a stuck session:\n\n- **High CPU (>=90%) sustained** — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.\n- **Process state `D` \u002F `U` (uninterruptible sleep)** — often an I\u002FO hang. Linux uses `D`, macOS\u002FBSD uses `U`. The `state` column in `ps` output; first character matters (ignore modifiers like `+`, `s`, `\u003C`).\n- **Process state `T` (stopped)** — user probably hit Ctrl+Z by accident.\n- **Process state `Z` (zombie)** — parent isn't reaping.\n- **Very high RSS (>=4GB)** — possible memory leak making the session sluggish.\n- **State `S` with 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.\n- **Stuck child process** — a hung `git`, `node`, or shell subprocess can freeze the parent. Check `pgrep -P \u003Cpid>` (then `ps -p` for state — see step 3) for each session.\n\n## Argument validation\n\nIf 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.\n\n## Investigation steps\n\n**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 `~\u002F.qwen`.\n\n```\nRUNTIME_DIR=\"${QWEN_RUNTIME_DIR:-}\"\n[ -z \"$RUNTIME_DIR\" ] && command -v jq >\u002Fdev\u002Fnull && RUNTIME_DIR=$(jq -r '.advanced.runtimeOutputDir \u002F\u002F empty' \"${QWEN_HOME:-$HOME\u002F.qwen}\u002Fsettings.json\" 2>\u002Fdev\u002Fnull)\n# `advanced.runtimeOutputDir` may be `~\u002F...` or relative; mirror Storage.resolvePath() before using in globs\n[ -n \"$RUNTIME_DIR\" ] && RUNTIME_DIR=\"${RUNTIME_DIR\u002F#\\~\u002F$HOME}\"\n[ -n \"$RUNTIME_DIR\" ] && case \"$RUNTIME_DIR\" in \u002F*) ;; *) RUNTIME_DIR=\"$(cd \"$RUNTIME_DIR\" 2>\u002Fdev\u002Fnull && pwd)\" || RUNTIME_DIR=\"\" ;; esac\nRUNTIME_DIR=\"${RUNTIME_DIR:-${QWEN_HOME:-$HOME\u002F.qwen}}\"\n```\n\n(If `jq` isn't installed, the settings layer is silently skipped — the env-var \u002F default fallback covers the common case.)\n\n**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:\n\n```\nkill -0 \u003Cpid> 2>\u002Fdev\u002Fnull || { echo \"PID \u003Cpid> is dead, or owned by another user\"; exit 0; }\nps -p \u003Cpid> -o command= -ww 2>\u002Fdev\u002Fnull | grep -qE '((^|\u002F)qwen-code[^ \u002F]*\u002F[^ ]*\\.(js|ts|mjs|cjs)( |$)|\u002Fqwen( |$))' || { echo \"PID \u003Cpid> is yours but is not a Qwen Code process — refusing to dump details\"; exit 0; }\n```\n\nIf either guard prints, stop the diagnostic and surface the message verbatim. Otherwise, gather stats and the sidecar mapping, then jump to step 3:\n\n```\nps -p \u003Cpid> -o pid=,pcpu=,rss=,etime=,state=,comm=,command= -ww\ngrep -El '\"pid\"[[:space:]]*:[[:space:]]*\u003Cpid>\\b' \"$RUNTIME_DIR\"\u002Fprojects\u002F*\u002Fchats\u002F*.runtime.json 2>\u002Fdev\u002Fnull\n```\n\nNote: 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.\n\n`-E` is required so `\\b` is interpreted as word boundary (BSD `grep` without `-E` treats `\\b` as a backspace character, silently returning nothing on macOS). The `-l` flag returns the matching sidecar file path; the basename (stripped of `.runtime.json`) is the session ID for step 3's debug log read. If multiple sidecars match (rare — happens only after PID reuse leaves a stale file), prefer the most recently modified one: `ls -t \u003Cmatches> | head -n 1`.\n\nOtherwise (no arg, or symptom-only arg), run the general path below:\n\n1. **Enumerate live sessions via the runtime sidecar** (preferred, reliable):\n\n   Qwen Code writes a `runtime.json` sidecar for each interactive session at `\"$RUNTIME_DIR\"\u002Fprojects\u002F\u003Csanitized-cwd>\u002Fchats\u002F\u003CsessionId>.runtime.json`. Each file contains `{schema_version, pid, session_id, work_dir, hostname, started_at, qwen_version}` — the authoritative source of `(pid, session_id, work_dir)` mappings.\n\n   Filter to live `(pid, sidecar-path)` pairs in one shot. Use Node (guaranteed available — qwen-code requires it) instead of `jq` (often missing on default macOS \u002F minimal Linux) so this path doesn't silently degrade:\n\n   ```\n   node -e 'const fs=require(\"fs\"); for (const f of process.argv.slice(1)) { try { const p=JSON.parse(fs.readFileSync(f,\"utf8\")).pid; if (p) { try { process.kill(p,0); console.log(p+\" \"+f); } catch {} } } catch {} }' \"$RUNTIME_DIR\"\u002Fprojects\u002F*\u002Fchats\u002F*.runtime.json 2>\u002Fdev\u002Fnull\n   ```\n\n   PID reuse is rare but possible — when you cross-reference with `ps` in step 2, skip pairs whose live PID's command line no longer looks like a Qwen Code process.\n\n   **If the command emits nothing** (no sidecars, or no live PIDs), fall through to step 2 — `ps` is the working fallback.\n\n2. **List Qwen Code processes via `ps`** (macOS\u002FLinux) — used to enrich each live session with CPU\u002FRSS\u002Fstate\u002Fuptime, and to catch sessions that may have started before the sidecar feature existed:\n\n   ```\n   ps -xo pid=,pcpu=,rss=,etime=,state=,comm=,command= -u \"$(id -u)\" -ww | grep -E '((^|\u002F)qwen-code[^ \u002F]*\u002F[^ ]*\\.(js|ts|mjs|cjs)( |$)|\u002Fqwen( |$))' | grep -v grep\n   ```\n\n   `-u \"$(id -u)\"` restricts the scan to the current user — on shared hosts this avoids exposing other users' Qwen process paths\u002Farguments into the chat. `-ww` disables column truncation so long \"qwen\" paths aren't cut off. The `comm` column will be `node` or `bun`, not `qwen`; filter to rows where the `command` column contains a qwen path (e.g., `qwen-code\u002Fdist\u002Fcli.js`, or a bin symlink ending in `\u002Fqwen`). Cross-reference with the PIDs from step 1.\n\n   Note: `ps` reports `rss` in **kilobytes** on both macOS and Linux. To report in MB, divide by 1024; to report in GB, divide by 1048576. The 4GB threshold is `4194304` KB — compare the raw `rss` value against that, or compare the GB value against 4. Do not divide once and then compare against 4; that would flag every process >4MB as \"very high RSS\".\n\n   Note: full command lines may contain credentials passed as CLI args (e.g., `--openai-api-key=sk-…`). Redact such values to `***` before quoting them in the report.\n\n3. **For anything suspicious**, gather more context. If the process state alone explains the problem (`T` = accidentally stopped, `Z` = parent not reaping), skip directly to the report — child \u002F log \u002F stack inspection adds nothing. Otherwise:\n   - Child processes (with state, so a hung `git` \u002F `node` shows up): `CHILDREN=$(pgrep -P \u003Cpid> | tr '\\n' ',' | sed 's\u002F,$\u002F\u002F'); [ -n \"$CHILDREN\" ] && ps -p \"$CHILDREN\" -o pid=,ppid=,pcpu=,state=,etime=,command= -ww`. Single `ps` call (avoids forking one per child) and `-ww` so long child command lines aren't truncated.\n   - If high CPU: sample again after 1-2s to confirm it's sustained\n   - **Network hang** — if CPU is low and state is `S` despite the user reporting \"stuck\", the most likely cause is a hung HTTPS request to the model API. macOS: `lsof -nP -i -p \u003Cpid> 2>\u002Fdev\u002Fnull | head -20` (the `-nP` flags skip reverse-DNS and port lookups, which can themselves hang). If `lsof` itself feels slow, prefix with `timeout 10` (or `gtimeout 10` on macOS with Homebrew coreutils). Linux: `ss -tnp 2>\u002Fdev\u002Fnull | grep \"pid=\u003Cpid>,\"`. Note that `ss -tnp`'s `-p` requires root or `CAP_NET_ADMIN` — without it, the PID column shows `-` and the grep returns empty. If you see no matches but `ss -t 2>\u002Fdev\u002Fnull` does show ESTABLISHED sockets, fall back to `lsof -nP -i -p \u003Cpid>` rather than reporting \"no connections\". A long-lived `ESTABLISHED` connection to a model host (dashscope, openai, anthropic, etc.) with no recent traffic is the smoking gun.\n   - **Debug log** — start with `\"$RUNTIME_DIR\"\u002Fdebug\u002Flatest` (symlink to the most recent session); if it matches the suspicious PID's session, that's usually the right one. Otherwise infer the session ID from the sidecar and read `\"$RUNTIME_DIR\"\u002Fdebug\u002F\u003Csession-id>.txt`. Bound the read with `tail -n 200 \u003Cpath>` — debug logs can be GB-sized. The last few hundred lines typically show what the session was doing before hanging. Debug logs may contain prompts, file contents, or tokens from other sessions — paste only lines relevant to the hang, and never quote secrets\u002FAPI keys you happen to see.\n\n4. **Consider a stack dump** for a truly frozen process (advanced, optional):\n   - macOS: `sample \u003Cpid> 3` gives a 3-second native stack sample. If `sample` itself seems to hang (the target's Mach task port may be wedged on a kernel-level freeze), wrap it: `timeout 15 sample \u003Cpid> 3` (or `gtimeout 15 ...` on Homebrew coreutils). Stack frames may include function arguments containing API keys or tokens held in memory — redact such values to `***` before including the dump in the report.\n   - Linux: `cat \u002Fproc\u002F\u003Cpid>\u002Fstack` for kernel stack (read-only, no `ptrace` permissions needed). Avoid `strace -p` for this purpose: it requires `CAP_SYS_PTRACE` (often denied under `kernel.yama.ptrace_scope=1`), and `strace -c` blocks until the target exits — it would hang on the very kind of stuck process you are diagnosing.\n   - This is big — only grab it if the process is clearly hung and you want to know _why_\n\n## Report\n\nPresent a structured diagnostic report directly to the user with these sections:\n\n**For each stuck\u002Fslow session found:**\n\n- PID, CPU%, RSS (in MB), process state, uptime, full command line\n- Child processes and their states\n- Your diagnosis of what's likely wrong\n- Relevant debug log tail if you captured it\n- Stack dump output if you captured it\n- Suggested next step for the user to decide (e.g., \"user may consider `kill \u003Cpid>` if the session is unresponsive\", \"likely waiting on I\u002FO — check disk\", \"accidentally stopped — user can resume with `kill -CONT \u003Cpid>`\"). Do not execute these actions yourself — present them as options for the user.\n\n**If every session looks healthy**, tell the user directly — no diagnostic dump needed. Mention how many sessions you checked and that none showed signs of being stuck.\n\n**If no sessions are found at all** (zero sidecars and zero matching `ps` rows), say so explicitly: which `RUNTIME_DIR` you searched and that `ps` returned no qwen-related processes for the current user. Suggest the session may have already exited.\n\n## Notes\n\n- Don't kill or signal any processes — this is diagnostic only.\n- If the user gave an argument (e.g., a specific PID or symptom), focus there first.\n",{"data":35,"body":40},{"name":4,"description":6,"argument-hint":36,"allowedTools":37},"[PID or symptom]",[38,39],"run_shell_command","read_file",{"type":41,"children":42},"root",[43,52,58,65,174,179,375,381,393,399,440,452,465,475,484,489,498,527,591,596,1204,1210,1215,1223,1272,1282,1314,1320],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"stuck-diagnose-frozenslow-qwen-code-sessions",[49],{"type":50,"value":51},"text","\u002Fstuck — diagnose frozen\u002Fslow Qwen Code sessions",{"type":44,"tag":53,"props":54,"children":55},"p",{},[56],{"type":50,"value":57},"The user thinks another Qwen Code session on this machine is frozen, stuck, or very slow. Investigate and present a diagnostic report.",{"type":44,"tag":59,"props":60,"children":62},"h2",{"id":61},"what-to-look-for",[63],{"type":50,"value":64},"What to look for",{"type":44,"tag":53,"props":66,"children":67},{},[68,70,77,79,85,87,93,95,101,103,109,111,117,119,125,127,133,135,141,143,149,151,157,159,164,166,172],{"type":50,"value":69},"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 (",{"type":44,"tag":71,"props":72,"children":74},"code",{"className":73},[],[75],{"type":50,"value":76},"#!\u002Fusr\u002Fbin\u002Fenv node",{"type":50,"value":78},"), the process name (",{"type":44,"tag":71,"props":80,"children":82},{"className":81},[],[83],{"type":50,"value":84},"comm",{"type":50,"value":86}," column) is always ",{"type":44,"tag":71,"props":88,"children":90},{"className":89},[],[91],{"type":50,"value":92},"node",{"type":50,"value":94}," (or ",{"type":44,"tag":71,"props":96,"children":98},{"className":97},[],[99],{"type":50,"value":100},"bun",{"type":50,"value":102}," if run with Bun). Identify Qwen Code sessions by looking at the ",{"type":44,"tag":71,"props":104,"children":106},{"className":105},[],[107],{"type":50,"value":108},"command",{"type":50,"value":110}," column for a script path inside a directory whose name starts with ",{"type":44,"tag":71,"props":112,"children":114},{"className":113},[],[115],{"type":50,"value":116},"qwen-code",{"type":50,"value":118}," (matches ",{"type":44,"tag":71,"props":120,"children":122},{"className":121},[],[123],{"type":50,"value":124},"qwen-code\u002F",{"type":50,"value":126},", ",{"type":44,"tag":71,"props":128,"children":130},{"className":129},[],[131],{"type":50,"value":132},"qwen-code-dev\u002F",{"type":50,"value":134},", worktree clones, etc.) — anchored to the start of the path or after ",{"type":44,"tag":71,"props":136,"children":138},{"className":137},[],[139],{"type":50,"value":140},"\u002F",{"type":50,"value":142}," so unrelated names like ",{"type":44,"tag":71,"props":144,"children":146},{"className":145},[],[147],{"type":50,"value":148},"analyze-qwen-code\u002F",{"type":50,"value":150}," don't false-match — or a bin invocation ending in ",{"type":44,"tag":71,"props":152,"children":154},{"className":153},[],[155],{"type":50,"value":156},"\u002Fqwen",{"type":50,"value":158}," (the global symlink). Avoid loose ",{"type":44,"tag":71,"props":160,"children":162},{"className":161},[],[163],{"type":50,"value":116},{"type":50,"value":165}," substring matching: it false-positives on plugin brokers that merely pass a qwen-code path as ",{"type":44,"tag":71,"props":167,"children":169},{"className":168},[],[170],{"type":50,"value":171},"--cwd",{"type":50,"value":173},".",{"type":44,"tag":53,"props":175,"children":176},{},[177],{"type":50,"value":178},"Signs of a stuck session:",{"type":44,"tag":180,"props":181,"children":182},"ul",{},[183,195,273,290,307,317,335],{"type":44,"tag":184,"props":185,"children":186},"li",{},[187,193],{"type":44,"tag":188,"props":189,"children":190},"strong",{},[191],{"type":50,"value":192},"High CPU (>=90%) sustained",{"type":50,"value":194}," — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.",{"type":44,"tag":184,"props":196,"children":197},{},[198,219,221,226,228,233,235,241,243,249,251,257,258,264,265,271],{"type":44,"tag":188,"props":199,"children":200},{},[201,203,209,211,217],{"type":50,"value":202},"Process state ",{"type":44,"tag":71,"props":204,"children":206},{"className":205},[],[207],{"type":50,"value":208},"D",{"type":50,"value":210}," \u002F ",{"type":44,"tag":71,"props":212,"children":214},{"className":213},[],[215],{"type":50,"value":216},"U",{"type":50,"value":218}," (uninterruptible sleep)",{"type":50,"value":220}," — often an I\u002FO hang. Linux uses ",{"type":44,"tag":71,"props":222,"children":224},{"className":223},[],[225],{"type":50,"value":208},{"type":50,"value":227},", macOS\u002FBSD uses ",{"type":44,"tag":71,"props":229,"children":231},{"className":230},[],[232],{"type":50,"value":216},{"type":50,"value":234},". The ",{"type":44,"tag":71,"props":236,"children":238},{"className":237},[],[239],{"type":50,"value":240},"state",{"type":50,"value":242}," column in ",{"type":44,"tag":71,"props":244,"children":246},{"className":245},[],[247],{"type":50,"value":248},"ps",{"type":50,"value":250}," output; first character matters (ignore modifiers like ",{"type":44,"tag":71,"props":252,"children":254},{"className":253},[],[255],{"type":50,"value":256},"+",{"type":50,"value":126},{"type":44,"tag":71,"props":259,"children":261},{"className":260},[],[262],{"type":50,"value":263},"s",{"type":50,"value":126},{"type":44,"tag":71,"props":266,"children":268},{"className":267},[],[269],{"type":50,"value":270},"\u003C",{"type":50,"value":272},").",{"type":44,"tag":184,"props":274,"children":275},{},[276,288],{"type":44,"tag":188,"props":277,"children":278},{},[279,280,286],{"type":50,"value":202},{"type":44,"tag":71,"props":281,"children":283},{"className":282},[],[284],{"type":50,"value":285},"T",{"type":50,"value":287}," (stopped)",{"type":50,"value":289}," — user probably hit Ctrl+Z by accident.",{"type":44,"tag":184,"props":291,"children":292},{},[293,305],{"type":44,"tag":188,"props":294,"children":295},{},[296,297,303],{"type":50,"value":202},{"type":44,"tag":71,"props":298,"children":300},{"className":299},[],[301],{"type":50,"value":302},"Z",{"type":50,"value":304}," (zombie)",{"type":50,"value":306}," — parent isn't reaping.",{"type":44,"tag":184,"props":308,"children":309},{},[310,315],{"type":44,"tag":188,"props":311,"children":312},{},[313],{"type":50,"value":314},"Very high RSS (>=4GB)",{"type":50,"value":316}," — possible memory leak making the session sluggish.",{"type":44,"tag":184,"props":318,"children":319},{},[320,333],{"type":44,"tag":188,"props":321,"children":322},{},[323,325,331],{"type":50,"value":324},"State ",{"type":44,"tag":71,"props":326,"children":328},{"className":327},[],[329],{"type":50,"value":330},"S",{"type":50,"value":332}," with low CPU",{"type":50,"value":334}," — 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.",{"type":44,"tag":184,"props":336,"children":337},{},[338,343,345,351,352,357,359,365,367,373],{"type":44,"tag":188,"props":339,"children":340},{},[341],{"type":50,"value":342},"Stuck child process",{"type":50,"value":344}," — a hung ",{"type":44,"tag":71,"props":346,"children":348},{"className":347},[],[349],{"type":50,"value":350},"git",{"type":50,"value":126},{"type":44,"tag":71,"props":353,"children":355},{"className":354},[],[356],{"type":50,"value":92},{"type":50,"value":358},", or shell subprocess can freeze the parent. Check ",{"type":44,"tag":71,"props":360,"children":362},{"className":361},[],[363],{"type":50,"value":364},"pgrep -P \u003Cpid>",{"type":50,"value":366}," (then ",{"type":44,"tag":71,"props":368,"children":370},{"className":369},[],[371],{"type":50,"value":372},"ps -p",{"type":50,"value":374}," for state — see step 3) for each session.",{"type":44,"tag":59,"props":376,"children":378},{"id":377},"argument-validation",[379],{"type":50,"value":380},"Argument validation",{"type":44,"tag":53,"props":382,"children":383},{},[384,386,391],{"type":50,"value":385},"If the user gave an argument, treat it as a PID ",{"type":44,"tag":188,"props":387,"children":388},{},[389],{"type":50,"value":390},"only if it consists entirely of digits 0-9",{"type":50,"value":392},". 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.",{"type":44,"tag":59,"props":394,"children":396},{"id":395},"investigation-steps",[397],{"type":50,"value":398},"Investigation steps",{"type":44,"tag":53,"props":400,"children":401},{},[402,407,409,415,417,423,425,431,433,439],{"type":44,"tag":188,"props":403,"children":404},{},[405],{"type":50,"value":406},"Preamble — resolve the runtime base directory.",{"type":50,"value":408}," 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): ",{"type":44,"tag":71,"props":410,"children":412},{"className":411},[],[413],{"type":50,"value":414},"QWEN_RUNTIME_DIR",{"type":50,"value":416}," env var, the ",{"type":44,"tag":71,"props":418,"children":420},{"className":419},[],[421],{"type":50,"value":422},"advanced.runtimeOutputDir",{"type":50,"value":424}," setting, ",{"type":44,"tag":71,"props":426,"children":428},{"className":427},[],[429],{"type":50,"value":430},"QWEN_HOME",{"type":50,"value":432}," env var, and finally ",{"type":44,"tag":71,"props":434,"children":436},{"className":435},[],[437],{"type":50,"value":438},"~\u002F.qwen",{"type":50,"value":173},{"type":44,"tag":441,"props":442,"children":446},"pre",{"className":443,"code":445,"language":50},[444],"language-text","RUNTIME_DIR=\"${QWEN_RUNTIME_DIR:-}\"\n[ -z \"$RUNTIME_DIR\" ] && command -v jq >\u002Fdev\u002Fnull && RUNTIME_DIR=$(jq -r '.advanced.runtimeOutputDir \u002F\u002F empty' \"${QWEN_HOME:-$HOME\u002F.qwen}\u002Fsettings.json\" 2>\u002Fdev\u002Fnull)\n# `advanced.runtimeOutputDir` may be `~\u002F...` or relative; mirror Storage.resolvePath() before using in globs\n[ -n \"$RUNTIME_DIR\" ] && RUNTIME_DIR=\"${RUNTIME_DIR\u002F#\\~\u002F$HOME}\"\n[ -n \"$RUNTIME_DIR\" ] && case \"$RUNTIME_DIR\" in \u002F*) ;; *) RUNTIME_DIR=\"$(cd \"$RUNTIME_DIR\" 2>\u002Fdev\u002Fnull && pwd)\" || RUNTIME_DIR=\"\" ;; esac\nRUNTIME_DIR=\"${RUNTIME_DIR:-${QWEN_HOME:-$HOME\u002F.qwen}}\"\n",[447],{"type":44,"tag":71,"props":448,"children":450},{"__ignoreMap":449},"",[451],{"type":50,"value":445},{"type":44,"tag":53,"props":453,"children":454},{},[455,457,463],{"type":50,"value":456},"(If ",{"type":44,"tag":71,"props":458,"children":460},{"className":459},[],[461],{"type":50,"value":462},"jq",{"type":50,"value":464}," isn't installed, the settings layer is silently skipped — the env-var \u002F default fallback covers the common case.)",{"type":44,"tag":53,"props":466,"children":467},{},[468,473],{"type":44,"tag":188,"props":469,"children":470},{},[471],{"type":50,"value":472},"Fast path for targeted diagnosis",{"type":50,"value":474}," — 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:",{"type":44,"tag":441,"props":476,"children":479},{"className":477,"code":478,"language":50},[444],"kill -0 \u003Cpid> 2>\u002Fdev\u002Fnull || { echo \"PID \u003Cpid> is dead, or owned by another user\"; exit 0; }\nps -p \u003Cpid> -o command= -ww 2>\u002Fdev\u002Fnull | grep -qE '((^|\u002F)qwen-code[^ \u002F]*\u002F[^ ]*\\.(js|ts|mjs|cjs)( |$)|\u002Fqwen( |$))' || { echo \"PID \u003Cpid> is yours but is not a Qwen Code process — refusing to dump details\"; exit 0; }\n",[480],{"type":44,"tag":71,"props":481,"children":482},{"__ignoreMap":449},[483],{"type":50,"value":478},{"type":44,"tag":53,"props":485,"children":486},{},[487],{"type":50,"value":488},"If either guard prints, stop the diagnostic and surface the message verbatim. Otherwise, gather stats and the sidecar mapping, then jump to step 3:",{"type":44,"tag":441,"props":490,"children":493},{"className":491,"code":492,"language":50},[444],"ps -p \u003Cpid> -o pid=,pcpu=,rss=,etime=,state=,comm=,command= -ww\ngrep -El '\"pid\"[[:space:]]*:[[:space:]]*\u003Cpid>\\b' \"$RUNTIME_DIR\"\u002Fprojects\u002F*\u002Fchats\u002F*.runtime.json 2>\u002Fdev\u002Fnull\n",[494],{"type":44,"tag":71,"props":495,"children":496},{"__ignoreMap":449},[497],{"type":50,"value":492},{"type":44,"tag":53,"props":499,"children":500},{},[501,503,509,511,517,519,525],{"type":50,"value":502},"Note: as in step 2, the ",{"type":44,"tag":71,"props":504,"children":506},{"className":505},[],[507],{"type":50,"value":508},"command=",{"type":50,"value":510}," column may include credentials passed as CLI args (e.g., ",{"type":44,"tag":71,"props":512,"children":514},{"className":513},[],[515],{"type":50,"value":516},"--openai-api-key=sk-…",{"type":50,"value":518},"). Redact such values to ",{"type":44,"tag":71,"props":520,"children":522},{"className":521},[],[523],{"type":50,"value":524},"***",{"type":50,"value":526}," before quoting them in the report.",{"type":44,"tag":53,"props":528,"children":529},{},[530,536,538,544,546,552,554,559,561,566,568,574,576,582,584,590],{"type":44,"tag":71,"props":531,"children":533},{"className":532},[],[534],{"type":50,"value":535},"-E",{"type":50,"value":537}," is required so ",{"type":44,"tag":71,"props":539,"children":541},{"className":540},[],[542],{"type":50,"value":543},"\\b",{"type":50,"value":545}," is interpreted as word boundary (BSD ",{"type":44,"tag":71,"props":547,"children":549},{"className":548},[],[550],{"type":50,"value":551},"grep",{"type":50,"value":553}," without ",{"type":44,"tag":71,"props":555,"children":557},{"className":556},[],[558],{"type":50,"value":535},{"type":50,"value":560}," treats ",{"type":44,"tag":71,"props":562,"children":564},{"className":563},[],[565],{"type":50,"value":543},{"type":50,"value":567}," as a backspace character, silently returning nothing on macOS). The ",{"type":44,"tag":71,"props":569,"children":571},{"className":570},[],[572],{"type":50,"value":573},"-l",{"type":50,"value":575}," flag returns the matching sidecar file path; the basename (stripped of ",{"type":44,"tag":71,"props":577,"children":579},{"className":578},[],[580],{"type":50,"value":581},".runtime.json",{"type":50,"value":583},") is the session ID for step 3's debug log read. If multiple sidecars match (rare — happens only after PID reuse leaves a stale file), prefer the most recently modified one: ",{"type":44,"tag":71,"props":585,"children":587},{"className":586},[],[588],{"type":50,"value":589},"ls -t \u003Cmatches> | head -n 1",{"type":50,"value":173},{"type":44,"tag":53,"props":592,"children":593},{},[594],{"type":50,"value":595},"Otherwise (no arg, or symptom-only arg), run the general path below:",{"type":44,"tag":597,"props":598,"children":599},"ol",{},[600,706,858,1084],{"type":44,"tag":184,"props":601,"children":602},{},[603,608,610,614,616,622,624,630,632,638,640,646,648,651,653,659,661,666,668,677,680,682,687,689,692,697,699,704],{"type":44,"tag":188,"props":604,"children":605},{},[606],{"type":50,"value":607},"Enumerate live sessions via the runtime sidecar",{"type":50,"value":609}," (preferred, reliable):",{"type":44,"tag":611,"props":612,"children":613},"br",{},[],{"type":50,"value":615},"Qwen Code writes a ",{"type":44,"tag":71,"props":617,"children":619},{"className":618},[],[620],{"type":50,"value":621},"runtime.json",{"type":50,"value":623}," sidecar for each interactive session at ",{"type":44,"tag":71,"props":625,"children":627},{"className":626},[],[628],{"type":50,"value":629},"\"$RUNTIME_DIR\"\u002Fprojects\u002F\u003Csanitized-cwd>\u002Fchats\u002F\u003CsessionId>.runtime.json",{"type":50,"value":631},". Each file contains ",{"type":44,"tag":71,"props":633,"children":635},{"className":634},[],[636],{"type":50,"value":637},"{schema_version, pid, session_id, work_dir, hostname, started_at, qwen_version}",{"type":50,"value":639}," — the authoritative source of ",{"type":44,"tag":71,"props":641,"children":643},{"className":642},[],[644],{"type":50,"value":645},"(pid, session_id, work_dir)",{"type":50,"value":647}," mappings.",{"type":44,"tag":611,"props":649,"children":650},{},[],{"type":50,"value":652},"Filter to live ",{"type":44,"tag":71,"props":654,"children":656},{"className":655},[],[657],{"type":50,"value":658},"(pid, sidecar-path)",{"type":50,"value":660}," pairs in one shot. Use Node (guaranteed available — qwen-code requires it) instead of ",{"type":44,"tag":71,"props":662,"children":664},{"className":663},[],[665],{"type":50,"value":462},{"type":50,"value":667}," (often missing on default macOS \u002F minimal Linux) so this path doesn't silently degrade:",{"type":44,"tag":441,"props":669,"children":672},{"className":670,"code":671,"language":50},[444],"node -e 'const fs=require(\"fs\"); for (const f of process.argv.slice(1)) { try { const p=JSON.parse(fs.readFileSync(f,\"utf8\")).pid; if (p) { try { process.kill(p,0); console.log(p+\" \"+f); } catch {} } } catch {} }' \"$RUNTIME_DIR\"\u002Fprojects\u002F*\u002Fchats\u002F*.runtime.json 2>\u002Fdev\u002Fnull\n",[673],{"type":44,"tag":71,"props":674,"children":675},{"__ignoreMap":449},[676],{"type":50,"value":671},{"type":44,"tag":611,"props":678,"children":679},{},[],{"type":50,"value":681},"PID reuse is rare but possible — when you cross-reference with ",{"type":44,"tag":71,"props":683,"children":685},{"className":684},[],[686],{"type":50,"value":248},{"type":50,"value":688}," in step 2, skip pairs whose live PID's command line no longer looks like a Qwen Code process.",{"type":44,"tag":611,"props":690,"children":691},{},[],{"type":44,"tag":188,"props":693,"children":694},{},[695],{"type":50,"value":696},"If the command emits nothing",{"type":50,"value":698}," (no sidecars, or no live PIDs), fall through to step 2 — ",{"type":44,"tag":71,"props":700,"children":702},{"className":701},[],[703],{"type":50,"value":248},{"type":50,"value":705}," is the working fallback.",{"type":44,"tag":184,"props":707,"children":708},{},[709,719,721,730,733,739,741,747,749,754,756,761,763,768,770,775,777,782,784,790,792,797,799,802,804,809,811,817,819,824,826,832,834,839,841,844,846,851,852,857],{"type":44,"tag":188,"props":710,"children":711},{},[712,714],{"type":50,"value":713},"List Qwen Code processes via ",{"type":44,"tag":71,"props":715,"children":717},{"className":716},[],[718],{"type":50,"value":248},{"type":50,"value":720}," (macOS\u002FLinux) — used to enrich each live session with CPU\u002FRSS\u002Fstate\u002Fuptime, and to catch sessions that may have started before the sidecar feature existed:",{"type":44,"tag":441,"props":722,"children":725},{"className":723,"code":724,"language":50},[444],"ps -xo pid=,pcpu=,rss=,etime=,state=,comm=,command= -u \"$(id -u)\" -ww | grep -E '((^|\u002F)qwen-code[^ \u002F]*\u002F[^ ]*\\.(js|ts|mjs|cjs)( |$)|\u002Fqwen( |$))' | grep -v grep\n",[726],{"type":44,"tag":71,"props":727,"children":728},{"__ignoreMap":449},[729],{"type":50,"value":724},{"type":44,"tag":611,"props":731,"children":732},{},[],{"type":44,"tag":71,"props":734,"children":736},{"className":735},[],[737],{"type":50,"value":738},"-u \"$(id -u)\"",{"type":50,"value":740}," restricts the scan to the current user — on shared hosts this avoids exposing other users' Qwen process paths\u002Farguments into the chat. ",{"type":44,"tag":71,"props":742,"children":744},{"className":743},[],[745],{"type":50,"value":746},"-ww",{"type":50,"value":748}," disables column truncation so long \"qwen\" paths aren't cut off. The ",{"type":44,"tag":71,"props":750,"children":752},{"className":751},[],[753],{"type":50,"value":84},{"type":50,"value":755}," column will be ",{"type":44,"tag":71,"props":757,"children":759},{"className":758},[],[760],{"type":50,"value":92},{"type":50,"value":762}," or ",{"type":44,"tag":71,"props":764,"children":766},{"className":765},[],[767],{"type":50,"value":100},{"type":50,"value":769},", not ",{"type":44,"tag":71,"props":771,"children":773},{"className":772},[],[774],{"type":50,"value":8},{"type":50,"value":776},"; filter to rows where the ",{"type":44,"tag":71,"props":778,"children":780},{"className":779},[],[781],{"type":50,"value":108},{"type":50,"value":783}," column contains a qwen path (e.g., ",{"type":44,"tag":71,"props":785,"children":787},{"className":786},[],[788],{"type":50,"value":789},"qwen-code\u002Fdist\u002Fcli.js",{"type":50,"value":791},", or a bin symlink ending in ",{"type":44,"tag":71,"props":793,"children":795},{"className":794},[],[796],{"type":50,"value":156},{"type":50,"value":798},"). Cross-reference with the PIDs from step 1.",{"type":44,"tag":611,"props":800,"children":801},{},[],{"type":50,"value":803},"Note: ",{"type":44,"tag":71,"props":805,"children":807},{"className":806},[],[808],{"type":50,"value":248},{"type":50,"value":810}," reports ",{"type":44,"tag":71,"props":812,"children":814},{"className":813},[],[815],{"type":50,"value":816},"rss",{"type":50,"value":818}," in ",{"type":44,"tag":188,"props":820,"children":821},{},[822],{"type":50,"value":823},"kilobytes",{"type":50,"value":825}," on both macOS and Linux. To report in MB, divide by 1024; to report in GB, divide by 1048576. The 4GB threshold is ",{"type":44,"tag":71,"props":827,"children":829},{"className":828},[],[830],{"type":50,"value":831},"4194304",{"type":50,"value":833}," KB — compare the raw ",{"type":44,"tag":71,"props":835,"children":837},{"className":836},[],[838],{"type":50,"value":816},{"type":50,"value":840}," value against that, or compare the GB value against 4. Do not divide once and then compare against 4; that would flag every process >4MB as \"very high RSS\".",{"type":44,"tag":611,"props":842,"children":843},{},[],{"type":50,"value":845},"Note: full command lines may contain credentials passed as CLI args (e.g., ",{"type":44,"tag":71,"props":847,"children":849},{"className":848},[],[850],{"type":50,"value":516},{"type":50,"value":518},{"type":44,"tag":71,"props":853,"children":855},{"className":854},[],[856],{"type":50,"value":524},{"type":50,"value":526},{"type":44,"tag":184,"props":859,"children":860},{},[861,866,868,873,875,880,882],{"type":44,"tag":188,"props":862,"children":863},{},[864],{"type":50,"value":865},"For anything suspicious",{"type":50,"value":867},", gather more context. If the process state alone explains the problem (",{"type":44,"tag":71,"props":869,"children":871},{"className":870},[],[872],{"type":50,"value":285},{"type":50,"value":874}," = accidentally stopped, ",{"type":44,"tag":71,"props":876,"children":878},{"className":877},[],[879],{"type":50,"value":302},{"type":50,"value":881}," = parent not reaping), skip directly to the report — child \u002F log \u002F stack inspection adds nothing. Otherwise:",{"type":44,"tag":180,"props":883,"children":884},{},[885,925,930,1050],{"type":44,"tag":184,"props":886,"children":887},{},[888,890,895,896,901,903,909,911,916,918,923],{"type":50,"value":889},"Child processes (with state, so a hung ",{"type":44,"tag":71,"props":891,"children":893},{"className":892},[],[894],{"type":50,"value":350},{"type":50,"value":210},{"type":44,"tag":71,"props":897,"children":899},{"className":898},[],[900],{"type":50,"value":92},{"type":50,"value":902}," shows up): ",{"type":44,"tag":71,"props":904,"children":906},{"className":905},[],[907],{"type":50,"value":908},"CHILDREN=$(pgrep -P \u003Cpid> | tr '\\n' ',' | sed 's\u002F,$\u002F\u002F'); [ -n \"$CHILDREN\" ] && ps -p \"$CHILDREN\" -o pid=,ppid=,pcpu=,state=,etime=,command= -ww",{"type":50,"value":910},". Single ",{"type":44,"tag":71,"props":912,"children":914},{"className":913},[],[915],{"type":50,"value":248},{"type":50,"value":917}," call (avoids forking one per child) and ",{"type":44,"tag":71,"props":919,"children":921},{"className":920},[],[922],{"type":50,"value":746},{"type":50,"value":924}," so long child command lines aren't truncated.",{"type":44,"tag":184,"props":926,"children":927},{},[928],{"type":50,"value":929},"If high CPU: sample again after 1-2s to confirm it's sustained",{"type":44,"tag":184,"props":931,"children":932},{},[933,938,940,945,947,953,955,961,963,969,971,977,978,984,986,992,994,1000,1002,1008,1010,1016,1018,1024,1026,1032,1034,1040,1042,1048],{"type":44,"tag":188,"props":934,"children":935},{},[936],{"type":50,"value":937},"Network hang",{"type":50,"value":939}," — if CPU is low and state is ",{"type":44,"tag":71,"props":941,"children":943},{"className":942},[],[944],{"type":50,"value":330},{"type":50,"value":946}," despite the user reporting \"stuck\", the most likely cause is a hung HTTPS request to the model API. macOS: ",{"type":44,"tag":71,"props":948,"children":950},{"className":949},[],[951],{"type":50,"value":952},"lsof -nP -i -p \u003Cpid> 2>\u002Fdev\u002Fnull | head -20",{"type":50,"value":954}," (the ",{"type":44,"tag":71,"props":956,"children":958},{"className":957},[],[959],{"type":50,"value":960},"-nP",{"type":50,"value":962}," flags skip reverse-DNS and port lookups, which can themselves hang). If ",{"type":44,"tag":71,"props":964,"children":966},{"className":965},[],[967],{"type":50,"value":968},"lsof",{"type":50,"value":970}," itself feels slow, prefix with ",{"type":44,"tag":71,"props":972,"children":974},{"className":973},[],[975],{"type":50,"value":976},"timeout 10",{"type":50,"value":94},{"type":44,"tag":71,"props":979,"children":981},{"className":980},[],[982],{"type":50,"value":983},"gtimeout 10",{"type":50,"value":985}," on macOS with Homebrew coreutils). Linux: ",{"type":44,"tag":71,"props":987,"children":989},{"className":988},[],[990],{"type":50,"value":991},"ss -tnp 2>\u002Fdev\u002Fnull | grep \"pid=\u003Cpid>,\"",{"type":50,"value":993},". Note that ",{"type":44,"tag":71,"props":995,"children":997},{"className":996},[],[998],{"type":50,"value":999},"ss -tnp",{"type":50,"value":1001},"'s ",{"type":44,"tag":71,"props":1003,"children":1005},{"className":1004},[],[1006],{"type":50,"value":1007},"-p",{"type":50,"value":1009}," requires root or ",{"type":44,"tag":71,"props":1011,"children":1013},{"className":1012},[],[1014],{"type":50,"value":1015},"CAP_NET_ADMIN",{"type":50,"value":1017}," — without it, the PID column shows ",{"type":44,"tag":71,"props":1019,"children":1021},{"className":1020},[],[1022],{"type":50,"value":1023},"-",{"type":50,"value":1025}," and the grep returns empty. If you see no matches but ",{"type":44,"tag":71,"props":1027,"children":1029},{"className":1028},[],[1030],{"type":50,"value":1031},"ss -t 2>\u002Fdev\u002Fnull",{"type":50,"value":1033}," does show ESTABLISHED sockets, fall back to ",{"type":44,"tag":71,"props":1035,"children":1037},{"className":1036},[],[1038],{"type":50,"value":1039},"lsof -nP -i -p \u003Cpid>",{"type":50,"value":1041}," rather than reporting \"no connections\". A long-lived ",{"type":44,"tag":71,"props":1043,"children":1045},{"className":1044},[],[1046],{"type":50,"value":1047},"ESTABLISHED",{"type":50,"value":1049}," connection to a model host (dashscope, openai, anthropic, etc.) with no recent traffic is the smoking gun.",{"type":44,"tag":184,"props":1051,"children":1052},{},[1053,1058,1060,1066,1068,1074,1076,1082],{"type":44,"tag":188,"props":1054,"children":1055},{},[1056],{"type":50,"value":1057},"Debug log",{"type":50,"value":1059}," — start with ",{"type":44,"tag":71,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":50,"value":1065},"\"$RUNTIME_DIR\"\u002Fdebug\u002Flatest",{"type":50,"value":1067}," (symlink to the most recent session); if it matches the suspicious PID's session, that's usually the right one. Otherwise infer the session ID from the sidecar and read ",{"type":44,"tag":71,"props":1069,"children":1071},{"className":1070},[],[1072],{"type":50,"value":1073},"\"$RUNTIME_DIR\"\u002Fdebug\u002F\u003Csession-id>.txt",{"type":50,"value":1075},". Bound the read with ",{"type":44,"tag":71,"props":1077,"children":1079},{"className":1078},[],[1080],{"type":50,"value":1081},"tail -n 200 \u003Cpath>",{"type":50,"value":1083}," — debug logs can be GB-sized. The last few hundred lines typically show what the session was doing before hanging. Debug logs may contain prompts, file contents, or tokens from other sessions — paste only lines relevant to the hang, and never quote secrets\u002FAPI keys you happen to see.",{"type":44,"tag":184,"props":1085,"children":1086},{},[1087,1092,1094],{"type":44,"tag":188,"props":1088,"children":1089},{},[1090],{"type":50,"value":1091},"Consider a stack dump",{"type":50,"value":1093}," for a truly frozen process (advanced, optional):",{"type":44,"tag":180,"props":1095,"children":1096},{},[1097,1140,1193],{"type":44,"tag":184,"props":1098,"children":1099},{},[1100,1102,1108,1110,1116,1118,1124,1125,1131,1133,1138],{"type":50,"value":1101},"macOS: ",{"type":44,"tag":71,"props":1103,"children":1105},{"className":1104},[],[1106],{"type":50,"value":1107},"sample \u003Cpid> 3",{"type":50,"value":1109}," gives a 3-second native stack sample. If ",{"type":44,"tag":71,"props":1111,"children":1113},{"className":1112},[],[1114],{"type":50,"value":1115},"sample",{"type":50,"value":1117}," itself seems to hang (the target's Mach task port may be wedged on a kernel-level freeze), wrap it: ",{"type":44,"tag":71,"props":1119,"children":1121},{"className":1120},[],[1122],{"type":50,"value":1123},"timeout 15 sample \u003Cpid> 3",{"type":50,"value":94},{"type":44,"tag":71,"props":1126,"children":1128},{"className":1127},[],[1129],{"type":50,"value":1130},"gtimeout 15 ...",{"type":50,"value":1132}," on Homebrew coreutils). Stack frames may include function arguments containing API keys or tokens held in memory — redact such values to ",{"type":44,"tag":71,"props":1134,"children":1136},{"className":1135},[],[1137],{"type":50,"value":524},{"type":50,"value":1139}," before including the dump in the report.",{"type":44,"tag":184,"props":1141,"children":1142},{},[1143,1145,1151,1153,1159,1161,1167,1169,1175,1177,1183,1185,1191],{"type":50,"value":1144},"Linux: ",{"type":44,"tag":71,"props":1146,"children":1148},{"className":1147},[],[1149],{"type":50,"value":1150},"cat \u002Fproc\u002F\u003Cpid>\u002Fstack",{"type":50,"value":1152}," for kernel stack (read-only, no ",{"type":44,"tag":71,"props":1154,"children":1156},{"className":1155},[],[1157],{"type":50,"value":1158},"ptrace",{"type":50,"value":1160}," permissions needed). Avoid ",{"type":44,"tag":71,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":50,"value":1166},"strace -p",{"type":50,"value":1168}," for this purpose: it requires ",{"type":44,"tag":71,"props":1170,"children":1172},{"className":1171},[],[1173],{"type":50,"value":1174},"CAP_SYS_PTRACE",{"type":50,"value":1176}," (often denied under ",{"type":44,"tag":71,"props":1178,"children":1180},{"className":1179},[],[1181],{"type":50,"value":1182},"kernel.yama.ptrace_scope=1",{"type":50,"value":1184},"), and ",{"type":44,"tag":71,"props":1186,"children":1188},{"className":1187},[],[1189],{"type":50,"value":1190},"strace -c",{"type":50,"value":1192}," blocks until the target exits — it would hang on the very kind of stuck process you are diagnosing.",{"type":44,"tag":184,"props":1194,"children":1195},{},[1196,1198],{"type":50,"value":1197},"This is big — only grab it if the process is clearly hung and you want to know ",{"type":44,"tag":1199,"props":1200,"children":1201},"em",{},[1202],{"type":50,"value":1203},"why",{"type":44,"tag":59,"props":1205,"children":1207},{"id":1206},"report",[1208],{"type":50,"value":1209},"Report",{"type":44,"tag":53,"props":1211,"children":1212},{},[1213],{"type":50,"value":1214},"Present a structured diagnostic report directly to the user with these sections:",{"type":44,"tag":53,"props":1216,"children":1217},{},[1218],{"type":44,"tag":188,"props":1219,"children":1220},{},[1221],{"type":50,"value":1222},"For each stuck\u002Fslow session found:",{"type":44,"tag":180,"props":1224,"children":1225},{},[1226,1231,1236,1241,1246,1251],{"type":44,"tag":184,"props":1227,"children":1228},{},[1229],{"type":50,"value":1230},"PID, CPU%, RSS (in MB), process state, uptime, full command line",{"type":44,"tag":184,"props":1232,"children":1233},{},[1234],{"type":50,"value":1235},"Child processes and their states",{"type":44,"tag":184,"props":1237,"children":1238},{},[1239],{"type":50,"value":1240},"Your diagnosis of what's likely wrong",{"type":44,"tag":184,"props":1242,"children":1243},{},[1244],{"type":50,"value":1245},"Relevant debug log tail if you captured it",{"type":44,"tag":184,"props":1247,"children":1248},{},[1249],{"type":50,"value":1250},"Stack dump output if you captured it",{"type":44,"tag":184,"props":1252,"children":1253},{},[1254,1256,1262,1264,1270],{"type":50,"value":1255},"Suggested next step for the user to decide (e.g., \"user may consider ",{"type":44,"tag":71,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":50,"value":1261},"kill \u003Cpid>",{"type":50,"value":1263}," if the session is unresponsive\", \"likely waiting on I\u002FO — check disk\", \"accidentally stopped — user can resume with ",{"type":44,"tag":71,"props":1265,"children":1267},{"className":1266},[],[1268],{"type":50,"value":1269},"kill -CONT \u003Cpid>",{"type":50,"value":1271},"\"). Do not execute these actions yourself — present them as options for the user.",{"type":44,"tag":53,"props":1273,"children":1274},{},[1275,1280],{"type":44,"tag":188,"props":1276,"children":1277},{},[1278],{"type":50,"value":1279},"If every session looks healthy",{"type":50,"value":1281},", tell the user directly — no diagnostic dump needed. Mention how many sessions you checked and that none showed signs of being stuck.",{"type":44,"tag":53,"props":1283,"children":1284},{},[1285,1290,1292,1297,1299,1305,1307,1312],{"type":44,"tag":188,"props":1286,"children":1287},{},[1288],{"type":50,"value":1289},"If no sessions are found at all",{"type":50,"value":1291}," (zero sidecars and zero matching ",{"type":44,"tag":71,"props":1293,"children":1295},{"className":1294},[],[1296],{"type":50,"value":248},{"type":50,"value":1298}," rows), say so explicitly: which ",{"type":44,"tag":71,"props":1300,"children":1302},{"className":1301},[],[1303],{"type":50,"value":1304},"RUNTIME_DIR",{"type":50,"value":1306}," you searched and that ",{"type":44,"tag":71,"props":1308,"children":1310},{"className":1309},[],[1311],{"type":50,"value":248},{"type":50,"value":1313}," returned no qwen-related processes for the current user. Suggest the session may have already exited.",{"type":44,"tag":59,"props":1315,"children":1317},{"id":1316},"notes",[1318],{"type":50,"value":1319},"Notes",{"type":44,"tag":180,"props":1321,"children":1322},{},[1323,1328],{"type":44,"tag":184,"props":1324,"children":1325},{},[1326],{"type":50,"value":1327},"Don't kill or signal any processes — this is diagnostic only.",{"type":44,"tag":184,"props":1329,"children":1330},{},[1331],{"type":50,"value":1332},"If the user gave an argument (e.g., a specific PID or symptom), focus there first.",{"items":1334,"total":1441},[1335,1348,1367,1383,1399,1413,1427],{"slug":1336,"name":1336,"fn":1337,"description":1338,"org":1339,"tags":1340,"stars":23,"repoUrl":24,"updatedAt":1347},"batch","execute parallel batch operations on files","Execute batch operations on multiple files in parallel. Automatically discovers files, splits into chunks, and processes with parallel worker agents. Use `\u002Fbatch` followed by operation and file pattern.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1341,1344],{"name":1342,"slug":1343,"type":16},"Automation","automation",{"name":1345,"slug":1346,"type":16},"Concurrency","concurrency","2026-07-20T05:58:45.650067",{"slug":1349,"name":1349,"fn":1350,"description":1351,"org":1352,"tags":1353,"stars":23,"repoUrl":24,"updatedAt":1366},"cua-driver-rs","drive native GUI applications via MCP","Drive a native GUI app (macOS, Windows, Linux) via the cua-driver CLI (default) or MCP server — snapshot its accessibility tree, click\u002Ftype\u002Fscroll by element_index or pixel coords, verify via re-snapshot, all without bringing the target to the foreground. Use when the user asks you to operate, drive, automate, or perform a GUI task in a real application on the host.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1354,1357,1360,1363],{"name":1355,"slug":1356,"type":16},"Accessibility","accessibility",{"name":1358,"slug":1359,"type":16},"Browser Automation","browser-automation",{"name":1361,"slug":1362,"type":16},"Desktop","desktop",{"name":1364,"slug":1365,"type":16},"MCP","mcp","2026-07-16T05:59:28.687299",{"slug":1368,"name":1368,"fn":1369,"description":1370,"org":1371,"tags":1372,"stars":23,"repoUrl":24,"updatedAt":1382},"dataviz","design and validate data visualizations","Design guidance for charts, graphs, dashboards, maps, and data visualizations, including a local palette validator.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1373,1376,1379],{"name":1374,"slug":1375,"type":16},"Charts","charts",{"name":1377,"slug":1378,"type":16},"Dashboards","dashboards",{"name":1380,"slug":1381,"type":16},"Data Visualization","data-visualization","2026-07-16T05:59:28.31755",{"slug":1384,"name":1384,"fn":1385,"description":1386,"org":1387,"tags":1388,"stars":23,"repoUrl":24,"updatedAt":1398},"extension-creator","create Qwen Code extensions","Create, scaffold, customize, validate, and locally test Qwen Code extensions. Use when the user wants a new Qwen Code extension, needs help choosing an extension template, wants to add QWEN.md context, commands, skills, agents, MCP servers, settings, hooks, channels, or LSP servers, or asks how to link and test an extension locally. Invoke with `\u002Fextension-creator` followed by an extension path and optional template name.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1389,1392,1395],{"name":1390,"slug":1391,"type":16},"Coding","coding",{"name":1393,"slug":1394,"type":16},"Documentation","documentation",{"name":1396,"slug":1397,"type":16},"Plugin Development","plugin-development","2026-07-16T05:59:24.818967",{"slug":1400,"name":1400,"fn":1401,"description":1402,"org":1403,"tags":1404,"stars":23,"repoUrl":24,"updatedAt":1412},"loop","run scheduled or self-paced prompt loops","Create a loop that runs a prompt now and follows up either on a fixed schedule or through self-paced wakeups. Usage - \u002Floop check the build, \u002Floop 5m check the build, \u002Floop check the PR every 30m. \u002Floop list to show jobs, \u002Floop clear to cancel all.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1405,1406,1409],{"name":1342,"slug":1343,"type":16},{"name":1407,"slug":1408,"type":16},"Productivity","productivity",{"name":1410,"slug":1411,"type":16},"Scheduling","scheduling","2026-07-16T05:59:25.50027",{"slug":1414,"name":1414,"fn":1415,"description":1416,"org":1417,"tags":1418,"stars":23,"repoUrl":24,"updatedAt":1426},"new-app","build new applications from scratch","Workflow for creating new applications from scratch. Covers requirements gathering, tech stack selection, scaffolding, implementation, and delivery of a functional prototype.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1419,1420,1423],{"name":18,"slug":19,"type":16},{"name":1421,"slug":1422,"type":16},"Prototyping","prototyping",{"name":1424,"slug":1425,"type":16},"Web Development","web-development","2026-07-16T05:59:25.157573",{"slug":1428,"name":1428,"fn":1429,"description":1430,"org":1431,"tags":1432,"stars":23,"repoUrl":24,"updatedAt":1440},"qc-helper","provide Qwen Code usage and configuration support","Answer any question about Qwen Code usage, features, configuration, and troubleshooting by referencing the official user documentation. Also helps users view or modify their settings.json. Invoke with `\u002Fqc-helper` followed by a question, e.g. `\u002Fqc-helper how do I configure MCP servers?` or `\u002Fqc-helper change approval mode to yolo`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1433,1436,1437],{"name":1434,"slug":1435,"type":16},"Configuration","configuration",{"name":1393,"slug":1394,"type":16},{"name":1438,"slug":1439,"type":16},"Reference","reference","2026-07-16T05:59:29.118413",10,{"items":1443,"total":1550},[1444,1449,1456,1462,1468,1474,1480,1486,1499,1511,1517,1532],{"slug":1336,"name":1336,"fn":1337,"description":1338,"org":1445,"tags":1446,"stars":23,"repoUrl":24,"updatedAt":1347},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1447,1448],{"name":1342,"slug":1343,"type":16},{"name":1345,"slug":1346,"type":16},{"slug":1349,"name":1349,"fn":1350,"description":1351,"org":1450,"tags":1451,"stars":23,"repoUrl":24,"updatedAt":1366},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1452,1453,1454,1455],{"name":1355,"slug":1356,"type":16},{"name":1358,"slug":1359,"type":16},{"name":1361,"slug":1362,"type":16},{"name":1364,"slug":1365,"type":16},{"slug":1368,"name":1368,"fn":1369,"description":1370,"org":1457,"tags":1458,"stars":23,"repoUrl":24,"updatedAt":1382},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1459,1460,1461],{"name":1374,"slug":1375,"type":16},{"name":1377,"slug":1378,"type":16},{"name":1380,"slug":1381,"type":16},{"slug":1384,"name":1384,"fn":1385,"description":1386,"org":1463,"tags":1464,"stars":23,"repoUrl":24,"updatedAt":1398},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1465,1466,1467],{"name":1390,"slug":1391,"type":16},{"name":1393,"slug":1394,"type":16},{"name":1396,"slug":1397,"type":16},{"slug":1400,"name":1400,"fn":1401,"description":1402,"org":1469,"tags":1470,"stars":23,"repoUrl":24,"updatedAt":1412},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1471,1472,1473],{"name":1342,"slug":1343,"type":16},{"name":1407,"slug":1408,"type":16},{"name":1410,"slug":1411,"type":16},{"slug":1414,"name":1414,"fn":1415,"description":1416,"org":1475,"tags":1476,"stars":23,"repoUrl":24,"updatedAt":1426},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1477,1478,1479],{"name":18,"slug":19,"type":16},{"name":1421,"slug":1422,"type":16},{"name":1424,"slug":1425,"type":16},{"slug":1428,"name":1428,"fn":1429,"description":1430,"org":1481,"tags":1482,"stars":23,"repoUrl":24,"updatedAt":1440},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1483,1484,1485],{"name":1434,"slug":1435,"type":16},{"name":1393,"slug":1394,"type":16},{"name":1438,"slug":1439,"type":16},{"slug":1487,"name":1487,"fn":1488,"description":1489,"org":1490,"tags":1491,"stars":23,"repoUrl":24,"updatedAt":1498},"review","review code for quality and security","Review changed code for correctness, security, code quality, and performance. Use when the user asks to review code changes, a PR, or specific files. Invoke with `\u002Freview`, `\u002Freview \u003Cpr-number>`, `\u002Freview \u003Cfile-path>`, or `\u002Freview \u003Cpr-number> --comment` to post inline comments on the PR. Add `--effort low|medium|high` to trade depth for speed (defaults to high for PRs, medium for local changes).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1492,1495],{"name":1493,"slug":1494,"type":16},"Code Review","code-review",{"name":1496,"slug":1497,"type":16},"Security","security","2026-07-30T05:30:17.682893",{"slug":1500,"name":1500,"fn":1501,"description":1502,"org":1503,"tags":1504,"stars":23,"repoUrl":24,"updatedAt":1510},"simplify","clean up and simplify code changes","Review recent code changes for reuse, code quality, and efficiency, then directly apply straightforward cleanup improvements. Use when the user wants a post-implementation cleanup pass, pre-PR polish, or asks to simplify\u002Frefine recent changes. Invoke with `\u002Fsimplify` or `\u002Fsimplify \u003Cfocus>`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1505,1508,1509],{"name":1506,"slug":1507,"type":16},"Code Analysis","code-analysis",{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},"2026-07-20T05:58:46.653811",{"slug":4,"name":4,"fn":5,"description":6,"org":1512,"tags":1513,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1514,1515,1516],{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"slug":1518,"name":1518,"fn":1519,"description":1520,"org":1521,"tags":1522,"stars":1529,"repoUrl":1530,"updatedAt":1531},"open-computer-use","configure Open Computer Use MCP server","Platform-neutral guidance for using Open Computer Use, the open-source Computer Use MCP server and CLI for macOS, Linux, and Windows. Use when an agent needs to install, verify, troubleshoot, configure, or operate Open Computer Use through its native CLI, stdio MCP server, or direct Computer Use tool calls.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1523,1524,1527,1528],{"name":1342,"slug":1343,"type":16},{"name":1525,"slug":1526,"type":16},"CLI","cli",{"name":1361,"slug":1362,"type":16},{"name":1364,"slug":1365,"type":16},176,"https:\u002F\u002Fgithub.com\u002FQwenLM\u002Fopen-computer-use","2026-07-16T05:59:22.010839",{"slug":1533,"name":1533,"fn":1534,"description":1535,"org":1536,"tags":1537,"stars":1547,"repoUrl":1548,"updatedAt":1549},"auto-pr","automate pull request submission and review","Automated PR submission assistant, including code review, documentation generation, and PR creation",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1538,1539,1540,1541,1544],{"name":1342,"slug":1343,"type":16},{"name":1493,"slug":1494,"type":16},{"name":1393,"slug":1394,"type":16},{"name":1542,"slug":1543,"type":16},"GitHub","github",{"name":1545,"slug":1546,"type":16},"Pull Requests","pull-requests",136,"https:\u002F\u002Fgithub.com\u002FQwenLM\u002Fqwen-code-examples","2026-07-16T06:00:01.890524",21]