[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DNGJEMNJZR24NBJ7MF5V8R":3,"skill-same:01M7DNGJEMNJZR24NBJ7MF5V8R":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7DNGJEMNJZR24NBJ7MF5V8R","troubleshoot",null,"Investigate unexpected behavior in the current Copilot agent session by analyzing its event log. Use when the user asks why something happened, why a request was slow, why a tool was or was not used, or why instructions\u002Fskills\u002Fagents did not load.","DragonBallerZ\u002Fdragon-ide","DragonBallerZ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199459338?v=4","01M7DN83GSDPNQH3ACEV21SKTQ","Z McDragon","01M7DN83HDR4KMJAMTCB5S4DCJ",12,"MIT","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Ftroubleshoot\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: troubleshoot\ndescription: Investigate unexpected behavior in the current Copilot agent session by analyzing its event log. Use when the user asks why something happened, why a request was slow, why a tool was or was not used, or why instructions\u002Fskills\u002Fagents did not load.\n---\n\u003C!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->\n\n# Troubleshoot\n\n## Purpose\n\nThis skill investigates and explains unexpected agent behavior in the **current Copilot agent session** using its on-disk event log.\n\nUse this skill for questions like:\n- Why did this request take so long?\n- Why was a tool called (or not called)?\n- Why did an instruction\u002Fskill\u002Fagent file not load?\n- Why did a tool call fail?\n- Why did the model not follow expectations?\n\nBase every conclusion on evidence from the event log. Do not guess.\n\n## Locating the Session Log\n\nThe skill runs **inside** the session's agent, so the log is on the same machine. It lives outside the workspace — read it via the terminal (`run_in_terminal`), never `grep_search`.\n\n1. **If a `Session log:` path is provided with this message, use it.** It may point to a session **other than** the current one (via `#session`) and may be **comma-separated paths** — investigate all of them and compare.\n2. **Sticky reference:** if no path is on the *current* message but an earlier turn in **this conversation** already established a target (a `Session log:` path, or a `#session:` reference), keep analyzing **that same session** for the follow-up. Do **not** fall back to self-discovery here — the newest log is the *current* session, which is the wrong one. Switch only if the user references a new session.\n3. **Otherwise, self-discover it:** pick the **most recently modified** `events.jsonl` under `${XDG_STATE_HOME:-$HOME}\u002F.copilot\u002Fsession-state\u002F\u003CsessionId>\u002F` — this skill is appending to the current session's log, so it's reliably newest. Honor `XDG_STATE_HOME`, else `$HOME`.\n4. **If none exists** there, this isn't a Copilot session — tell the user the skill supports Copilot sessions only, and stop.\n\n## Data Source — `events.jsonl`\n\nEach line is a JSON object sharing one envelope:\n\n```json\n{ \"type\": \"...\", \"id\": \"...\", \"parentId\": \"...\", \"agentId\": \"...\", \"timestamp\": \"ISO-8601\", \"data\": { } }\n```\n\n- `type` — the event kind (see below).\n- `id` — unique event id.\n- `parentId` — the **chronologically preceding** event, not a logical parent. It is a flat back-pointer over every event, *not* the user → turn → tool-call hierarchy. Do not treat it as a logical parent.\n- `agentId` — present for sub-agent events; absent for the main agent and session-level events.\n- `timestamp` — ISO-8601 time. Compute durations by differencing timestamps (e.g. a tool's start vs. its completion, a turn's `assistant.turn_start` vs. the `assistant.message`).\n- `data` — type-specific payload.\n\n### Event types (`data.*` fields)\n\n- **`session.start`** (once) — `selectedModel`, `reasoningEffort`.\n- **`user.message`** — `content`; `transformedContent` (expanded prompt, when it differs).\n- **`assistant.turn_start` \u002F `assistant.turn_end`** — `turnId`; measure a turn's duration vs the following `assistant.message`.\n- **`assistant.message`** — `model`, `outputTokens`, `content`, `reasoningText` (thinking, when present), `turnId`, `parentToolCallId` (set ⇒ sub-agent turn spawned by that tool call).\n- **`tool.execution_start`** — `toolName`, `toolCallId`, `arguments`, `parentToolCallId` (set ⇒ nested\u002Fsub-agent).\n- **`tool.execution_complete`** — `toolCallId` (matches start), `success`, `result`. Pair with its start by `toolCallId` for the full call + duration.\n- **`session.shutdown`** (once, at end) — `modelMetrics[*].usage`, `totalNanoAiu`. Absent mid-session.\n- Other (`hook.*`, `permission.*`, `system.message`) — inspect `data` as needed.\n\n### Reconstructing the flow\n\nIterate records in order and rebuild the logical tree from context:\n- `session.start` is the root.\n- a `user.message` begins a turn.\n- an `assistant.message` answers the current `user.message` — unless it has `data.parentToolCallId`, in which case it belongs to the sub-agent spawned by that tool call.\n- a `tool.execution_start` belongs to the current `assistant.message` — unless it has `data.parentToolCallId`, in which case it is nested under that parent tool call.\n- pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`.\n\n## Secondary Source — Agent Host Wire Log (protocol communication)\n\n`events.jsonl` is the **primary** source and answers almost every question on its own. A *separate* log captures the **transport\u002Fprotocol** between VS Code and the agent host process — the JSON-RPC-style frames that drive sessions.\n\n**Use the wire log only when the symptom points at the agent host \u002F transport itself, not the model or a tool.** Reach for it when:\n- the agent host won't start, or the session never begins;\n- requests **hang or time out**, or the agent appears stuck \"connecting\" \u002F unresponsive;\n- `createSession` \u002F `subscribe` fails, or expected updates\u002Fnotifications never arrive;\n- you see RPC \u002F protocol \u002F connection errors.\n\n**Do not** open it for ordinary \"why did the model\u002Ftool do X\" questions — `events.jsonl` already answers those. If `events.jsonl` fully explains the behavior, stop there and don't read the wire log.\n\n**It is written by VS Code on the _client_ machine, so it is only reachable for a _local_ agent host** (VS Code and the agent on the same machine). For a remote agent host it lives on the client, not the host this skill runs on — skip it there.\n\n### Location\n\n```\n\u003CVS Code user-data dir>\u002Flogs\u002F\u003Csession-timestamp>\u002Fahp\u002Fahp-\u003Ctimestamp>-\u003CconnectionId>.jsonl\n```\n\nThe VS Code user-data dir depends on the build:\n- Windows: `%APPDATA%\\Code` (Insiders: `Code - Insiders`; OSS\u002Fdev may use `Code - OSS` or a custom `--user-data-dir`)\n- macOS: `~\u002FLibrary\u002FApplication Support\u002FCode`\n- Linux: `~\u002F.config\u002FCode`\n\nA new `logs\u002F\u003Ctimestamp>\u002F` folder is created per VS Code session — pick the **most recently modified** `ahp\u002Fahp-*.jsonl`.\n\n**Named by _connection_ id, not session id** — one log **multiplexes all sessions on that connection** (no per-session file). Long connections rotate into `ahp-….1.jsonl`, `.2.jsonl`, … (max 5); the active one is the **most recently modified** (the locate commands pick it). Read the newest log for connection-level health; to isolate one session, filter by its id (the `session-state\u002F\u003CsessionId>\u002F` folder name, which appears in frames' `params`\u002F`result`).\n\n**If no `ahp\u002F` folder exists, the wire log is disabled** (it is off by default). Tell the user to set `\"chat.agentHost.ahpJsonlLoggingEnabled\": true`, restart VS Code, reproduce the issue, then re-run.\n\n### Format\n\nEach line is a JSON-RPC frame plus an `_ahpLog` envelope:\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 12, \"method\": \"createSession\", \"params\": {}, \"_ahpLog\": { \"ts\": \"ISO-8601\", \"dir\": \"c2s\", \"connectionId\": \"…\", \"transport\": \"local\" } }\n```\n\n- `_ahpLog.dir` — direction: `c2s` = VS Code → host (requests\u002Fnotifications), `s2c` = host → VS Code (results\u002Ferrors\u002Factions\u002Fnotifications).\n- `_ahpLog.transport` — `local` \u002F `websocket` \u002F `ssh` \u002F `wsl`.\n- Requests\u002Fnotifications carry `method` + `params`; responses carry `result` or `error` — pair a response to its request by `id`.\n- `_ahpLog.truncated: true` marks frames whose large payloads were elided.\n\nTriage: look for `error` frames, requests (`c2s` with an `id`) that have **no matching `s2c` response** (hangs\u002Ftimeouts), or a missing `s2c` after `createSession` \u002F `subscribe`. Apply the same streaming \u002F `jq` \u002F `node` rules as for `events.jsonl`.\n\n### Locating it (terminal)\n- macOS\u002FLinux: `ls -t ~\u002FLibrary\u002FApplication\\ Support\u002FCode*\u002Flogs\u002F*\u002Fahp\u002Fahp-*.jsonl ~\u002F.config\u002FCode*\u002Flogs\u002F*\u002Fahp\u002Fahp-*.jsonl 2>\u002Fdev\u002Fnull | head -n 1`\n- Windows (PowerShell): `Get-ChildItem \"$env:APPDATA\\Code*\\logs\\*\\ahp\\ahp-*.jsonl\" -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1`\n\n## Tooling Strategy (important)\n\nThe event log is outside the workspace, so `grep_search` cannot read it. **Use `run_in_terminal`.**\n\n### Do a single triage pass first (important for efficiency)\n\nEach terminal command is a separate round-trip, so **don't run one command per question.** Do **one streaming pass** (constant memory — `events.jsonl` can be hundreds of MB, so never load it whole) that prints, in a single read:\n- the event counts by type,\n- every tool call with success\u002Ffailure and duration (pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`),\n- the user messages.\n\nUse a streaming `jq` program (macOS\u002FLinux) or a streaming Node `readline` pass (Windows) — the per-query examples below are the building blocks. Then run targeted follow-ups only to drill in.\n\n### macOS \u002F Linux \u002F WSL \u002F Git Bash (`grep` \u002F `jq`)\n- Locate the newest log: `ls -t \"${XDG_STATE_HOME:-$HOME}\"\u002F.copilot\u002Fsession-state\u002F*\u002Fevents.jsonl | head -n 1`\n- Check size first: `ls -lh \u003ClogPath>`\n- Errors: `grep '\"success\":false' \u003ClogPath>` (tool failures) and `grep '\"type\":\"tool.execution_complete\"' \u003ClogPath>`\n- Count events by type (streaming): `jq -nr 'reduce inputs as $i ({}; .[$i.type] += 1) | to_entries | sort_by(-.value)[] | \"\\(.value) \\(.key)\"' \u003ClogPath>`\n- Tool calls: `jq -c 'select(.type==\"tool.execution_start\") | {tool:.data.toolName, id:.data.toolCallId}' \u003ClogPath>`\n- User messages: `jq -c 'select(.type==\"user.message\") | .data.content' \u003ClogPath>`\n- Assistant turns: `jq -c 'select(.type==\"assistant.message\") | {model:.data.model, out:.data.outputTokens}' \u003ClogPath>`\n\n### Windows (PowerShell + Node.js)\n**Do not parse the log with PowerShell JSON.** `Get-Content … | ForEach-Object { ConvertFrom-Json }` (or any per-line `ConvertFrom-Json`) deserializes one object at a time and is slow even on small logs. Use `Select-String` for plain-text matches and a **streaming** `node` pass for anything that needs JSON. Use `jq` instead if it is available.\n\n- Locate the newest log:\n  ```powershell\n  $stateHome = if ($env:XDG_STATE_HOME) { $env:XDG_STATE_HOME } else { $HOME }\n  Get-ChildItem (Join-Path $stateHome '.copilot\\session-state\\*\\events.jsonl') | Sort-Object LastWriteTime -Descending | Select-Object -First 1\n  ```\n- Check size first: `(Get-Item \u003ClogPath>).Length`\n- Plain-text matches (fast, streaming, no parsing): `Select-String '\"success\":false' \u003ClogPath>`\n- JSON queries — a **streaming** `node` pass (constant memory, safe for hundreds-of-MB logs; pass the log path as an argument so it stays quote-safe). Use this shape and change only the per-line `if (…)` to select what you need (tool failures, tool calls, assistant turns, …):\n    `node -e \"const rl=require('readline').createInterface({input:require('fs').createReadStream(process.argv[1])});rl.on('line',l=>{if(!l)return;let x;try{x=JSON.parse(l)}catch{return}if(x.type==='tool.execution_complete'&&x.data.success===false)console.log(x.data.toolCallId,JSON.stringify(x.data.result))})\" \"\u003ClogPath>\"`\n  For aggregates (e.g. counts by type), accumulate into an object as you go and print it on `rl.on('close', …)`.\n- For a very large log, narrow with `Select-String` first to find the line, then read that small slice with `read_file`.\n\n### General rules\n- **One streaming pass, not many.** Each command is a round-trip; prefer the single triage pass, then targeted follow-ups. Never load a whole (hundreds-of-MB) log into memory (`readFileSync` \u002F `Get-Content`) — stream (`jq` \u002F the readline pass) or narrow with `grep` \u002F `Select-String` first. Check size first if unsure (`ls -lh` \u002F `(Get-Item).Length`).\n- **Never deserialize JSON line-by-line in the shell** (PowerShell `ConvertFrom-Json` in a loop) — slow. Use one `jq` filter or one `node` pass.\n- Use `read_file` only for small targeted ranges, never an entire log.\n\n## Investigation Workflow\n\n1. Locate `events.jsonl` and run the single triage pass.\n2. Match the symptom: **errors** → `success:false`; **latency** → gaps between `assistant.turn_start` and its `assistant.message`, or a tool's start↔complete; **tool \u002F model \u002F input** → the relevant event type; **agent-host \u002F transport** failure (local) → also the Wire Log.\n3. Read only the relevant slices, then determine the most likely root cause (order contributing factors by impact) and give concrete next steps.\n\n## Response Guidelines\n\nCover **what happened and why** (root cause), **key evidence** (paraphrased — quote only a telling detail like an error message, never raw dumps), and **how to fix it**. A short combined explanation is fine; add structure (headers, bullets, tables) only for complex, multi-factor issues. Keep paragraphs short.\n\n**Abstraction:** don't narrate your investigation or use internal terms (`events.jsonl`, `tool.execution_start`, `parentId`, \"envelope\"). Refer to \"the session log\" abstractly. Focus on what happened and why, not how you found it.\n\n**Example** — instead of \"I read events.jsonl and saw a `tool.execution_complete` with `success:false`…\", say:\n\n> The \"testing\" skill was found but not loaded because the folder name and the name in the skill file differ (`testing` vs `testing2`). **Fix:** make them match (rename the folder or change the name), then start a new session.\n\n## Important Rules\n\n- Base every claim on log evidence — never assume causality.\n- Search via `run_in_terminal`; never `grep_search`, and never `read_file` a whole (possibly huge) log — narrow first, then read small ranges.\n- If no Copilot session log exists, say so and stop.\n","\u003C!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->\n\n# Troubleshoot\n\n## Purpose\n\nThis skill investigates and explains unexpected agent behavior in the **current Copilot agent session** using its on-disk event log.\n\nUse this skill for questions like:\n- Why did this request take so long?\n- Why was a tool called (or not called)?\n- Why did an instruction\u002Fskill\u002Fagent file not load?\n- Why did a tool call fail?\n- Why did the model not follow expectations?\n\nBase every conclusion on evidence from the event log. Do not guess.\n\n## Locating the Session Log\n\nThe skill runs **inside** the session's agent, so the log is on the same machine. It lives outside the workspace — read it via the terminal (`run_in_terminal`), never `grep_search`.\n\n1. **If a `Session log:` path is provided with this message, use it.** It may point to a session **other than** the current one (via `#session`) and may be **comma-separated paths** — investigate all of them and compare.\n2. **Sticky reference:** if no path is on the *current* message but an earlier turn in **this conversation** already established a target (a `Session log:` path, or a `#session:` reference), keep analyzing **that same session** for the follow-up. Do **not** fall back to self-discovery here — the newest log is the *current* session, which is the wrong one. Switch only if the user references a new session.\n3. **Otherwise, self-discover it:** pick the **most recently modified** `events.jsonl` under `${XDG_STATE_HOME:-$HOME}\u002F.copilot\u002Fsession-state\u002F\u003CsessionId>\u002F` — this skill is appending to the current session's log, so it's reliably newest. Honor `XDG_STATE_HOME`, else `$HOME`.\n4. **If none exists** there, this isn't a Copilot session — tell the user the skill supports Copilot sessions only, and stop.\n\n## Data Source — `events.jsonl`\n\nEach line is a JSON object sharing one envelope:\n\n```json\n{ \"type\": \"...\", \"id\": \"...\", \"parentId\": \"...\", \"agentId\": \"...\", \"timestamp\": \"ISO-8601\", \"data\": { } }\n```\n\n- `type` — the event kind (see below).\n- `id` — unique event id.\n- `parentId` — the **chronologically preceding** event, not a logical parent. It is a flat back-pointer over every event, *not* the user → turn → tool-call hierarchy. Do not treat it as a logical parent.\n- `agentId` — present for sub-agent events; absent for the main agent and session-level events.\n- `timestamp` — ISO-8601 time. Compute durations by differencing timestamps (e.g. a tool's start vs. its completion, a turn's `assistant.turn_start` vs. the `assistant.message`).\n- `data` — type-specific payload.\n\n### Event types (`data.*` fields)\n\n- **`session.start`** (once) — `selectedModel`, `reasoningEffort`.\n- **`user.message`** — `content`; `transformedContent` (expanded prompt, when it differs).\n- **`assistant.turn_start` \u002F `assistant.turn_end`** — `turnId`; measure a turn's duration vs the following `assistant.message`.\n- **`assistant.message`** — `model`, `outputTokens`, `content`, `reasoningText` (thinking, when present), `turnId`, `parentToolCallId` (set ⇒ sub-agent turn spawned by that tool call).\n- **`tool.execution_start`** — `toolName`, `toolCallId`, `arguments`, `parentToolCallId` (set ⇒ nested\u002Fsub-agent).\n- **`tool.execution_complete`** — `toolCallId` (matches start), `success`, `result`. Pair with its start by `toolCallId` for the full call + duration.\n- **`session.shutdown`** (once, at end) — `modelMetrics[*].usage`, `totalNanoAiu`. Absent mid-session.\n- Other (`hook.*`, `permission.*`, `system.message`) — inspect `data` as needed.\n\n### Reconstructing the flow\n\nIterate records in order and rebuild the logical tree from context:\n- `session.start` is the root.\n- a `user.message` begins a turn.\n- an `assistant.message` answers the current `user.message` — unless it has `data.parentToolCallId`, in which case it belongs to the sub-agent spawned by that tool call.\n- a `tool.execution_start` belongs to the current `assistant.message` — unless it has `data.parentToolCallId`, in which case it is nested under that parent tool call.\n- pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`.\n\n## Secondary Source — Agent Host Wire Log (protocol communication)\n\n`events.jsonl` is the **primary** source and answers almost every question on its own. A *separate* log captures the **transport\u002Fprotocol** between VS Code and the agent host process — the JSON-RPC-style frames that drive sessions.\n\n**Use the wire log only when the symptom points at the agent host \u002F transport itself, not the model or a tool.** Reach for it when:\n- the agent host won't start, or the session never begins;\n- requests **hang or time out**, or the agent appears stuck \"connecting\" \u002F unresponsive;\n- `createSession` \u002F `subscribe` fails, or expected updates\u002Fnotifications never arrive;\n- you see RPC \u002F protocol \u002F connection errors.\n\n**Do not** open it for ordinary \"why did the model\u002Ftool do X\" questions — `events.jsonl` already answers those. If `events.jsonl` fully explains the behavior, stop there and don't read the wire log.\n\n**It is written by VS Code on the _client_ machine, so it is only reachable for a _local_ agent host** (VS Code and the agent on the same machine). For a remote agent host it lives on the client, not the host this skill runs on — skip it there.\n\n### Location\n\n```\n\u003CVS Code user-data dir>\u002Flogs\u002F\u003Csession-timestamp>\u002Fahp\u002Fahp-\u003Ctimestamp>-\u003CconnectionId>.jsonl\n```\n\nThe VS Code user-data dir depends on the build:\n- Windows: `%APPDATA%\\Code` (Insiders: `Code - Insiders`; OSS\u002Fdev may use `Code - OSS` or a custom `--user-data-dir`)\n- macOS: `~\u002FLibrary\u002FApplication Support\u002FCode`\n- Linux: `~\u002F.config\u002FCode`\n\nA new `logs\u002F\u003Ctimestamp>\u002F` folder is created per VS Code session — pick the **most recently modified** `ahp\u002Fahp-*.jsonl`.\n\n**Named by _connection_ id, not session id** — one log **multiplexes all sessions on that connection** (no per-session file). Long connections rotate into `ahp-….1.jsonl`, `.2.jsonl`, … (max 5); the active one is the **most recently modified** (the locate commands pick it). Read the newest log for connection-level health; to isolate one session, filter by its id (the `session-state\u002F\u003CsessionId>\u002F` folder name, which appears in frames' `params`\u002F`result`).\n\n**If no `ahp\u002F` folder exists, the wire log is disabled** (it is off by default). Tell the user to set `\"chat.agentHost.ahpJsonlLoggingEnabled\": true`, restart VS Code, reproduce the issue, then re-run.\n\n### Format\n\nEach line is a JSON-RPC frame plus an `_ahpLog` envelope:\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 12, \"method\": \"createSession\", \"params\": {}, \"_ahpLog\": { \"ts\": \"ISO-8601\", \"dir\": \"c2s\", \"connectionId\": \"…\", \"transport\": \"local\" } }\n```\n\n- `_ahpLog.dir` — direction: `c2s` = VS Code → host (requests\u002Fnotifications), `s2c` = host → VS Code (results\u002Ferrors\u002Factions\u002Fnotifications).\n- `_ahpLog.transport` — `local` \u002F `websocket` \u002F `ssh` \u002F `wsl`.\n- Requests\u002Fnotifications carry `method` + `params`; responses carry `result` or `error` — pair a response to its request by `id`.\n- `_ahpLog.truncated: true` marks frames whose large payloads were elided.\n\nTriage: look for `error` frames, requests (`c2s` with an `id`) that have **no matching `s2c` response** (hangs\u002Ftimeouts), or a missing `s2c` after `createSession` \u002F `subscribe`. Apply the same streaming \u002F `jq` \u002F `node` rules as for `events.jsonl`.\n\n### Locating it (terminal)\n- macOS\u002FLinux: `ls -t ~\u002FLibrary\u002FApplication\\ Support\u002FCode*\u002Flogs\u002F*\u002Fahp\u002Fahp-*.jsonl ~\u002F.config\u002FCode*\u002Flogs\u002F*\u002Fahp\u002Fahp-*.jsonl 2>\u002Fdev\u002Fnull | head -n 1`\n- Windows (PowerShell): `Get-ChildItem \"$env:APPDATA\\Code*\\logs\\*\\ahp\\ahp-*.jsonl\" -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1`\n\n## Tooling Strategy (important)\n\nThe event log is outside the workspace, so `grep_search` cannot read it. **Use `run_in_terminal`.**\n\n### Do a single triage pass first (important for efficiency)\n\nEach terminal command is a separate round-trip, so **don't run one command per question.** Do **one streaming pass** (constant memory — `events.jsonl` can be hundreds of MB, so never load it whole) that prints, in a single read:\n- the event counts by type,\n- every tool call with success\u002Ffailure and duration (pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`),\n- the user messages.\n\nUse a streaming `jq` program (macOS\u002FLinux) or a streaming Node `readline` pass (Windows) — the per-query examples below are the building blocks. Then run targeted follow-ups only to drill in.\n\n### macOS \u002F Linux \u002F WSL \u002F Git Bash (`grep` \u002F `jq`)\n- Locate the newest log: `ls -t \"${XDG_STATE_HOME:-$HOME}\"\u002F.copilot\u002Fsession-state\u002F*\u002Fevents.jsonl | head -n 1`\n- Check size first: `ls -lh \u003ClogPath>`\n- Errors: `grep '\"success\":false' \u003ClogPath>` (tool failures) and `grep '\"type\":\"tool.execution_complete\"' \u003ClogPath>`\n- Count events by type (streaming): `jq -nr 'reduce inputs as $i ({}; .[$i.type] += 1) | to_entries | sort_by(-.value)[] | \"\\(.value) \\(.key)\"' \u003ClogPath>`\n- Tool calls: `jq -c 'select(.type==\"tool.execution_start\") | {tool:.data.toolName, id:.data.toolCallId}' \u003ClogPath>`\n- User messages: `jq -c 'select(.type==\"user.message\") | .data.content' \u003ClogPath>`\n- Assistant turns: `jq -c 'select(.type==\"assistant.message\") | {model:.data.model, out:.data.outputTokens}' \u003ClogPath>`\n\n### Windows (PowerShell + Node.js)\n**Do not parse the log with PowerShell JSON.** `Get-Content … | ForEach-Object { ConvertFrom-Json }` (or any per-line `ConvertFrom-Json`) deserializes one object at a time and is slow even on small logs. Use `Select-String` for plain-text matches and a **streaming** `node` pass for anything that needs JSON. Use `jq` instead if it is available.\n\n- Locate the newest log:\n  ```powershell\n  $stateHome = if ($env:XDG_STATE_HOME) { $env:XDG_STATE_HOME } else { $HOME }\n  Get-ChildItem (Join-Path $stateHome '.copilot\\session-state\\*\\events.jsonl') | Sort-Object LastWriteTime -Descending | Select-Object -First 1\n  ```\n- Check size first: `(Get-Item \u003ClogPath>).Length`\n- Plain-text matches (fast, streaming, no parsing): `Select-String '\"success\":false' \u003ClogPath>`\n- JSON queries — a **streaming** `node` pass (constant memory, safe for hundreds-of-MB logs; pass the log path as an argument so it stays quote-safe). Use this shape and change only the per-line `if (…)` to select what you need (tool failures, tool calls, assistant turns, …):\n    `node -e \"const rl=require('readline').createInterface({input:require('fs').createReadStream(process.argv[1])});rl.on('line',l=>{if(!l)return;let x;try{x=JSON.parse(l)}catch{return}if(x.type==='tool.execution_complete'&&x.data.success===false)console.log(x.data.toolCallId,JSON.stringify(x.data.result))})\" \"\u003ClogPath>\"`\n  For aggregates (e.g. counts by type), accumulate into an object as you go and print it on `rl.on('close', …)`.\n- For a very large log, narrow with `Select-String` first to find the line, then read that small slice with `read_file`.\n\n### General rules\n- **One streaming pass, not many.** Each command is a round-trip; prefer the single triage pass, then targeted follow-ups. Never load a whole (hundreds-of-MB) log into memory (`readFileSync` \u002F `Get-Content`) — stream (`jq` \u002F the readline pass) or narrow with `grep` \u002F `Select-String` first. Check size first if unsure (`ls -lh` \u002F `(Get-Item).Length`).\n- **Never deserialize JSON line-by-line in the shell** (PowerShell `ConvertFrom-Json` in a loop) — slow. Use one `jq` filter or one `node` pass.\n- Use `read_file` only for small targeted ranges, never an entire log.\n\n## Investigation Workflow\n\n1. Locate `events.jsonl` and run the single triage pass.\n2. Match the symptom: **errors** → `success:false`; **latency** → gaps between `assistant.turn_start` and its `assistant.message`, or a tool's start↔complete; **tool \u002F model \u002F input** → the relevant event type; **agent-host \u002F transport** failure (local) → also the Wire Log.\n3. Read only the relevant slices, then determine the most likely root cause (order contributing factors by impact) and give concrete next steps.\n\n## Response Guidelines\n\nCover **what happened and why** (root cause), **key evidence** (paraphrased — quote only a telling detail like an error message, never raw dumps), and **how to fix it**. A short combined explanation is fine; add structure (headers, bullets, tables) only for complex, multi-factor issues. Keep paragraphs short.\n\n**Abstraction:** don't narrate your investigation or use internal terms (`events.jsonl`, `tool.execution_start`, `parentId`, \"envelope\"). Refer to \"the session log\" abstractly. Focus on what happened and why, not how you found it.\n\n**Example** — instead of \"I read events.jsonl and saw a `tool.execution_complete` with `success:false`…\", say:\n\n> The \"testing\" skill was found but not loaded because the folder name and the name in the skill file differ (`testing` vs `testing2`). **Fix:** make them match (rename the folder or change the name), then start a new session.\n\n## Important Rules\n\n- Base every claim on log evidence — never assume causality.\n- Search via `run_in_terminal`; never `grep_search`, and never `read_file` a whole (possibly huge) log — narrow first, then read small ranges.\n- If no Copilot session log exists, say so and stop.\n",{"name":5,"description":7},"main","af285532414d1fa855b4360d86103c12253e6f2f","src\u002Fvs\u002Fsessions\u002Fskills\u002Ftroubleshoot",0,"https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide","https:\u002F\u002Fgithub.com\u002FDragonBallerZ","https:\u002F\u002Fwww.velloralabs.com","Building Dangerously Disruptive Technology. ","2026-10-23 14:19:51",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add DragonBallerZ\u002Fdragon-ide --skill troubleshoot",{"tool":39,"command":40},"bunx","bunx skills add DragonBallerZ\u002Fdragon-ide --skill troubleshoot",{"tool":42,"command":43},"pnpm","pnpm dlx skills add DragonBallerZ\u002Fdragon-ide --skill troubleshoot","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Ftroubleshoot\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7DNGQPVJGHW226R8PS3R31F","update-skills","Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says \"learn!\", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7DNGP5XJWV3CG63DVS6NR8Y","update-pr","Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-pr\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7DNGFVCVMFN5J4ZKV27CDR1","sync","Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7DNGC9GE8EKQED3ZR3KAJ0K","sync-upstream","Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fsync-upstream\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7DNG9NJNG1QPJB6C3GFDHVS","merge","Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fmerge\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DNG7MV5GG1PCMSFT6ND8HX","generate-run-commands","Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.","https:\u002F\u002Fgithub.com\u002FDragonBallerZ\u002Fdragon-ide\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fgenerate-run-commands\u002FSKILL.md",[],[]]