{ "models": [ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/qwen/qwen2.5-coder-32b-instruct", "@cf/meta/llama-3.2-3b-instruct" ], "scenarios": [ "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)" ], "compare": true, "runs": [ { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "with_lesson", "status": 200, "content": "To address the issue of a growing agent-knowledge project feeling abstract and not providing a clear, low-friction path for new visitors to find useful lessons quickly, follow these concrete steps:\n\n### 1. Simplify the Homepage and README\n\nFirst, ensure that the homepage and README file of your project are straightforward and focus on the primary action you want users to take: searching for and finding useful lessons.\n\n- **Edit `README.md`**: Begin with a brief introduction to your project, followed by a clear example of how to use it, focusing on the search functionality.\n \n Example:\n ```markdown\n # Agent-Knowledge Project\n A repository for sharing and finding lessons on agent-knowledge.\n \n ## Getting Started\n 1. Clone this repository: `git clone https://your-repo-url.com/agent-knowledge.git`\n 2. Navigate into the project directory: `cd agent-knowledge`\n 3. Install dependencies if necessary (for example, for a Python project): `pip install -r requirements.txt`\n 4. Start the local search server (if applicable): `python search_server.py`\n 5. Open your web browser and navigate to `http://localhost:8000` (or the specified", "metrics": { "length": 1148, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "plain", "status": 200, "content": "To address the issue of a project feeling abstract due to an overly complex introduction, we can simplify the onboarding process by prioritizing a \"search-first\" approach. This involves ensuring that new visitors can quickly find useful information by pasting a real error and getting a helpful response. Here's a step-by-step, actionable plan to achieve this:\n\n### 1. Simplify the Homepage\n\nFirst, we need to make sure the homepage is straightforward and immediately useful to new visitors. \n\n- **Edit the Homepage Content:**\n - Open your project's homepage file (usually `index.html` or `README.md` if you're using GitHub Pages or a similar platform).\n - Replace the existing content with a brief introduction that mentions the project's purpose and its ability to help users find solutions by searching for error messages.\n\n### 2. Implement a Search Function\n\nEnsure that your project has a functional search feature that allows users to quickly find relevant information.\n\n- **For Static Sites (e.g., GitHub Pages):**\n - If you're using a static site generator like Jekyll, you can add a search plugin. For example, you can use `jekyll-search` or a similar plugin.\n - Follow the plugin's documentation to install and configure it. Typically", "metrics": { "length": 1248, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of accidental `__pycache__` artifacts committed to a data repository, follow these steps with exact commands:\n\n### Step 1: Remove the artifacts from the index and disk\n\nFirst, you need to remove the `__pycache__` directories and any `.pyc` files from both the Git index and your local disk. Run the following commands in your terminal:\n\n```bash\ngit rm --cached -r __pycache__ 2>/dev/null || true\ngit rm -r --cached '*.pyc' 2>/dev/null || true\nrm -rf __pycache__\n```\n\nThese commands remove the `__pycache__` directories and any `.pyc` files from the Git index and then delete them from your local filesystem.\n\n### Step 2: Add a .gitignore covering Python bytecode\n\nTo prevent `__pycache__` directories and `.pyc` files from being committed in the future, you should add them to your `.gitignore` file. If you don't have a `.gitignore` file, create one in the root of your repository and add the following lines:\n\n```plaintext\n__pycache__/\n*.pyc\n```\n\nIf you already have a `.gitignore` file", "metrics": { "length": 1005, "commands": 3, "command_list": [ "git rm --cached -r __pycache__ 2>/dev/null || true", "git rm -r --cached '*.pyc' 2>/dev/null || true", "rm -rf __pycache__" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "plain", "status": 200, "content": "**Fixing Accidental Commit of `__pycache__` Files**\n\nTo resolve the issue, you'll need to remove the `__pycache__` files from your Git repository. Here are the steps:\n\n### Step 1: Remove `__pycache__` Files from Git Index\n\nRun the following command to remove the `__pycache__` files from your Git index:\n```bash\ngit rm -r --cached __pycache__\n```\nThis command will remove the `__pycache__` directory and its contents from your Git index, but not from your local file system.\n\n### Step 2: Add `__pycache__` to `.gitignore`\n\nTo prevent `__pycache__` files from being committed in the future, add the following line to your `.gitignore` file:\n```bash\n__pycache__/\n```\nYou can do this using your favorite text editor or by running the following command:\n```bash\necho \"__pycache__/\" >> .gitignore\n```\n### Step 3: Commit Changes\n\nCommit the changes to your `.gitignore` file and the removal of `__pycache__` files from your Git index:\n```bash\ngit add .gitignore\ngit commit -m", "metrics": { "length": 969, "commands": 3, "command_list": [ "git rm -r --cached __pycache__", "__pycache__/", "echo \"__pycache__/\" >> .gitignore" ], "has_command_block": true, "actionable": false, "inline_code_count": 17, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "with_lesson", "status": 200, "content": "To address the issue of slow node registration for autonomous agents, you can implement the `misakanet_register` MCP tool as described. Here's a step-by-step guide to achieve this:\n\n### Step 1: Create the `misakanet_register` MCP Tool\n\nFirst, you need to create a Python script that will handle the registration process. This script will generate a unique `node_id` and `token` for each registering agent.\n\nCreate a file named `misakanet_register.py` with the following content:\n\n```python\nimport uuid\nimport time\nimport json\nimport os\n\ndef register_agent(agent_type):\n # Generate unique node_id and token\n node_id = f\"Misaka{uuid.uuid4().hex[:8]}\"\n token = f\"mcp_{uuid.uuid4().hex[:16]}\"\n \n # Store token in KV for validation (assuming a KV store like Redis)\n # For simplicity, we'll use a local JSON file here\n kv_store = \"tokens.json\"\n if not os.path.exists(kv_store):\n with open(kv_store, \"w\") as f:\n json.dump({}, f)\n \n with open(kv_store, \"r+\") as f:\n tokens = json.load(f)\n tokens", "metrics": { "length": 1049, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 5, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "plain", "status": 200, "content": "To resolve the error related to agent-first-node-registration-via-mcp, which requires a GitHub account and opening an issue for node registration, you can use the `mcp` command-line tool to register a node programmatically. This approach allows for autonomous agent registration without the need for manual GitHub interaction.\n\nHere's a step-by-step guide to registering a node using `mcp`:\n\n### Prerequisites\n1. **Install `mcp`**: Ensure you have the `mcp` tool installed. If not, you can install it using the package manager appropriate for your operating system or by downloading it from its official repository.\n\n2. **Have an MCP Server**: Ensure you have access to an MCP (Mesh Central Proxy) server. If you're running your own, make sure it's configured and running.\n\n### Steps to Register a Node\n\n1. **Generate a Node Key**:\n First, generate a unique key for your node. This can be done using tools like OpenSSL. For example:\n ```bash\n openssl rand -base64 32\n ```\n This command generates a random base64-encoded string that will serve as your node's key.\n\n2. **Register the Node**:\n Use the `mcp` tool to register your", "metrics": { "length": 1138, "commands": 1, "command_list": [ "openssl rand -base64 32" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "with_lesson", "status": 200, "content": "To address the issue you've described, we need to streamline the user experience for new visitors by making it easy for them to perform a search and find useful lessons right away. Here's a step-by-step solution with exact commands to help you implement the changes:\n\n### Step 1: Simplify the Homepage\n\nEnsure that the homepage clearly highlights the primary functionality: searching for errors and finding lessons. Here’s how you can structure it:\n\n1. **Title and Description**: Make the title and description concise and focused on the core functionality.\n2. **Search Box**: Place a prominent search box at the top or center of the homepage.\n3. **Quick Start Guide**: Include a brief guide on how to use the search feature.\n\n### Step 2: Implement Zero-Dependency Local Search\n\nTo provide an immediate search experience, implement a zero-dependency local search feature. Here’s a simple example using JavaScript:\n\n1. **Create a Search HTML Form**:\n ```html\n
\n \n \n
\n
\n ```\n\n2. **Add JavaScript", "metrics": { "length": 1189, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "plain", "status": 200, "content": "To address the issue you're facing, it's important to prioritize user experience by making it easy for new visitors to see immediate value from your project. One effective way to do this is by creating a simple, clear, and interactive search feature that users can try right away. Here’s a step-by-step guide to implementing a basic search functionality using SQLite for demonstration purposes:\n\n### Step 1: Set Up SQLite Database\n\nFirst, ensure you have SQLite installed on your system. You can install it via package managers like `apt` for Ubuntu or `brew` for macOS.\n\n#### On Ubuntu:\n```bash\nsudo apt-get update\nsudo apt-get install sqlite3 libsqlite3-dev\n```\n\n#### On macOS:\n```bash\nbrew install sqlite\n```\n\n### Step 2: Create a Sample Database\n\nCreate a sample SQLite database with some error messages and solutions.\n\n```bash\nsqlite3 errors.db\n```\n\nInside the SQLite shell, run the following commands to create a table and insert some data:\n\n```sql\nCREATE TABLE error_messages (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n error_text TEXT NOT NULL,\n solution TEXT NOT NULL\n);\n\nINSERT INTO error_messages (error_text, solution) VALUES \n('ModuleNotFoundError: No module named \\'requests\\'',", "metrics": { "length": 1199, "commands": 4, "command_list": [ "sudo apt-get update", "sudo apt-get install sqlite3 libsqlite3-dev", "brew install sqlite", "sqlite3 errors.db" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "with_lesson", "status": 200, "content": "Certainly! Let's go through the steps to resolve this issue and ensure it doesn't happen again in the future.\n\n### Step-by-Step Fix\n\n#### Step 1: Remove the Artifacts from the Index and Disk\n\nFirst, you need to remove the `__pycache__` directories and `.pyc` files from both the staging area and your working directory.\n\n```bash\n# Remove __pycache__ directories from the index and disk\ngit rm --cached -r __pycache__ 2>/dev/null || true\n\n# Remove .pyc files from the index and disk\ngit rm -r --cached '.pyc' 2>/dev/null || true\n\n# Remove __pycache__ directories from the disk\nrm -rf __pycache__\n```\n\n#### Step 2: Add a `.gitignore` File\n\nCreate or update a `.gitignore` file to prevent `__pycache__` directories and `.pyc` files from being tracked by Git in the future.\n\n```bash\n# Create or edit the .gitignore file\necho \"__pycache__/\" >> .gitignore\necho \"*.pyc\" >> .gitignore\n\n# Stage the .gitignore file\ngit add .gitignore\n```\n\n####", "metrics": { "length": 934, "commands": 6, "command_list": [ "git rm --cached -r __pycache__ 2>/dev/null || true", "git rm -r --cached '.pyc' 2>/dev/null || true", "rm -rf __pycache__", "echo \"__pycache__/\" >> .gitignore", "echo \"*.pyc\" >> .gitignore" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "plain", "status": 200, "content": "Certainly! To resolve this issue, you need to remove the `__pycache__` directory and its contents from your repository. Additionally, you should ensure that such files do not get committed in the future by adding them to your `.gitignore` file.\n\nHere are the steps to fix the issue:\n\n1. **Remove the `__pycache__` directory and its contents from your local repository:**\n\n ```bash\n rm -rf __pycache__\n ```\n\n2. **Stage the removal of the `__pycache__` directory for commit:**\n\n ```bash\n git add --all\n ```\n\n3. **Commit the changes to remove the `__pycache__` directory:**\n\n ```bash\n git commit -m \"Remove __pycache__ directory and its contents\"\n ```\n\n4. **Add `__pycache__/` to your `.gitignore` file to prevent it from being tracked in the future:**\n\n Open your `.gitignore` file in a text editor and add the following line if it's not already present:\n\n ```\n __pycache__/\n ```\n\n5. **Stage the updated `.gitignore` file:**\n\n ```bash\n git add .gitignore", "metrics": { "length": 982, "commands": 4, "command_list": [ "rm -rf __pycache__", "git add --all", "git commit -m \"Remove __pycache__ directory and its contents\"", "__pycache__/" ], "has_command_block": true, "actionable": false, "inline_code_count": 17, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "with_lesson", "status": 200, "content": "To address the issue of slow node registration for autonomous agents via GitHub issues, you can implement the `misakanet_register` MCP tool as described. Below are the concrete steps and commands to set up this tool.\n\n### Step-by-Step Implementation\n\n1. **Create the `misakanet_register` Script**\n\n First, create a Python script named `misakanet_register.py` that will handle the registration process. This script will generate a unique `node_id` and `token`, store them in a key-value (KV) store, and return them to the agent.\n\n ```bash\n touch misakanet_register.py\n ```\n\n Open `misakanet_register.py` and add the following code:\n\n ```python\n import argparse\n import uuid\n import time\n import json\n import os\n\n # Simulated KV store using a JSON file\n KV_STORE_FILE = 'kv_store.json'\n\n def load_kv_store():\n if os.path.exists(KV_STORE_FILE):\n with open(KV_STORE_FILE, 'r') as f:\n return json.load(f)\n return {}\n\n def save_kv_store(kv_store):\n with open(KV_STORE_FILE, 'w') as f:\n json.dump", "metrics": { "length": 1071, "commands": 1, "command_list": [ "touch misakanet_register.py" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/qwen/qwen2.5-coder-32b-instruct", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "plain", "status": 200, "content": "To address the issue of autonomous agents needing a faster way to register nodes without manually creating a GitHub issue, you can explore alternative methods provided by the system or platform you're using. Since the specific platform or tool isn't mentioned, I'll provide a general approach assuming you're working with a system that supports API-based node registration.\n\n### Step-by-Step Fix Using an API\n\n1. **Check API Documentation:**\n - First, ensure that the platform provides an API for node registration. Refer to the official documentation for details on available endpoints, authentication methods, and request formats.\n\n2. **Obtain API Access:**\n - If the platform supports API access, you'll need to obtain the necessary credentials (API key, token, etc.). This is often done through a developer portal or settings section in the platform's web interface.\n\n3. **Write a Script for Node Registration:**\n - Create a script that uses the API to register nodes. Below is a generic example using `curl` to make an HTTP POST request. Replace placeholders with actual values from your platform's documentation.\n\n```bash\n#!/bin/bash\n\n# Define variables\nAPI_URL=\"https://api.example.com/nodes/register\"\nAPI_TOKEN=\"your_api_token_here\"\nNODE_NAME=\"your_node", "metrics": { "length": 1267, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "with_lesson", "status": 200, "content": "The issue you're facing is that your project has multiple audiences with different needs, and when these paths are mixed together, it leads to a \"drift\" in the user experience. To fix this, you need to create a layered message that keeps the first user action concrete and actionable.\n\nHere's a step-by-step guide to help you implement this solution:\n\n**Step 1: Create a clear and concise homepage**\n\n* Update your homepage to clearly state the problem and the solution.\n* Use a simple and concise message that explains the issue and the benefits of the layered message approach.\n\nExample:\n```markdown\n# Agent-Knowledge Project\n\nAre you an agent or a tool user? Do you want to clone, search, reuse, and report? Or are you a maintainer and contributor looking for direction?\n\nWe've got two audiences with different needs. But what if we told you there's a way to keep both paths clear and actionable?\n\nIntroducing our layered message approach!\n\n## Format layer: OKF-compatible Markdown lessons\nLearn from our experts with our OKF-compatible Markdown lessons.\n\n## Search layer: zero-dependency local search, optional SQLite/SAG-Lite index\nFind what you need with our zero-dependency local search.\n\n## Access layer: login and authorization\n", "metrics": { "length": 1237, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "A growing agent-knowledge project can accumulate many valid directions at once: reusable experience substrate, lightweight MCP or tool adapters, OKF-compatible export, SQLite or SAG-style search, public roadmap and bounty issues, model or agent capability evaluation, frontend onboarding, and journey pages.\n\nAll of these may be useful, but a new visitor still asks one concrete question: can I paste a real error and find a useful lesson fast? If the homepage, README, and release notes explain architecture before showing a working search result, the project feels abstract even when the underlying system is healthy. (search-first-roadmap-loop)", "condition": "plain", "status": 200, "content": "The issue you're facing is that your project's homepage, README, and release notes are explaining the architecture, but not providing a concrete example or a working search result, which can be confusing for new visitors. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Create a simple example**\n\nCreate a new file called `example_search_result.md` in the root of your project with the following content:\n```markdown\n# Example Search Result\n\nThis is an example search result.\n\nYou can paste this error and find a useful lesson fast:\n```\n**Step 2: Add a link to the example search result**\n\nUpdate your `README.md` file to include a link to the example search result:\n```markdown\n# [Agent-Knowledge Project](https://github.com/your-username/agent-knowledge-project)\n\n## Getting Started\n\n* Read the [architecture documentation](https://github.com/your-username/agent-knowledge-project/wiki/Architecture)\n* See an example search result: [Example Search Result](https://github.com/your-username/agent-knowledge-project/blob/main/example_search_result.md)\n```\n**Step 3: Add a search button to the homepage**\n\nUpdate your `index.md` file to include a search button", "metrics": { "length": 1176, "commands": 2, "command_list": [ "**Step 2: Add a link to the example search result**", "Update your `README.md` file to include a link to the example search result:" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "with_lesson", "status": 200, "content": "To fix the accidental `__pycache__` artifacts committed to a data repository, follow these steps:\n\n**Step 1: Remove the artifacts from the index and disk**\n\n```bash\n# Remove the staged artifacts from the index\ngit rm --cached -r __pycache__ 2/dev/null || true\n\n# Remove the staged artifacts from the disk\ngit rm -r --cached '.pyc' 2/dev/null || true\n\n# Manually remove the Python bytecode files from the disk\nrm -rf __pycache__\n```\n\n**Step 2: Add a `.gitignore` covering Python bytecode**\n\nCreate a new file named `.gitignore` in the root of your repository with the following contents:\n\n```text\n__pycache__/\n.pyc\n```\n\n**Step 3: Re-stage only the intended files instead of the whole directory**\n\n```bash\n# Re-stage only the intended files\ngit add references/offers/sdks.csv\n```\n\n**Step 4: Commit the changes with a meaningful message**\n\n```bash\n# Commit the changes\ngit commit -m \"fix: remove committed pycache artifacts\"\n```\n\n**Verification**\n\n```bash\n# Verify the diff contains only intended changes\ngit status --short |", "metrics": { "length": 1022, "commands": 6, "command_list": [ "git rm --cached -r __pycache__ 2/dev/null || true", "git rm -r --cached '.pyc' 2/dev/null || true", "rm -rf __pycache__", "**Step 3: Re-stage only the intended files instead of the whole directory**", "**Step 4: Commit the changes with a meaningful message**" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "A pull request intended to change CSV data rows also shipped `__pycache__/csv_to_json.cpython-314.pyc` (and similar bytecode files). The reviewer flagged it as a MEDIUM issue: repository bloat, non-deterministic artifacts, and potential noise that obscures the real diff. The branch could not merge until the artifacts were removed. (accidental-pycache-commit)", "condition": "plain", "status": 200, "content": "To fix the accidental-pycache-commit issue, you'll need to remove the Python bytecode files generated by the `csv_to_json` module. Here's a step-by-step solution:\n\n**Step 1: Find the problematic files**\n\nRun the following command to find the Python bytecode files generated by the `csv_to_json` module:\n```bash\ngit ls-files --other --directory .\n```\nThis command will show you the paths of the Python bytecode files.\n\n**Step 2: Remove the bytecode files**\n\nRun the following command to remove the bytecode files:\n```bash\ngit rm --cached -r .\n```\nThis command will remove the files from the Git index, but leave them on your local machine.\n\n**Step 3: Commit the changes**\n\nRun the following command to commit the changes:\n```bash\ngit commit -m \"Remove accidental Python bytecode files\"\n```\nThis command will create a new commit that removes the bytecode files.\n\n**Step 4: Force-push the branch**\n\nSince the branch couldn't merge before, you'll need to force-push the branch to update the remote repository:\n```bash\ngit push origin --force-with-lease\n```\nReplace `` with the name of your branch.\n\n**Step ", "metrics": { "length": 1129, "commands": 4, "command_list": [ "git ls-files --other --directory .", "git rm --cached -r .", "git commit -m \"Remove accidental Python bytecode files\"", "git push origin --force-with-lease" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to install the `misakanet_register` tool. Here's a step-by-step guide:\n\n**Step 1: Install Python and required dependencies**\n\nIf you haven't installed Python and required dependencies, run the following commands:\n```bash\nsudo apt-get update\nsudo apt-get install python3 python3-pip\npip3 install --upgrade pip\n```\n\n**Step 2: Install the misakanet_register tool**\n\nRun the following command to install the `misakanet_register` tool:\n```bash\npip3 install misakanet-register\n```\n\n**Step 3: Configure the misakanet_register tool**\n\nCreate a configuration file for the `misakanet_register` tool. You can use the following command to create a default configuration file:\n```bash\nmisakanet-register config create\n```\n\n**Step 4: Update the configuration file**\n\nUpdate the `misakanet_register` configuration file to include your `MISAKANET_TOKEN` and `MISAKANET_URL`. You can do this by running the following command:\n```bash\nmisakanet-register config update\n```\n\n**Step 5: Register your node**\n\nRun the following command to register your node using the `mis", "metrics": { "length": 1076, "commands": 6, "command_list": [ "sudo apt-get update", "sudo apt-get install python3 python3-pip", "pip3 install --upgrade pip", "pip3 install misakanet-register", "misakanet-register config create" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 1, "lesson_hit_rate": 0.25 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Current node registration requires GitHub account and opening an issue, which is too slow for autonomous agents. (agent-first-node-registration-via-mcp)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the requirement of GitHub account and opening an issue for node registration, which might be too slow for autonomous agents. Here's a concrete, actionable fix:\n\n**Method 1: Using the `--no-require-github` flag**\n\nYou can use the `--no-require-github` flag when running the command to register the node. This flag disables the GitHub requirement.\n\n```bash\n# For Linux or macOS\nnats-server register --no-require-github \n\n# For Windows\nnats-server register --no-require-github \n```\n\n**Method 2: Creating a GitHub Token**\n\nAnother approach is to create a GitHub token that has the required permissions to register a node. You can then use this token when registering the node.\n\nHere's how to create a GitHub token:\n\n```bash\n# Create a new GitHub token\ngh token create --public --repo --full-control\n\n# Use the generated token to register the node\nnats-server register --github-token \n```\n\n**Method 3: Using a GitHub App**\n\nIf you have", "metrics": { "length": 1098, "commands": 4, "command_list": [ "nats-server register --no-require-github ", "nats-server register --no-require-github ", "gh token create --public --repo --full-control", "nats-server register --github-token " ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-Reach — Multi-Platform Internet Access for AI Agents (agent-reach-multi-platform-scraper)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing is likely due to the fact that the `agent-reach` tool is not properly configured or installed. Here's a step-by-step guide to help you fix the issue:\n\n**Step 1: Install the `agent-reach` tool**\n\nIf you haven't already, install the `agent-reach` tool using the following command:\n```bash\npip install https://github.com/Panniantong/agent-reach/archive/main.zip\n```\n**Step 2: Create a virtual environment**\n\nCreate a new virtual environment for `agent-reach` using the following command:\n```bash\npython3 -m venv ~/.agent-reach-venv\n```\n**Step 3: Activate the virtual environment**\n\nActivate the virtual environment using the following command:\n```bash\nsource ~/.agent-reach-venv/bin/activate\n```\n**Step 4: Install required channels**\n\nInstall the required channels for the platforms you want to access. For example, to install the `reddit` and `twitter` channels, use the following command:\n```bash\nagent-reach install --channels reddit,twitter\n```\n**Step 5: Configure proxy (if needed)**\n\nIf you're behind a proxy, configure it using the", "metrics": { "length": 1065, "commands": 4, "command_list": [ "pip install https://github.com/Panniantong/agent-reach/archive/main.zip", "python3 -m venv ~/.agent-reach-venv", "source ~/.agent-reach-venv/bin/activate", "agent-reach install --channels reddit,twitter" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-Reach — Multi-Platform Internet Access for AI Agents (agent-reach-multi-platform-scraper)", "condition": "plain", "status": 200, "content": "I don't see any code or error message in your question. However, I can provide a general solution for a common issue that might be related to the Agent-Reach project.\n\nIf you're experiencing issues with installing the `agent-reach-multi-platform-scraper` package, here are some steps you can try:\n\n**Step 1: Update pip**\n\nOpen your terminal and run the following command to update pip:\n\n```bash\npython -m pip install --upgrade pip\n```\n\n**Step 2: Install dependencies**\n\nRun the following command to install the required dependencies:\n\n```bash\npython -m pip install -r requirements.txt\n```\n\nIf you don't have a `requirements.txt` file, you can create one by running:\n\n```bash\npython -m pip freeze > requirements.txt\n```\n\n**Step 3: Install the agent-reach package**\n\nRun the following command to install the `agent-reach` package:\n\n```bash\npython -m pip install agent-reach\n```\n\n**Step 4: Install the scraper**\n\nRun the following command to install the `agent-reach-multi-platform-scraper` package:\n\n```bash\npython -m pip install agent-reach-multi-platform-scraper\n```\n\nIf you're still experiencing issues, you", "metrics": { "length": 1108, "commands": 5, "command_list": [ "python -m pip install --upgrade pip", "python -m pip install -r requirements.txt", "python -m pip freeze > requirements.txt", "python -m pip install agent-reach", "python -m pip install agent-reach-multi-platform-scraper" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent-Reach — Multi-Platform Internet Access for AI Agents (agent-reach-multi-platform-scraper)", "condition": "with_lesson", "status": 200, "content": "To resolve the issue of AI agents needing to access multiple internet platforms with varying authentication and API requirements, follow these concrete steps using the Agent-Reach tool:\n\n### Step 1: Create a Virtual Environment\n\nFirst, create a virtual environment to isolate the Agent-Reach installation and its dependencies. Open your terminal and run:\n\n```bash\npython3 -m venv ~/.agent-reach-venv\n```\n\n### Step 2: Activate the Virtual Environment\n\nActivate the virtual environment you just created:\n\n```bash\nsource ~/.agent-reach-venv/bin/activate\n```\n\nOn Windows, use:\n\n```bash\n~/.agent-reach-venv/Scripts/activate\n```\n\n### Step 3: Install Agent-Reach\n\nInstall Agent-Reach from the GitHub repository:\n\n```bash\npip install https://github.com/Panniantong/agent-reach/archive/main.zip\n```\n\n### Step 4: Install Channels\n\nInstall the channels (platforms) you need. For example, to install Reddit and Twitter, run:\n\n```bash\nagent-reach install --channels reddit,twitter\n```\n\nThis command installs the necessary tools like `rdt-cli` for Reddit and `twitter-cli` for Twitter.\n\n### Step 5: Auto-", "metrics": { "length": 1090, "commands": 5, "command_list": [ "python3 -m venv ~/.agent-reach-venv", "source ~/.agent-reach-venv/bin/activate", "~/.agent-reach-venv/Scripts/activate", "pip install https://github.com/Panniantong/agent-reach/archive/main.zip", "agent-reach install --channels reddit,twitter" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent-Reach — Multi-Platform Internet Access for AI Agents (agent-reach-multi-platform-scraper)", "condition": "plain", "status": 200, "content": "To provide a concrete and actionable fix for the issue you're encountering with Agent-Reach, a multi-platform internet access tool for AI agents, I would need more specific details about the error message you're seeing. However, since you haven't provided the exact error message, I'll guide you through a general troubleshooting process that might help resolve common issues. This process includes updating dependencies, checking for compatibility issues, and ensuring that your environment is correctly set up.\n\n### Step 1: Update Your Dependencies\n\nFirst, ensure that all your dependencies are up to date. If you're using `pip` for Python packages, you can update your dependencies by running:\n\n```bash\npip install --upgrade -r requirements.txt\n```\n\nIf you're using a virtual environment, make sure it's activated before running the command.\n\n### Step 2: Check Compatibility\n\nEnsure that your Python version and other dependencies are compatible with Agent-Reach. You can check your Python version with:\n\n```bash\npython --version\n```\n\nOr, if you have both Python 2 and Python 3 installed and want to check the version of Python 3 specifically:\n\n```bash\npython3 --version\n```\n\n### Step 3: Reinstall Agent-Reach\n\nSometimes, simply reinstalling the", "metrics": { "length": 1248, "commands": 3, "command_list": [ "pip install --upgrade -r requirements.txt", "python --version", "python3 --version" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent Web Access Toolchain — 7 Libraries for Reliable Forum Scraping (agent-web-access-toolchain-selection)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (0b36b6f6-fb80-489c'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Web Access Toolchain — 7 Libraries for Reliable Forum Scraping (agent-web-access-toolchain-selection)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (47830c18-da00-4a6a'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider CLI `--api-key` parameter leaks API key to `.aider.chat.history.md`, bash history, and `/proc/pid/cmdline`.\n\nWhen a user runs a command like:\n```bash\naider --api-key sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\n```\n\nThe API key is exposed in at least three places:\n1. **Shell history files** (e.g., `~/.bash_history`, `~/.zsh_history`) — persisted across sessions and often synced or backed up.\n2. **Aider's own chat history file** (`.aider.chat.history.md`) — written to the project directory and may be committed to version control.\n3. **`/proc//cmdline`** — readable by other processes on the same host while the process is running, which is a risk in shared or multi-tenant environments. (aider-api-key-leak)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (352c4aa4-3819-4566'" }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent Web Access Toolchain — 7 Libraries for Reliable Forum Scraping (agent-web-access-toolchain-selection)", "condition": "plain", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (3198b649-cf84-4d16'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Web Access Toolchain — 7 Libraries for Reliable Forum Scraping (agent-web-access-toolchain-selection)", "condition": "plain", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (b9b23713-c335-4a57'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Auto-Merge CI Pipeline — DCO, Quality Score, Shadow Branch, Dynamic Deps, Auto-Merge (auto-merge-ci-pipeline)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (a2b0b428-ef89-4fd3'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AI Agent Contributor Engagement — Lightweight Retention Strategy (contributor-engagement-retention)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (978ed7dd-a38c-4f9d'" }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Auto-Merge CI Pipeline — DCO, Quality Score, Shadow Branch, Dynamic Deps, Auto-Merge (auto-merge-ci-pipeline)", "condition": "with_lesson", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (2d6bba4d-a003-4826'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Auto-Merge CI Pipeline — DCO, Quality Score, Shadow Branch, Dynamic Deps, Auto-Merge (auto-merge-ci-pipeline)", "condition": "plain", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (f640c53f-8d8f-4f2f'" }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Auto-Merge CI Pipeline — DCO, Quality Score, Shadow Branch, Dynamic Deps, Auto-Merge (auto-merge-ci-pipeline)", "condition": "plain", "status": 429, "content": "", "metrics": { "length": 0, "commands": 0, "has_command_block": false, "actionable": false, "has_code_inline": false, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": "b'{\"name\":\"AiError\",\"internalCode\":4006,\"httpCode\":429,\"message\":\"AiError: AiError: you have used up your daily free allocation of 10,000 neurons, please upgrade to Cloudflare\\'s Workers Paid plan if you would like to continue usage. (bb8a4940-ede0-4555'" }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Actions Script Injection — Use env Variables Instead of Inline Interpolation (github-actions-code-injection)", "condition": "plain", "status": 200, "content": "The GitHub Actions error you're encountering is due to the use of inline interpolation in your script. Inline interpolation is not allowed in GitHub Actions and is causing the error. Here's a concrete, actionable fix with exact commands:\n\n**Before:**\n\n```yml\nname: Build and deploy\n\non:\n push:\n branches:\n - main\n\njobs:\n build-and-deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n - name: Install dependencies\n run: |\n npm install\n - name: Build and deploy\n run: |\n npm run build && npm run deploy\n```\n\n**After:**\n\n```yml\nname: Build and deploy\n\non:\n push:\n branches:\n - main\n\njobs:\n build-and-deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n - name: Install dependencies\n env:\n NPM_CONFIG_USER: ${{ secrets.NPM_CONFIG_USER }}\n NPM_CONFIG_PASSWORD: ${{ secrets.NPM_CONFIG_PASSWORD }}\n run: |\n npm install\n - name:", "metrics": { "length": 1045, "commands": 1, "command_list": [ "**After:**" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AI Agent Contributor Engagement — Lightweight Retention Strategy (contributor-engagement-retention)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely related to a missing or incorrect configuration in your Kubernetes cluster. The error message suggests that the `contributor-engagement-retention` custom resource (CR) is not being created.\n\nTo fix this issue, you'll need to create a YAML file that defines the `contributor-engagement-retention` CR and apply it to your cluster using the `kubectl apply` command.\n\nHere's a step-by-step solution:\n\n**Step 1: Create a YAML file**\n\nCreate a file named `contributor-engagement-retention.yaml` with the following content:\n```yaml\napiVersion: ai.example.com/v1alpha1\nkind: ContributorEngagementRetention\nmetadata:\n name: my-contributor-engagement-retention\nspec:\n # Add your desired configuration here\n retentionPeriod: 30d\n notificationThreshold: 10\n```\nReplace the `# Add your desired configuration here` comment with your desired configuration settings.\n\n**Step 2: Apply the YAML file**\n\nRun the following command to apply the YAML file to your cluster:\n```bash\nkubectl apply -f contributor-engagement-retention.yaml\n```\nThis will create the `contributor-engagement-retention` CR with the specified configuration.\n\n**Step ", "metrics": { "length": 1163, "commands": 3, "command_list": [ "Replace the `# Add your desired configuration here` comment with your desired configuration settings.", "**Step 2: Apply the YAML file**", "Run the following command to apply the YAML file to your cluster:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Actions Script Injection — Use env Variables Instead of Inline Interpolation (github-actions-code-injection)", "condition": "with_lesson", "status": 200, "content": "To fix the GitHub Actions Script Injection error, you can use environment variables instead of inline interpolation in your scripts. Here's a concrete, actionable fix with exact commands:\n\n**Before (vulnerable)**\n```yaml\n- name: Vulnerable script\n run: |\n TITLE=\"${{ github.event.issue.title }}\"\n if echo \"$TITLE\" | grep -qi \"bug\"; then echo \"is bug\"; fi\n```\n**After (safe)**\n```yaml\n- name: Safe script\n env:\n ISSUE_TITLE: ${{ github.event.issue.title }}\n run: |\n if echo \"$ISSUE_TITLE\" | grep -qi \"bug\"; then echo \"is bug\"; fi\n```\nIn the vulnerable version, the `github.event.issue.title` variable is directly interpolated into the script using double quotes (`\"`) and shell syntax (`${{ }}`). This allows an attacker to inject malicious commands by crafting a title with shell syntax.\n\nIn the safe version, the `github.event.issue.title` variable is passed as an environment variable using `env:`. The `run:` script then uses the environment variable value directly, without interpolation or shell syntax. This prevents an attacker from injecting malicious commands.\n\n**Verification**\n\n1. Create a new GitHub Actions workflow", "metrics": { "length": 1143, "commands": 1, "command_list": [ "**After (safe)**" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search-first roadmap loop for agent knowledge projects (search-first-roadmap-loop)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Search-first roadmap loop for agent knowledge projects\" issue, you need to separate the different layers of information and make sure that the first user action is concrete and actionable.\n\nHere's a step-by-step guide to achieve this:\n\n**Step 1: Create a new README file for each layer**\n\nCreate separate README files for the following layers:\n\n* `layer1.md` for OKF-compatible Markdown lessons\n* `layer2.md` for zero-dependency local search and optional SQLite/SAG-Lite index\n* `layer3.md` for access layers (e.g., CLI, API, etc.)\n\n**Step 2: Organize the main README file**\n\nIn the main README file, create a section that links to each of the above README files. This will help maintainers and contributors find the information they need.\n\nExample:\n```markdown\n# Agent Knowledge Project\n\n[OKF-compatible Lessons](layer1.md)\n[Search and Index](layer2.md)\n[Access Layers](layer3.md)\n```\n**Step 3: Update the homepage and release notes**\n\nUpdate the homepage and release notes to point to the main README file and the separate README files for each layer.\n\nExample:\n```markdown\n# Homepage\n\nWelcome to our agent knowledge project!", "metrics": { "length": 1139, "commands": 3, "command_list": [ "**Step 3: Update the homepage and release notes**", "Update the homepage and release notes to point to the main README file and the separate README files for each layer.", "Example:" ], "has_command_block": true, "actionable": false, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search-first roadmap loop for agent knowledge projects (search-first-roadmap-loop)", "condition": "plain", "status": 200, "content": "The error \"Search-first roadmap loop for agent knowledge projects (search-first-roadmap-loop)\" typically occurs when there's a circular dependency between agents or projects in your roadmap. To fix this issue, you can try the following steps:\n\n1. **Disable the roadmap**: Temporarily disable the roadmap to prevent further interactions between agents and projects.\n2. **Identify the circular dependency**: Use the `discovery` command to identify the agents and projects involved in the circular dependency.\n3. **Remove the circular dependency**: Manually remove the circular dependency by deleting the affected agents or projects.\n4. **Re-enable the roadmap**: Once the circular dependency is removed, re-enable the roadmap.\n\nHere are the exact commands to fix the issue:\n\n**Disable the roadmap:**\n```bash\n# Disable the roadmap\nadmin command disable-roadmap\n```\n\n**Identify the circular dependency:**\n```bash\n# Use the discovery command to identify the agents and projects involved in the circular dependency\nadmin command discovery --roadmap \n```\n\n**Remove the circular dependency:**\n```bash\n# Manually remove the circular dependency by deleting the affected agents or projects\nadmin command delete-agent \nadmin command delete-project \n```\n\n**Re", "metrics": { "length": 1286, "commands": 4, "command_list": [ "admin command disable-roadmap", "admin command discovery --roadmap ", "admin command delete-agent ", "admin command delete-project " ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "AI Agent Contributor Engagement — Lightweight Retention Strategy (contributor-engagement-retention)", "condition": "with_lesson", "status": 200, "content": "To address the issue of AI Agent contributor engagement and retention, follow these concrete steps:\n\n**Step 1: Automate Thank-You Comments**\n\n1. Create a GitHub Actions workflow to post a thank-you comment after each PR merge.\n2. Use the `github.actions/checkout` action to check out the repository.\n3. Use the `github.actions/comment` action to post a comment.\n\nExample workflow file (`.github/workflows/thank-you-comment.yml`):\n```yml\nname: Thank-You Comment\n\non:\n pull_request:\n types: [merged]\n\njobs:\n comment:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout repository\n uses: actions/checkout@v2\n - name: Post thank-you comment\n uses: actions/comment@v1\n with:\n github-token: ${{ secrets.GITHUB_TOKEN }}\n comment: \"Solid addition — the [specific technical point] makes the [component] genuinely robust.\"\n```\nReplace `[specific technical point]` and `[component]` with the actual details from the PR.\n\n**Step 2: Star Contributor Repositories**\n\n1. Create a GitHub Actions workflow to star the contributor's repository.\n2. Use the `github.actions", "metrics": { "length": 1111, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 7, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "AI Agent Contributor Engagement — Lightweight Retention Strategy (contributor-engagement-retention)", "condition": "plain", "status": 200, "content": "To address the issue with the \"AI Agent Contributor Engagement — Lightweight Retention Strategy (contributor-engagement-retention),\" I'll provide a step-by-step guide to help resolve the problem. Since the specific error details aren't provided, I'll outline a general approach that can be adapted based on the actual error message or context.\n\n### Step 1: Review the Error Message\nCarefully read the error message to understand the nature of the issue. Is it related to a specific command, a dependency issue, or perhaps a configuration problem?\n\n### Step 2: Check Dependencies and Versions\nEnsure all dependencies required by the \"contributor-engagement-retention\" strategy are up to date and compatible with your current environment. This might involve checking package versions or library dependencies.\n\n#### For npm (Node Package Manager):\n```bash\nnpm outdated\nnpm update\n```\n\n#### For pip (Python Package Installer):\n```bash\npip list --outdated\npip install --upgrade [package_name]\n```\n\n### Step 3: Verify Configuration Files\nIf the issue is related to configuration, review your configuration files (e.g., `config.json`, `.env`) for any typos or incorrect settings.\n\n### Step 4: Run Diagnostic Commands\nDepending on the technology stack, run", "metrics": { "length": 1248, "commands": 4, "command_list": [ "npm outdated", "npm update", "pip list --outdated", "pip install --upgrade [package_name]" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "GitHub Actions Script Injection — Use env Variables Instead of Inline Interpolation (github-actions-code-injection)", "condition": "plain", "status": 200, "content": "To fix the GitHub Actions Script Injection error, you need to replace inline interpolation with environment variables. Here's a step-by-step guide:\n\n**Error Example:**\n```yml\nname: Build and Deploy\non: [push]\njobs:\n build-and-deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n - name: Run script\n run: |\n echo \"Deploying to ${GITHUB_REPOSITORY}\"\n # script that uses $GITHUB_REPOSITORY\n```\n**Fix:**\n\n1. **Replace inline interpolation with environment variables**:\n```yml\nname: Build and Deploy\non: [push]\njobs:\n build-and-deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n - name: Run script\n env:\n REPO: ${{ github.repository }}\n run: |\n echo \"Deploying to $REPO\"\n # script that uses $REPO\n```\nIn this example, we've replaced the inline interpolation `${GITHUB_REPOSITORY}` with an environment variable `REPO` defined in the", "metrics": { "length": 1018, "commands": 2, "command_list": [ "**Fix:**", "1. **Replace inline interpolation with environment variables**:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Accidental __pycache__ artifacts committed to a data repository (accidental-pycache-commit)", "condition": "with_lesson", "status": 200, "content": "To fix the accidental __pycache__ artifacts committed to a data repository, follow these steps:\n\n**Step 1: Remove the artifacts from the index and disk**\n\nRun the following commands in your terminal:\n\n```bash\ngit rm --cached -r __pycache__ 2/dev/null || true\ngit rm -r --cached '.pyc' 2/dev/null || true\nrm -rf __pycache__\n```\n\nThese commands remove the staged bytecode files from the index and disk.\n\n**Step 2: Add a .gitignore covering Python bytecode**\n\nCreate a new file named `.gitignore` in the root of your repository with the following contents:\n\n```bash\n__pycache__/\n.pyc\n```\n\nThis will prevent any future bytecode files from being staged.\n\n**Step 3: Re-stage only the intended files**\n\nRun the following command to stage only the intended files:\n\n```bash\ngit add references/offers/sdks.csv\n```\n\n**Step 4: Commit the changes**\n\nRun the following command to commit the changes:\n\n```bash\ngit commit -m \"fix: remove committed pycache artifacts\"\n```\n\n**Verification**\n\nRun the following commands to verify that the diff contains only intended changes:\n\n```bash\ngit status --", "metrics": { "length": 1079, "commands": 7, "command_list": [ "git rm --cached -r __pycache__ 2/dev/null || true", "git rm -r --cached '.pyc' 2/dev/null || true", "rm -rf __pycache__", "__pycache__/", ".pyc" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Accidental __pycache__ artifacts committed to a data repository (accidental-pycache-commit)", "condition": "plain", "status": 200, "content": "The error message \"Accidental __pycache__ artifacts committed to a data repository (accidental-pycache-commit)\" usually occurs when you've accidentally committed Python cache files (`.pyc` files) to your version control system, such as Git.\n\nHere's a step-by-step fix:\n\n### Step 1: Identify and remove the problematic files\n\nFirst, you need to identify the `.pyc` files that were committed. You can do this by running the following command in your terminal:\n\n```bash\ngit ls-files --error-unmatch *.pyc\n```\n\nThis command will list all files that match the pattern `*.pyc` and have an error (i.e., are untracked).\n\n### Step 2: Remove the problematic files\n\nOnce you've identified the files, you can remove them using the following command:\n\n```bash\ngit rm --cached *.pyc\n```\n\nThe `--cached` option tells Git to remove the files from the index, but not from the working directory.\n\n### Step 3: Commit the removal of the problematic files\n\nTo confirm that the files are indeed removed, you can commit the removal using the following command:\n\n```bash\ngit commit -m \"Remove accidental __pycache__ artifacts\"\n```\n\n###", "metrics": { "length": 1111, "commands": 3, "command_list": [ "git ls-files --error-unmatch *.pyc", "git rm --cached *.pyc", "git commit -m \"Remove accidental __pycache__ artifacts\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "GitHub Actions Script Injection — Use env Variables Instead of Inline Interpolation (github-actions-code-injection)", "condition": "with_lesson", "status": 200, "content": "To fix the GitHub Actions Script Injection vulnerability, you need to use environment variables instead of inline interpolation for user-controlled variables. Here's a step-by-step guide:\n\n**Identify vulnerable code**\n\nLook for `run` scripts in your GitHub Actions workflow files (`.yml` files) that directly use user-controlled variables like `github.event.issue.body` or `github.event.pull_request.title`.\n\n**Refactor vulnerable code**\n\nReplace the inline interpolation with environment variables. For example, change this:\n```yaml\n- run: |\n BODY=\"${{ github.event.issue.body }}\"\n echo \"$BODY\" | grep \"keyword\"\n```\nto this:\n```yaml\n- run: |\n echo \"$ISSUE_BODY\" | grep \"keyword\"\n env:\n ISSUE_BODY: ${{ github.event.issue.body }}\n```\n**Repeat for all vulnerable code**\n\nApply the same fix to all occurrences of user-controlled variables in your `run` scripts.\n\n**Verify the fix**\n\n1. Create a test workflow with a `run` script that echoes a user-controlled variable, like `github.event.issue.title`. This should trigger a CodeQL alert for code injection.\n2. Refactor the workflow to use an environment variable, like `TITLE`, instead of inline interpolation.\n3. Re-run", "metrics": { "length": 1181, "commands": 1, "command_list": [ "to this:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-first node registration via MCP (agent-first-node-registration-via-mcp)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to install the `mcp` tool and its dependencies. Here's a step-by-step guide:\n\n1. Install Docker:\n\n ```bash\nsudo apt update\nsudo apt install docker.io -y\n```\n\n2. Pull the `mcp` image from Docker Hub:\n\n ```bash\ndocker pull misakanet/mcp\n```\n\n3. Run the `mcp` container and expose port 8080:\n\n ```bash\ndocker run -d -p 8080:8080 misakanet/mcp\n```\n\n4. Create a new file named `mcp_config.json` with the following content:\n\n ```json\n{\n \"mcp\": {\n \"agent_type\": \"your_agent_type_here\"\n }\n}\n```\n\n Replace `\"your_agent_type_here\"` with the type of agent you're using (e.g., \"claude-code\", \"codex\", etc.).\n\n5. Run the `mcp` tool with the `agent_first_node_registration-via-mcp` command:\n\n ```bash\npython3 scripts/search_knowledge.py \"test query\" --mcp_config mcp_config.json\n```\n\n This will register the agent and obtain a node ID, token,", "metrics": { "length": 874, "commands": 6, "command_list": [ "sudo apt update", "sudo apt install docker.io -y", "docker pull misakanet/mcp", "docker run -d -p 8080:8080 misakanet/mcp", "Replace `\"your_agent_type_here\"` with the type of agent you're using (e.g., \"claude-code\", \"codex\", etc.)." ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 1, "lesson_hit_rate": 0.25 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Search-first roadmap loop for agent knowledge projects (search-first-roadmap-loop)", "condition": "with_lesson", "status": 200, "content": "To address the \"Search-first roadmap loop for agent knowledge projects\" error, follow these concrete steps:\n\n### 1. Simplify Your Project's Entry Points\n\nEnsure your project's homepage, README, and release notes prioritize a working search result over architectural explanations. This means:\n\n- **Update README**: Move technical architecture details to a secondary page (e.g., `ARCHITECTURE.md`) and focus the README on how to use the search function.\n- **Simplify Homepage**: Make sure the homepage has a clear call-to-action (CTA) for searching, such as a prominent search bar.\n\n### 2. Implement Layered Messaging\n\nOrganize your project's communication into layers:\n\n- **Format Layer**: Use OKF-compatible Markdown for lessons to ensure consistency and ease of use.\n- **Search Layer**: Implement zero-dependency local search. If you're using a tool like GitHub, utilize its search functionality. For more advanced needs, consider integrating SQLite or SAG-Lite for indexing.\n- **Access Layer**: Ensure that your search functionality is easily accessible. If you're using a CLI tool, make sure the search command is straightforward (e.g., `tool search `).\n\n### 3. Unify Metrics and Interfaces\n\n- **Metric Unification", "metrics": { "length": 1224, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Search-first roadmap loop for agent knowledge projects (search-first-roadmap-loop)", "condition": "plain", "status": 200, "content": "To address the \"Search-first roadmap loop for agent knowledge projects\" error, you'll need to take steps to resolve the loop that's causing the issue. Since the exact steps can vary depending on the specific system, tools, or software you're using, I'll provide a general approach that you can adapt to your situation. This approach involves identifying the loop, assessing its impact, and then taking corrective action.\n\n### Step 1: Identify the Loop\n\nFirst, you need to understand where the loop is occurring. This could be in a workflow, a software application, or a process related to agent knowledge projects.\n\n- **Review Logs and Documentation**: Look through system logs, project documentation, and communication records to pinpoint where the loop starts and ends.\n- **Consult with Team Members**: Talk to colleagues who work on agent knowledge projects to gather insights on the workflows and potential bottlenecks.\n\n### Step 2: Analyze the Loop's Impact\n\nOnce you've identified the loop, assess its impact on your projects and workflows.\n\n- **Evaluate Efficiency**: Determine how the loop affects project timelines, resource allocation, and overall efficiency.\n- **Identify Pain Points**: Note any specific challenges or frustrations reported by team members or stakeholders related to the loop.\n\n### Step 3: Correct", "metrics": { "length": 1325, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-first node registration via MCP (agent-first-node-registration-via-mcp)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to agent-first node registration via MCP (Multi-Controller Protocol). Here's a step-by-step guide to resolve the issue:\n\n**Check MCP Service Status**\n\n1. Open a command prompt or terminal as an administrator.\n2. Type the following command to check the MCP service status:\n ```bash\nsc query mcpservice\n```\n This command will display the current status of the MCP service.\n\n**Stop and Start MCP Service**\n\nIf the MCP service is not running or not responding, try stopping and starting it:\n\n1. Stop the MCP service:\n ```bash\nnet stop mcpservice\n```\n2. Start the MCP service:\n ```bash\nnet start mcpservice\n```\n\n**Check Agent-First Node Registration**\n\n1. Open a command prompt or terminal as an administrator.\n2. Type the following command to check the agent-first node registration status:\n ```bash\nmcp status\n```\n This command will display the current status of the agent-first node registration.\n\n**Register Agent-First Node Manually**\n\nIf the agent-first node registration is not working automatically, you can try registering it manually:\n\n1. Open a command prompt or terminal as an administrator.\n2. Type the following command to", "metrics": { "length": 1184, "commands": 4, "command_list": [ "sc query mcpservice", "net stop mcpservice", "net start mcpservice", "mcp status" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider CLI --api-key parameter leaks API key to history files (aider-api-key-leak)", "condition": "with_lesson", "status": 200, "content": "To fix the \"secrets in arguments\" vulnerability in Aider CLI, you need to secure the API key by not passing it as a command-line argument. Here's a concrete, actionable fix:\n\n**Step 1: Remove the `--api-key` parameter from the Aider CLI command**\n\nReplace the command:\n```bash\nbash\naider --api-key sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\n```\nwith:\n```bash\nbash\naider\n```\n\n**Step 2: Store the API key securely**\n\nInstead of hardcoding the API key, create a secure environment variable to store it. You can do this by adding the following line to your shell configuration file (e.g., `~/.bashrc` or `~/.zshrc`):\n```bash\nexport AIDER_API_KEY=\"sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\"\n```\nAlternatively, you can use a secrets manager like `aws secretsmanager` or `google cloud secret manager` to store and retrieve the API key securely.\n\n**Step 3: Update the Aider CLI configuration**\n\nCreate a new file named `.aider/config.json` in the Aider CLI configuration directory (usually `~/.aider` or `/usr/local/aider`):\n", "metrics": { "length": 1000, "commands": 5, "command_list": [ "bash", "aider --api-key sk-ant-api03-XXXXXXXXXXXXXXXXXXXX", "bash", "aider", "export AIDER_API_KEY=\"sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider CLI --api-key parameter leaks API key to history files (aider-api-key-leak)", "condition": "plain", "status": 200, "content": "To fix the issue of Aider CLI leaking API keys to history files, you can use the following steps:\n\n**Method 1: Disable History Saving**\n\nYou can disable history saving for the Aider CLI by running the following command:\n\n```bash\nexport AIDER_DISABLE_HISTORY=true\n```\n\nThis will prevent Aider CLI from saving any history to the shell's history file.\n\n**Method 2: Clear Shell History**\n\nIf you have already saved the API key to your shell's history, you can clear the history by running the following commands:\n\n```bash\nhistory -1\n```\n\nThis will show the last command that was saved to the history file. You can then delete the line that contains the API key.\n\n```bash\nhistory -d \n```\n\nReplace `` with the actual number of the line that contains the API key.\n\n**Method 3: Use `AIDER_API_KEY` Environment Variable**\n\nYou can also use the `AIDER_API_KEY` environment variable to avoid saving the API key to the shell's history file. Set the environment variable before running the Aider CLI:\n\n```bash\nexport AIDER_API_KEY=YOUR_API_KEY\n```\n\nReplace `YOUR_API_KEY` with your actual API key.\n\n**Method", "metrics": { "length": 1120, "commands": 4, "command_list": [ "export AIDER_DISABLE_HISTORY=true", "history -1", "history -d ", "export AIDER_API_KEY=YOUR_API_KEY" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent-first node registration via MCP (agent-first-node-registration-via-mcp)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Agent-first node registration via MCP\" error, you need to implement the `misakanet_register` MCP tool. Here's a step-by-step guide:\n\n**Step 1: Create a new Python script for the `misakanet_register` tool**\n\nCreate a new file called `misakanet_register.py` with the following code:\n```python\nimport uuid\nimport datetime\nimport json\n\ndef register_agent(agent_type):\n node_id = f\"Misaka{uuid.uuid4().hex[:8]}\"\n token = f\"mcp_{uuid.uuid4().hex[:16]}\"\n registered_at = datetime.datetime.now().isoformat()\n\n # Store token in KV for validation\n with open(\"tokens.json\", \"r+\") as f:\n tokens = json.load(f)\n tokens[token] = node_id\n f.seek(0)\n json.dump(tokens, f)\n f.truncate()\n\n return {\n \"node_id\": node_id,\n \"token\": token,\n \"registered_at\": registered_at\n }\n\nif __name__ == \"__main__\":\n agent_type = input(\"Enter agent type (e.g. claude-code, codex, cursor, dsh, other): \")\n result = register", "metrics": { "length": 983, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 3, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Agent-first node registration via MCP (agent-first-node-registration-via-mcp)", "condition": "plain", "status": 200, "content": "To fix the \"Agent-first node registration via MCP\" error, you'll need to manually approve the node's certificate signing request (CSR) using the Kubernetes command-line tool, `kubectl`. Here are the exact commands to resolve the issue:\n\n**Step 1: Get the node's CSR**\n```bash\nkubectl get csr\n```\nThis command will list all pending CSRs, including the one for the node that's causing the error.\n\n**Step 2: Approve the node's CSR**\n```bash\nkubectl certificate approve \n```\nReplace `` with the actual name of the CSR for the node that's causing the error. You can find the name in the output of the `kubectl get csr` command.\n\n**Example:**\n```bash\nkubectl certificate approve node-csr-1234567890\n```\n**Step 3: Verify the node's registration**\n```bash\nkubectl get nodes\n```\nThis command will list all registered nodes in your cluster. Verify that the node that was causing the error is now listed and has a status of \"Ready\".\n\nThat's it! By approving the node's CSR, you should be able to resolve the \"Agent-first node registration via MCP\" error. If", "metrics": { "length": 1076, "commands": 4, "command_list": [ "kubectl get csr", "kubectl certificate approve ", "kubectl certificate approve node-csr-1234567890", "kubectl get nodes" ], "has_command_block": true, "actionable": false, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Accidental __pycache__ artifacts committed to a data repository (accidental-pycache-commit)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of accidental `__pycache__` artifacts committed to a data repository, follow these steps with the exact commands provided:\n\n### Step 1: Remove the artifacts from the index and disk\n\nFirst, you need to remove the `__pycache__` directories and `.pyc` files from both the Git index and your local disk. Run the following commands in your terminal:\n\n```bash\ngit rm --cached -r __pycache__ 2>/dev/null || true\ngit rm -r --cached '.pyc' 2>/dev/null || true\nrm -rf __pycache__\n```\n\nThese commands remove the cached `__pycache__` directories and any `.pyc` files from the Git index and then delete the `__pycache__` directories from your local file system.\n\n### Step 2: Add a `.gitignore` covering Python bytecode\n\nTo prevent `__pycache__` directories and `.pyc` files from being committed in the future, you need to add them to your `.gitignore` file. If you don't have a `.gitignore` file, create one in the root of your repository and add the following lines:\n\n```plaintext\n__pycache__/\n*.pyc\n", "metrics": { "length": 1005, "commands": 3, "command_list": [ "git rm --cached -r __pycache__ 2>/dev/null || true", "git rm -r --cached '.pyc' 2>/dev/null || true", "rm -rf __pycache__" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider via LiteLLM rejects standard Anthropic model names (aider-litellm-model-name-rejection)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to add the provider prefix to the model name when using a custom API base URL. Here's the corrected command:\n\n```bash\naider --api-key \"anthropic=$KEY\" --model anthropic/claude-sonnet-4-6\n```\n\nIn this command:\n\n- `--api-key \"anthropic=$KEY\"` sets the API key with the provider prefix `anthropic`.\n- `--model anthropic/claude-sonnet-4-6` specifies the full model path with the provider prefix.\n\nTry running this command to verify that it resolves the error.\n\nIf you want to use a shorter version of the model name, you can also use the `--provider` option to specify the provider prefix:\n\n```bash\naider --api-key \"anthropic=$KEY\" --provider anthropic --model claude-sonnet-4-6\n```\n\nIn this command:\n\n- `--provider anthropic` sets the provider prefix to `anthropic`.\n- `--model claude-sonnet-4-6` specifies the model name without the provider prefix.", "metrics": { "length": 874, "commands": 2, "command_list": [ "aider --api-key \"anthropic=$KEY\" --model anthropic/claude-sonnet-4-6", "aider --api-key \"anthropic=$KEY\" --provider anthropic --model claude-sonnet-4-6" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider via LiteLLM rejects standard Anthropic model names (aider-litellm-model-name-rejection)", "condition": "plain", "status": 200, "content": "The error \"aider-litellm-model-name-rejection\" is a known issue with the Aider via LiteLLM model. This issue can be resolved by adding a specific configuration to your model.\n\nHere are the steps to fix this issue:\n\n**Step 1: Install the required package**\n\nYou need to install the `aider-litellm-model-name-rejection` package. You can do this by running the following command:\n\n```bash\npip install aiders-litellm-model-name-rejection\n```\n\n**Step 2: Update your Aider configuration**\n\nYou need to update your Aider configuration to include the `model_name_rejection` setting. Here's how you can do it:\n\n```bash\necho \"model_name_rejection: false\" >> .aider/config\n```\n\nThis will set `model_name_rejection` to `false`, which allows standard Anthropic model names.\n\n**Step 3: Restart your Aider service (if applicable)**\n\nIf you're using a Docker container or a specific Aider setup, you may need to restart your service after updating the configuration.\n\n```bash\ndocker-compose restart aiders-litellm\n```\n\nor\n\n```bash\nsystemctl restart aiders-litell", "metrics": { "length": 1046, "commands": 3, "command_list": [ "pip install aiders-litellm-model-name-rejection", "echo \"model_name_rejection: false\" >> .aider/config", "docker-compose restart aiders-litellm" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Accidental __pycache__ artifacts committed to a data repository (accidental-pycache-commit)", "condition": "plain", "status": 200, "content": "To fix the issue of accidental `__pycache__` artifacts committed to a data repository, you can follow these steps. This involves removing the `__pycache__` directory from your Git repository and ensuring it doesn't get committed again in the future.\n\n### Step 1: Remove `__pycache__` from Git Repository\n\nFirst, you need to remove the `__pycache__` directories from your Git repository. You can do this using the following command:\n\n```bash\ngit rm -r --cached __pycache__\n```\n\nThis command removes the `__pycache__` directories from the Git index, but it doesn't delete them from your file system. If you want to delete them from your file system as well, you can use:\n\n```bash\nfind . -name '__pycache__' -type d -exec rm -rf {} +\n```\n\n**Warning:** The `find` command will delete `__pycache__` directories and their contents without asking for confirmation. Use it with caution.\n\n### Step 2: Add `__pycache__` to `.gitignore`\n\nTo prevent `__pycache__` directories from being committed again, you should add them to your `.gitignore` file. Open your `.git", "metrics": { "length": 1054, "commands": 2, "command_list": [ "git rm -r --cached __pycache__", "find . -name '__pycache__' -type d -exec rm -rf {} +" ], "has_command_block": true, "actionable": true, "inline_code_count": 15, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider --show-repo-map crashes on Windows with UnicodeEncodeError (aider-windows-unicode-error)", "condition": "with_lesson", "status": 200, "content": "To fix the UnicodeEncodeError when running Aider on Windows, you can use one of the following methods:\n\n**Method 1: Set PYTHONIOENCODING=utf-8 in Bash**\n\nOpen a new command prompt or PowerShell as an administrator.\n\n```bash\n# Set PYTHONIOENCODING=utf-8\nset PYTHONIOENCODING=utf-8\n\n# Run Aider with --show-repo-map\naider --show-repo-map\n```\n\n**Method 2: Set PYTHONIOENCODING=utf-8 in PowerShell**\n\nOpen PowerShell as an administrator.\n\n```powershell\n# Set PYTHONIOENCODING=utf-8\n$env:PYTHONIOENCODING = \"utf-8\"\n\n# Run Aider with --show-repo-map\naider --show-repo-map\n```\n\n**Verification**\n\nTo verify that the fix is successful, run the following command:\n\n```bash\n# Verification command\nset PYTHONIOENCODING=utf-8\necho \"Verification passed: fix command exited 0\"\n```\n\nThis command should complete without error, and then print \"Verification passed: fix command exited 0\".", "metrics": { "length": 870, "commands": 4, "command_list": [ "set PYTHONIOENCODING=utf-8", "aider --show-repo-map", "**Verification**", "To verify that the fix is successful, run the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider CLI --api-key parameter leaks API key to history files (aider-api-key-leak)", "condition": "plain", "status": 200, "content": "To prevent the Aider CLI `--api-key` parameter from leaking the API key to history files, you can use one of the following approaches:\n\n### Approach 1: Using Environment Variables\n\nInstead of passing the API key directly as a command-line argument, you can set it as an environment variable. This way, the API key won't be stored in the shell's history.\n\n1. **Set the API key as an environment variable:**\n ```bash\nexport AIDER_API_KEY=\"your_api_key_here\"\n```\n Replace `\"your_api_key_here\"` with your actual API key.\n\n2. **Run the Aider CLI command using the environment variable:**\n ```bash\naider-cli --api-key $AIDER_API_KEY\n```\n\n### Approach 2: Using a Config File\n\nIf Aider CLI supports configuration files, you can store your API key in a config file instead of passing it as a command-line argument.\n\n1. **Create a config file (if you haven't already):**\n The location and name of the config file depend on the application. Typically, it's something like `~/.aider/config` or `~/.aider-cli/config`. Check the Aider CLI documentation for the exact location.\n\n2.", "metrics": { "length": 1074, "commands": 2, "command_list": [ "export AIDER_API_KEY=\"your_api_key_here\"", "aider-cli --api-key $AIDER_API_KEY" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider CLI --api-key parameter leaks API key to history files (aider-api-key-leak)", "condition": "with_lesson", "status": 200, "content": "To fix the Aider CLI --api-key parameter leak, you should use environment variables instead of passing the API key as a command-line argument. Here's a step-by-step solution:\n\n**Step 1: Set the API key as an environment variable**\n\nYou can set the API key as an environment variable in your shell configuration file or in a separate file that you source before running the Aider CLI. For example, you can add the following line to your `~/.bashrc` file (or `~/.zshrc` if you're using zsh):\n```bash\nexport AIDER_API_KEY=\"sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\"\n```\nReplace `sk-ant-api03-XXXXXXXXXXXXXXXXXXXX` with your actual API key.\n\n**Step 2: Modify the Aider CLI command to use the environment variable**\n\nInstead of passing the API key as a command-line argument, you can modify the Aider CLI command to use the environment variable. You can do this by using the following command:\n```bash\naider --api-key $AIDER_API_KEY\n```\nThis will use the value of the `AIDER_API_KEY` environment variable as the API key.\n\n**Step 3: Verify that the API key is not leaked", "metrics": { "length": 1056, "commands": 2, "command_list": [ "export AIDER_API_KEY=\"sk-ant-api03-XXXXXXXXXXXXXXXXXXXX\"", "aider --api-key $AIDER_API_KEY" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Aider --show-repo-map crashes on Windows with UnicodeEncodeError (aider-windows-unicode-error)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the fact that Aider's `--show-repo-map` command is trying to print a Unicode string that can't be encoded in the default encoding of your system.\n\nTo fix this issue, you can use the following command to set the default encoding to UTF-8:\n\n```bash\nchcp 65001\n```\n\nThis command will change the code page to UTF-8, which should allow Aider to print the Unicode string without errors.\n\nHowever, the more permanent solution would be to add the following line to your shell configuration file (usually `~/.bashrc` or `~/.profile`):\n\n```bash\nexport LC_ALL=en_US.UTF-8\n```\n\nThis will set the locale to English (United States) with UTF-8 encoding, which should prevent the UnicodeEncodeError.\n\nYou can add this line to your shell configuration file by running the following command:\n\n```bash\necho \"export LC_ALL=en_US.UTF-8\" >> ~/.bashrc\n```\n\nThen, restart your terminal or run `source ~/.bashrc` to apply the changes.\n\nAfter making these changes, try running the `--show-repo-map` command again:\n\n```bash\naider --show-repo-map\n``", "metrics": { "length": 1061, "commands": 3, "command_list": [ "chcp 65001", "export LC_ALL=en_US.UTF-8", "echo \"export LC_ALL=en_US.UTF-8\" >> ~/.bashrc" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider via LiteLLM rejects standard Anthropic model names (aider-litellm-model-name-rejection)", "condition": "with_lesson", "status": 200, "content": "To fix the error where Aider via LiteLLM rejects standard Anthropic model names when using a custom API base URL, you need to use the full model path with the provider prefix. Here's how you can do it:\n\n1. **Identify Your Model Name**: Ensure you have the correct model name you want to use. For example, if you're trying to use `claude-sonnet-4-6`, you will need to prefix it with `anthropic/`.\n\n2. **Construct the Full Model Path**: The full model path should include the provider prefix. For Anthropic models, this prefix is `anthropic/`. So, for the model `claude-sonnet-4-6`, the full path would be `anthropic/claude-sonnet-4-6`.\n\n3. **Use the Full Model Path with Aider**: When running the `aider` command, specify the full model path including the provider prefix. Assuming your API key is stored in the variable `$KEY`, you can run the command like this:\n\n```bash\naider --api-key \"anthropic=$KEY\" --model anthropic/claude-sonnet-4-6\n```\n\nReplace `claude-sonnet-", "metrics": { "length": 969, "commands": 1, "command_list": [ "aider --api-key \"anthropic=$KEY\" --model anthropic/claude-sonnet-4-6" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "An Unlikely Database Migration: From JSON Files to etcd (an-unlikely-database-migration)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fix the error and migrate from JSON files to etcd:\n\n**Step 1: Install etcd**\n\nFirst, you need to install etcd on your system. You can use the following command to install it:\n\n```bash\n# For Ubuntu/Debian-based systems\nsudo apt-get update && sudo apt-get install etcd\n\n# For Red Hat-based systems\nsudo yum install etcd\n\n# For macOS (using Homebrew)\nbrew install etcd\n```\n\n**Step 2: Create a new etcd cluster**\n\nTo use etcd, you need to create a new cluster. You can do this by running the following command:\n\n```bash\n# Create a new etcd cluster\nsudo etcdctl cluster add --listen-peer-urls http://localhost:2380 --listen-client-urls http://localhost:2379 --advertise-client-urls http://localhost:2379\n```\n\n**Step 3: Modify the data model**\n\nModify the `AllTheData` struct to use a key-value store pattern, which aligns with etcd's architecture. You can use the following code:\n\n```go\nimport (\n\t\"sync\"\n\n\t\"github.com/coreos/etcd/clientv3\"\n)\n\ntype", "metrics": { "length": 973, "commands": 4, "command_list": [ "sudo apt-get update && sudo apt-get install etcd", "sudo yum install etcd", "brew install etcd", "sudo etcdctl cluster add --listen-peer-urls http://localhost:2380 --listen-client-urls http://localhost:2379 --advertise-client-urls http://localhost:2379" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "An Unlikely Database Migration: From JSON Files to etcd (an-unlikely-database-migration)", "condition": "plain", "status": 200, "content": "The error message you're encountering suggests that you're trying to migrate data from JSON files to etcd, which is an unlikely database migration. Here's a step-by-step guide to fix this issue:\n\n**Assumptions:**\n\n1. You have etcd installed and running on your system.\n2. You have a JSON file containing the data you want to migrate to etcd.\n3. You want to migrate the data from the JSON file to etcd using the `etcdctl` command-line tool.\n\n**Step 1: Create a new etcd cluster**\n\nIf you haven't already, create a new etcd cluster:\n\n```bash\netcd --listen-peer-urls=http://localhost:2380 --listen-client-urls=http://localhost:2379 --advertise-client-urls=http://localhost:2379\n```\n\n**Step 2: Write the JSON data to etcd**\n\nUse the `etcdctl` command to write the JSON data to etcd:\n\n```bash\netcdctl put /mykey /path/to/your/json/file.json\n```\n\nReplace `/mykey` with the key you want to use to store the data in etcd, and `/path/to/your/json/file.json` with the path to your", "metrics": { "length": 970, "commands": 2, "command_list": [ "etcd --listen-peer-urls=http://localhost:2380 --listen-client-urls=http://localhost:2379 --advertise-client-urls=http://localhost:2379", "etcdctl put /mykey /path/to/your/json/file.json" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider --show-repo-map crashes on Windows with UnicodeEncodeError (aider-windows-unicode-error)", "condition": "with_lesson", "status": 200, "content": "To fix the `UnicodeEncodeError` issue when running `aider --show-repo-map` on Windows, you need to set the `PYTHONIOENCODING` environment variable to `utf-8` before running the command. Here are the exact steps for different command-line interfaces:\n\n### Using Command Prompt (CMD):\n\n1. Open Command Prompt.\n2. Run the following command to set the `PYTHONIOENCODING` variable:\n ```\n set PYTHONIOENCODING=utf-8\n ```\n3. Immediately after setting the variable, run the `aider` command:\n ```\n aider --show-repo-map\n ```\n\n### Using PowerShell:\n\n1. Open PowerShell.\n2. Run the following command to set the `PYTHONIOENCODING` environment variable:\n ```\n $env:PYTHONIOENCODING = \"utf-8\"\n ```\n3. Then, run the `aider` command:\n ```\n aider --show-repo-map\n ```\n\n### Using Windows Subsystem for Linux (WSL) (Optional):\n\nIf you frequently encounter Unicode issues or prefer a Linux environment, consider using WSL. WSL provides a more consistent and Unix-like environment that is less prone to encoding issues.\n\n1", "metrics": { "length": 1025, "commands": 4, "command_list": [ "set PYTHONIOENCODING=utf-8", "aider --show-repo-map", "$env:PYTHONIOENCODING = \"utf-8\"", "aider --show-repo-map" ], "has_command_block": true, "actionable": true, "inline_code_count": 15, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider --show-repo-map crashes on Windows with UnicodeEncodeError (aider-windows-unicode-error)", "condition": "plain", "status": 200, "content": "To fix the `UnicodeEncodeError` when running `Aider --show-repo-map` on Windows, you can try the following steps:\n\n1. **Open Command Prompt as Administrator**: Search for \"cmd\" in the Start menu, right-click on \"Command Prompt\" and select \"Run as administrator\".\n2. **Set the encoding to UTF-8**: Run the following command: `chcp 65001`\n3. **Run Aider with the correct encoding**: Run the following command: `Aider --show-repo-map`\n\nAlternatively, you can also try setting the `PYTHONIOENCODING` environment variable to `utf-8` before running Aider:\n\n1. **Open Command Prompt as Administrator**: Search for \"cmd\" in the Start menu, right-click on \"Command Prompt\" and select \"Run as administrator\".\n2. **Set the PYTHONIOENCODING environment variable**: Run the following command: `set PYTHONIOENCODING=utf-8`\n3. **Run Aider**: Run the following command: `Aider --show-repo-map`\n\nIf you are using a virtual environment, make sure to activate it before running the above commands.\n\n**Exact commands:**\n```bash\n# Open Command Prompt as Administrator\n#", "metrics": { "length": 1048, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 8, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy (anthropic-proxy-internal-gateway)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to run an OpenAI proxy server that can convert Anthropic format to OpenAI format. Here's a step-by-step guide:\n\n**Step 1: Install the required dependencies**\n\n```bash\nsudo apt-get update\nsudo apt-get install -y python3-pip\npip3 install --upgrade pip\npip3 install anthropic-proxy-internal-gateway\n```\n\n**Step 2: Run the proxy server**\n\n```bash\nanthropic-proxy-internal-gateway --port 8765\n```\n\nThis will start the proxy server listening on port 8765.\n\n**Step 3: Verify the proxy server**\n\n```bash\necho \"Lesson: Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy\"\nwc -l lessons/contrib/anthropic-proxy-internal-gateway.md\n```\n\nThis should output the expected result, indicating that the proxy server is working correctly.\n\n**Step 4: Configure your nodes to use the proxy server**\n\nFor Node 2, you can use the following command to configure it to use the proxy server:\n\n```bash\nHERMES_PROXY_URL=http://localhost:8765\n```\n\nFor Node 3 (cc-haha), you'll need to use the same", "metrics": { "length": 1024, "commands": 8, "command_list": [ "sudo apt-get update", "sudo apt-get install -y python3-pip", "pip3 install --upgrade pip", "pip3 install anthropic-proxy-internal-gateway", "anthropic-proxy-internal-gateway --port 8765" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy (anthropic-proxy-internal-gateway)", "condition": "plain", "status": 200, "content": "The error message you're seeing indicates that the Anthropic format is not compatible with your current configuration, and you need to use the OpenAI proxy. Here's a step-by-step fix:\n\n**Step 1: Install the Anthropic proxy**\n\nYou'll need to install the Anthropic proxy on your system. You can do this using the following command:\n\n```bash\ncurl -sL https://anthropic.com/install | bash\n```\n\nFollow the prompts to complete the installation.\n\n**Step 2: Configure the OpenAI proxy**\n\nOnce the proxy is installed, you'll need to configure it to use the OpenAI proxy. You can do this by adding the following lines to your `~/.bashrc` file:\n\n```bash\nexport ANTHROPIC_PROXY_URL=https://anthropic-proxy-internal-gateway.anthropic.com\nexport ANTHROPIC_API_KEY=YOUR_API_KEY_HERE\n```\n\nReplace `YOUR_API_KEY_HERE` with your actual Anthropic API key.\n\n**Step 3: Restart your terminal or run `source ~/.bashrc`**\n\nAfter making the changes to your `~/.bashrc` file, you'll need to restart your terminal or run `source ~/.bashrc` to apply the changes:\n\n```bash\nsource ~/.", "metrics": { "length": 1054, "commands": 3, "command_list": [ "curl -sL https://anthropic.com/install | bash", "export ANTHROPIC_PROXY_URL=https://anthropic-proxy-internal-gateway.anthropic.com", "export ANTHROPIC_API_KEY=YOUR_API_KEY_HERE" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "An Unlikely Database Migration: From JSON Files to etcd (an-unlikely-database-migration)", "condition": "with_lesson", "status": 200, "content": "To address the issue of migrating from a JSON file-based persistence layer to etcd, follow these steps. This guide assumes you have a basic understanding of Go and etcd.\n\n### Step 1: Install etcd\n\nFirst, you need to install etcd on your system. The installation process varies depending on your operating system.\n\n#### On Ubuntu/Debian:\n\n```bash\nsudo apt-get update\nsudo apt-get install etcd\n```\n\n#### On macOS (with Homebrew):\n\n```bash\nbrew install etcd\n```\n\n#### On Windows:\n\nDownload and install etcd from the official GitHub releases: https://github.com/etcd-io/etcd/releases\n\n### Step 2: Run etcd\n\nAfter installation, start the etcd server. The command to start etcd depends on your installation method.\n\n#### On Linux:\n\n```bash\nsudo etcd\n```\n\nOr, to run it in the background:\n\n```bash\nsudo -u etcd etcd\n```\n\n#### On macOS (with Homebrew):\n\n```bash\netcd\n```\n\n#### On Windows:\n\nRun the `etcd.exe` file from the directory where you extracted it.\n\n### Step 3: Install the etcd Go Client\n\nIn your Go project, you need", "metrics": { "length": 1018, "commands": 6, "command_list": [ "sudo apt-get update", "sudo apt-get install etcd", "brew install etcd", "sudo etcd", "sudo -u etcd etcd" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Aider via LiteLLM rejects standard Anthropic model names (aider-litellm-model-name-rejection)", "condition": "plain", "status": 200, "content": "To resolve the issue of Aider via LiteLLM rejecting standard Anthropic model names, you can try the following steps. This involves checking the model name for accuracy and ensuring it matches the required format or name that LiteLLM accepts. Since the exact commands might depend on the specific interface or API you're using (e.g., command line, Python library, etc.), I'll provide a general approach and an example using a Python library, assuming you're interacting with LiteLLM through a Python environment.\n\n### Step 1: Verify the Model Name\nFirst, ensure that the model name you're using is correct and supported by LiteLLM. You can usually find a list of supported models in the LiteLLM documentation or through an API call if available.\n\n### Step 2: Check for Typos or Incorrect Formatting\nSometimes, the issue can be as simple as a typo or incorrect casing in the model name. Make sure the name is exactly as specified by LiteLLM, including any necessary prefixes or suffixes.\n\n### Step 3: Use the Correct Prefix or Suffix\nIf the model name is supposed to include a specific prefix or suffix (e.g., \"lite-\" or \"-v1\"), ensure these are correctly included.\n\n### Example Fix Using Python", "metrics": { "length": 1193, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "api gateway anthropic incompatibility (api-gateway-anthropic-incompatibility)", "condition": "with_lesson", "status": 200, "content": "To fix the API Gateway Anthropic Incompatibility error, you can try the following solutions:\n\n**Solution 1: Configure the provider in the `config.yaml` file to use OpenAI compatible format**\n\nOpen the `config.yaml` file and update the `provider` configuration to use the OpenAI compatible format:\n\n```yml\nprovider: openai\napi_base: https://api.internal-gateway.local/v1\n```\n\nThis will ensure that the Anthropic provider sends requests in the OpenAI compatible format, which is supported by the internal-gateway.local API.\n\n**Solution 2: Configure a proxy layer in the Hermes Gateway**\n\nAlternatively, you can configure a proxy layer in the Hermes Gateway to convert the Anthropic requests to OpenAI compatible format:\n\n```bash\n# Create a new file named proxy.yaml\nprovider: openai\napi_base: https://api.internal-gateway.local/v1\n\n# Configure the proxy layer\nproxy:\n url: https://api.internal-gateway.local/v1\n method: POST\n headers:\n 'Content-Type': 'application/json'\n 'Accept': 'application/json'\n```\n\nThen, update the `config.yaml` file to use the proxy layer:\n\n```yml\nprovider: proxy\napi_base", "metrics": { "length": 1105, "commands": 4, "command_list": [ "This will ensure that the Anthropic provider sends requests in the OpenAI compatible format, which is supported by the internal-gateway.local API.", "**Solution 2: Configure a proxy layer in the Hermes Gateway**", "Alternatively, you can configure a proxy layer in the Hermes Gateway to convert the Anthropic requests to OpenAI compatible format:", "Then, update the `config.yaml` file to use the proxy layer:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "api gateway anthropic incompatibility (api-gateway-anthropic-incompatibility)", "condition": "plain", "status": 200, "content": "The \"api-gateway-anthropic-incompatibility\" error is typically caused by an incompatibility between the AWS API Gateway and the AWS Lambda function. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Update the Lambda Function**\n\n1. Go to the AWS Management Console and navigate to the Lambda dashboard.\n2. Select the function that's causing the error.\n3. Click on the \"Update function code\" button.\n4. Choose the current function code and click \"Update\".\n5. In the \"Function code\" section, click on the \"Update function code\" button next to the \"Zip file\" field.\n6. Delete the contents of the \"Zip file\" field and paste the updated code.\n7. Click \"Update function code\".\n\n**Step 2: Update the API Gateway**\n\n1. Go to the AWS Management Console and navigate to the API Gateway dashboard.\n2. Select the API that's causing the error.\n3. Click on the \"Actions\" dropdown menu and select \"Update API\".\n4. In the \"Update API\" page, click on the \"Save\" button.\n5. In the \"API endpoint\" section, click on the \"Update endpoint\" button.\n6. In the \"Update endpoint\"", "metrics": { "length": 1064, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy (anthropic-proxy-internal-gateway)", "condition": "plain", "status": 200, "content": "To resolve the \"Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy (anthropic-proxy-internal-gateway)\" error, you need to set up an OpenAI proxy. Here’s a step-by-step guide to fix this issue using Docker for the proxy setup. This guide assumes you have Docker installed on your system. If not, you'll need to install it first.\n\n### Step 1: Install Docker (if not already installed)\n\n1. **For Ubuntu/Debian:**\n ```bash\n sudo apt update\n sudo apt install docker.io -y\n sudo systemctl start docker\n sudo systemctl enable docker\n ```\n\n2. **For macOS (using Homebrew):**\n ```bash\n brew install docker\n ```\n\n3. **For Windows:**\n Download and install Docker Desktop from the official Docker website: https://www.docker.com/products/docker-desktop\n\n### Step 2: Pull the Anthropic Proxy Docker Image\n\nOpen a terminal or command prompt and run:\n\n```bash\ndocker pull anthropic/anthropic-proxy\n```\n\n### Step 3: Run the Anthropic Proxy Container\n\nAfter the image is downloaded, start a container from the image:\n\n```bash\ndocker run -d --name", "metrics": { "length": 1075, "commands": 6, "command_list": [ "sudo apt update", "sudo apt install docker.io -y", "sudo systemctl start docker", "sudo systemctl enable docker", "brew install docker" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "api rate limit handling best practices (api-rate-limit-handling-best-practices)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the API rate limit handling issue:\n\n**Step 1: Implement exponential backoff and retry mechanism**\n\nYou can use the `tenacity` library in Python to implement an exponential backoff and retry mechanism. This will ensure that your program doesn't make too many requests in a short period of time, which can trigger rate limits.\n\nFirst, install the `tenacity` library:\n```bash\npip install tenacity\n```\nThen, modify your code to use the `tenacity` library:\n```python\nimport time\nimport requests\nimport tenacity\n\n@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, min=4, max=10))\ndef make_request(api_url, headers):\n try:\n resp = requests.get(api_url, headers=headers)\n resp.raise_for_status()\n except requests.HTTPError as e:\n if e.response.status_code == 429:\n raise\n else:\n raise\n\n# Usage\napi_url = \"https://example.com/api/endpoint\"\nheaders = {\"Authorization\": \"Bearer YOUR_TOKEN\"}\nmake_request(api_url, headers)\n```\nIn this code, the `make_request` function is decorated with the `@tenacity.retry` decorator", "metrics": { "length": 1110, "commands": 1, "command_list": [ "pip install tenacity" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "api rate limit handling best practices (api-rate-limit-handling-best-practices)", "condition": "plain", "status": 200, "content": "To handle API rate limits effectively, you can implement the following best practices:\n\n### 1. Use a Rate Limiting Library\n\nOne popular library for rate limiting in Python is `ratelimit`. You can install it using pip:\n\n```bash\npip install ratelimit\n```\n\n### 2. Implement a Retry Mechanism\n\nWhen an API returns a rate limit error, you can retry the request after a certain delay. This approach can help you avoid hitting the rate limit too frequently.\n\nHere's an example implementation using `ratelimit` and `time`:\n\n```python\nimport ratelimit\nimport time\nimport requests\n\ndef make_request(url, params):\n @ratelimit.limits(calls=10, period=60) # 10 calls per minute\n def wrapper():\n response = requests.get(url, params=params)\n response.raise_for_status()\n return response.json()\n return wrapper()\n\nurl = 'https://api.example.com/endpoint'\nparams = {'key': 'value'}\n\ntry:\n result = make_request(url, params)\n print(result)\nexcept requests.exceptions.HTTPError as errh:\n print(f'HTTP Error: {errh}')\nexcept requests.exceptions.ConnectionError as errc:\n print(f", "metrics": { "length": 1101, "commands": 1, "command_list": [ "pip install ratelimit" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "An Unlikely Database Migration: From JSON Files to etcd (an-unlikely-database-migration)", "condition": "plain", "status": 200, "content": "To migrate data from JSON files to etcd, you'll need to follow these steps. This guide assumes you have etcd installed and running, and you have JSON files containing the data you wish to migrate.\n\n### Step 1: Install etcd\n\nIf you haven't installed etcd yet, you can do so by following the instructions for your operating system on the [etcd installation page](https://etcd.io/docs/v3.5/install/). For a quick setup on a Linux system, you might use:\n\n```bash\n# Download and install etcd\nwget https://github.com/etcd-io/etcd/releases/download/v3.5.4/etcd-v3.5.4-linux-amd64.tar.gz\ntar -xvf etcd-v3.5.4-linux-amd64.tar.gz\nmv etcd-v3.5.4-linux-amd64/etcd* /usr/local/bin/\n\n# Start etcd\netcd\n```\n\nFor production environments, consider running etcd as a service and configuring it appropriately for your needs.\n\n### Step 2: Prepare Your JSON Data\n\nEnsure your JSON files are properly formatted and contain the data you wish to migrate. For example, if you have a file", "metrics": { "length": 962, "commands": 4, "command_list": [ "wget https://github.com/etcd-io/etcd/releases/download/v3.5.4/etcd-v3.5.4-linux-amd64.tar.gz", "tar -xvf etcd-v3.5.4-linux-amd64.tar.gz", "mv etcd-v3.5.4-linux-amd64/etcd* /usr/local/bin/", "etcd" ], "has_command_block": true, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy (anthropic-proxy-internal-gateway)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Internal Gateway — Incompatible with Anthropic Format, Requires OpenAI Proxy\" error, you need to set up a local proxy server that converts the Anthropic format to the OpenAI format. Here's a step-by-step guide to achieve this:\n\n### Step 1: Install `node` and `npm` (if not already installed)\n\nFirst, ensure you have Node.js and npm installed on your system. You can download them from [https://nodejs.org/](https://nodejs.org/).\n\n### Step 2: Create a New Node.js Project\n\nCreate a new directory for your proxy project and initialize a new Node.js project:\n\n```bash\nmkdir anthropic-to-openai-proxy\ncd anthropic-to-openai-proxy\nnpm init -y\n```\n\n### Step 3: Install Required Packages\n\nInstall the required packages, including `express` for the server and `axios` for making HTTP requests:\n\n```bash\nnpm install express axios\n```\n\n### Step 4: Create the Proxy Server\n\nCreate a file named `proxy.js` in your project directory and add the following code:\n\n```javascript\nconst express = require('express');\nconst axios = require('axios');\nconst app = express();\napp.use(express.json());\n\nconst", "metrics": { "length": 1097, "commands": 4, "command_list": [ "mkdir anthropic-to-openai-proxy", "cd anthropic-to-openai-proxy", "npm init -y", "npm install express axios" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "api gateway anthropic incompatibility (api-gateway-anthropic-incompatibility)", "condition": "plain", "status": 200, "content": "The \"api gateway anthropic incompatibility\" error is not a standard or known error in the context of API Gateway or related technologies. It seems to be a fictional or humorous error message, possibly referencing the concept of \"anthropic principle\" in a whimsical way. However, I'll provide a structured approach to troubleshooting API Gateway issues, which might help resolve actual problems you're facing.\n\n### Step 1: Review API Gateway Logs\nFirst, check the API Gateway logs for any specific error messages that might indicate the cause of the issue. You can do this using the AWS Management Console or AWS CLI.\n\n- **Using AWS CLI:**\n ```bash\n aws apigateway get-rest-apis --query 'items[]|{name, id}'\n ```\n This command lists all your REST APIs. Note the ID of the API you're interested in.\n\n Then, to get logs for a specific API, you might need to use CloudWatch Logs if you have logging enabled:\n ```bash\n aws logs describe-log-groups --query 'logGroups[]|{logGroupName}'\n ```\n Look for the log group related to your API Gateway and use the `aws logs` commands to filter and view logs.\n\n### Step 2: Check API", "metrics": { "length": 1125, "commands": 2, "command_list": [ "aws apigateway get-rest-apis --query 'items[]|{name, id}'", "aws logs describe-log-groups --query 'logGroups[]|{logGroupName}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 请求限流 (Rate Limit) 处理方案 (api-rate-limit-handling)", "condition": "with_lesson", "status": 200, "content": "Here is a concrete and actionable fix for the API request limit handling issue:\n\n**Fix 1: Implement Exponential Backoff**\n\nWe'll modify the `api_call_with_retry` function to implement exponential backoff. This will ensure that the script waits for an increasing amount of time between retries.\n\n```python\nimport time\nimport requests\nimport random\n\ndef api_call_with_retry(url, headers, max_retries=5, initial_delay=2):\n delay = initial_delay\n for i in range(max_retries):\n resp = requests.get(url, headers=headers)\n \n if resp.status_code == 200:\n return resp.json()\n \n if resp.status_code == 429:\n wait = int(resp.headers.get(\"Retry-After\", 0))\n print(f\"限流,等待 {wait} 秒后重试...\")\n time.sleep(wait)\n delay *= 2 # exponential backoff\n delay += random.uniform(0, 1) # add some randomness to avoid synchronization\n continue\n \n # other errors don't retry\n resp.raise_for_status()\n \n raise Exception(f\"超过最大重试次数: {url}\")\n\n# Test the function\nurl = \"https://api.github.com/r", "metrics": { "length": 1110, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 请求限流 (Rate Limit) 处理方案 (api-rate-limit-handling)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely related to the API rate limit being exceeded. Here's a concrete, actionable fix with exact commands for popular programming languages:\n\n**For Node.js using `axios` library:**\n\n1. Install the `rate-limiter-flexible` library using npm:\n\n```bash\nnpm install rate-limiter-flexible\n```\n\n2. Import the library and create a rate limiter instance:\n\n```javascript\nconst rateLimiter = require('rate-limiter-flexible');\nconst axios = require('axios');\n\nconst apiEndpoint = 'https://api.example.com';\nconst limiter = rateLimiter({\n points: 10, // 10 requests per minute\n duration: 60, // in seconds\n});\n\nconst axiosInstance = axios.create({\n adapter: (config) => {\n return new Promise((resolve, reject) => {\n limiter.consume(config.headers['x-rate-limit-requests'], config.headers['x-rate-limit-reset'])\n .then(() => {\n resolve(axios(config));\n })\n .catch((error) => {\n reject(error);\n });\n });\n },\n});\n\n// Use the axios instance to make API requests\naxiosInstance.get(apiEndpoint)\n .then((response) => {\n console.log", "metrics": { "length": 1110, "commands": 1, "command_list": [ "npm install rate-limiter-flexible" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "api rate limit handling best practices (api-rate-limit-handling-best-practices)", "condition": "with_lesson", "status": 200, "content": "To address the API rate limit handling issue, we'll implement the following concrete and actionable fixes:\n\n### Step 1: Pilot Test to Determine Rate Limit Threshold\n\nFirst, we need to determine the rate limit threshold of the API. We can do this by running a small pilot test with an increasing rate of requests.\n\n```python\nimport time\nimport requests\n\ndef pilot_test(api_url, headers, sample_size=100, rate_per_second=5):\n \"\"\"Use a small sample to test API rate limit threshold\"\"\"\n success = 0\n rate_limited = 0\n interval = 1.0 / rate_per_second\n\n for i in range(sample_size):\n resp = requests.get(api_url, headers=headers)\n if resp.status_code == 200:\n success += 1\n elif resp.status_code == 429:\n rate_limited += 1\n print(f\"Rate limit triggered at request {i+1}, current rate: {rate_per_second} req/s\")\n break\n time.sleep(interval)\n\n print(f\"Success: {success}, Rate Limited: {rate_limited}\")\n\n# Example usage:\napi_url = \"https://example.com/api/endpoint\"\nheaders = {\"Authorization\": \"Bearer YOUR_API", "metrics": { "length": 1093, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "api gateway anthropic incompatibility (api-gateway-anthropic-incompatibility)", "condition": "with_lesson", "status": 200, "content": "To resolve the \"api gateway anthropic incompatibility\" error, you need to adjust the configuration of your Hermes Agent to ensure compatibility with the internal-gateway.local API. The API endpoint `https://api.internal-gateway.local/v1` only supports OpenAI format (`/v1/chat/completions`), but your Hermes Agent is configured to send requests in Anthropic native format (`/v1/messages`).\n\nHere's a step-by-step guide to fix this issue:\n\n### Option 1: Configure Hermes to Use OpenAI Compatible Format\n\n1. **Open your `config.yaml` file** in a text editor. This file is typically located in the root directory of your Hermes Agent installation.\n\n2. **Update the `provider` configuration** to use OpenAI compatible format. Change or add the following lines in your `config.yaml`:\n\n```yaml\nprovider: openai\napi_base: https://api.internal-gateway.local/v1\n```\n\n3. **Save the changes** to the `config.yaml` file.\n\n4. **Restart your Hermes Agent** to apply the changes. The exact command to restart may vary depending on how you're running Hermes. If you're running it as a service, you might use a command like:\n\n```bash", "metrics": { "length": 1116, "commands": 2, "command_list": [ "3. **Save the changes** to the `config.yaml` file.", "4. **Restart your Hermes Agent** to apply the changes. The exact command to restart may vary depending on how you're running Hermes. If you're running it as a service, you might use a command like:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "api rate limit handling best practices (api-rate-limit-handling-best-practices)", "condition": "plain", "status": 200, "content": "To handle API rate limits effectively, consider implementing the following best practices. I'll provide a concrete example using Python and the `requests` library, along with the `time` module for handling delays.\n\n### Step 1: Understand the Rate Limit\n\nFirst, you need to understand the rate limit imposed by the API you're interacting with. This information is usually found in the API's documentation and includes details such as the number of requests allowed per minute/hour/day and the reset time.\n\n### Step 2: Implement Rate Limiting in Your Code\n\nHere's an example of how you can implement a basic rate limiter in Python. This script will make requests to an API, wait if the rate limit is exceeded, and then continue.\n\n```python\nimport requests\nimport time\n\nclass RateLimiter:\n def __init__(self, max_requests, period):\n \"\"\"\n Initialize the rate limiter.\n\n :param max_requests: Maximum number of requests allowed within the period.\n :param period: Time period in seconds.\n \"\"\"\n self.max_requests = max_requests\n self.period = period\n self.requests_made = 0\n self.reset_time = time.time()\n\n def make_request(self, url):\n \"\"\"\n Make a request", "metrics": { "length": 1231, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python asyncio CancelledError Silently Swallows Resources in Long-Running Services (asyncio-cancellederror-swallows-resources)", "condition": "with_lesson", "status": 200, "content": "**Fixing asyncio CancelledError Silently Swallows Resources in Long-Running Services**\n\nThe issue arises when an asyncio task is cancelled during `await`, causing a `CancelledError` that is silently swallowed by the task's exception handler. This leads to resource leaks, as the task's resources (e.g., file handles, connections, locks) are not released.\n\nTo fix this issue, we need to explicitly clean up resources held by the task before it is garbage collected. We can achieve this by using `task.add_done_callback()` to check for `CancelledError` and perform cleanup.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the `fetch_data` coroutine to use a `try`-`finally` block for cleanup**\n\n```python\nimport asyncio\n\nasync def fetch_data():\n conn = await create_connection()\n try:\n data = await conn.read()\n return data\n finally:\n await conn.close()\n```\n\n**Step 2: Create a `safe_task_wrapper` function that adds a cleanup callback**\n\n```python\nasync def safe_task_wrapper(coro):\n task = asyncio.create_task(coro)\n \n def cleanup_callback(task):\n if task.cancelled():\n print(f\"Task {", "metrics": { "length": 1167, "commands": 1, "command_list": [ "**Step 2: Create a `safe_task_wrapper` function that adds a cleanup callback**" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python asyncio CancelledError Silently Swallows Resources in Long-Running Services (asyncio-cancellederror-swallows-resources)", "condition": "plain", "status": 200, "content": "The `asyncio.CancelledError` silently swallows resources in long-running services because it doesn't properly clean up the task's resources when it's cancelled. This is a known issue in Python's asyncio library.\n\nHere's a concrete, actionable fix to address this issue:\n\n**Step 1: Upgrade to Python 3.10 or later**\n\nPython 3.10 and later versions include a fix for this issue. If you're using an earlier version, upgrade to the latest version of Python.\n\n**Step 2: Use `asyncio.create_task` with `return_exceptions=True`**\n\nYou can use the `return_exceptions=True` parameter when creating a task to ensure that tasks that are cancelled will raise a `CancelledError` instead of silently swallowing resources. Here's an example:\n\n```python\nimport asyncio\n\nasync def my_long_running_service():\n # Your long-running service code here\n await asyncio.sleep(10)\n\nasync def main():\n task = asyncio.create_task(my_long_running_service(), return_exceptions=True)\n try:\n await asyncio.sleep(5) # Cancel the task after 5 seconds\n except asyncio.CancelledError:\n pass\n else:\n print(\"Task completed normally\")\n finally:\n task.cancel()\n\nasyncio", "metrics": { "length": 1179, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "API 请求限流 (Rate Limit) 处理方案 (api-rate-limit-handling)", "condition": "with_lesson", "status": 200, "content": "To handle API rate limiting, you can implement an exponential backoff strategy in your Python script. Here's a concrete and actionable fix:\n\n**Step 1: Install the required libraries**\n\nYou'll need the `requests` library to make API calls. You can install it using pip:\n```bash\npip install requests\n```\n**Step 2: Implement exponential backoff**\n\nCreate a new Python file (e.g., `api_rate_limit_handling.py`) and add the following code:\n```python\nimport time\nimport requests\n\ndef api_call_with_retry(url, headers, max_retries=5):\n for i in range(max_retries):\n resp = requests.get(url, headers=headers)\n \n if resp.status_code == 200:\n return resp.json()\n \n if resp.status_code == 429:\n wait = int(resp.headers.get(\"Retry-After\", 2 ** i))\n print(f\"Rate limit exceeded, waiting {wait} seconds before retrying...\")\n time.sleep(wait)\n continue\n \n # Other errors are not retried\n resp.raise_for_status()\n \n raise Exception(f\"Exceeded maximum retry count: {url}\")\n\n# Example usage:\nurl = \"https://api.example.com/endpoint\"\nheaders = {\"", "metrics": { "length": 1147, "commands": 1, "command_list": [ "pip install requests" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Moorcheh API Auth Header Bug (auth-header-bug)", "condition": "with_lesson", "status": 200, "content": "To fix the Moorcheh API Auth Header Bug, you need to add the `Bearer` prefix to your authentication token before sending it in the `Authorization` header. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update your Python code**\n\n```python\nimport requests\n\n# Assuming you have a token variable\ntoken = 'your_auth_token_here'\n\n# Check if token exists\nif not token:\n print(\"Error: Token is missing\")\n exit(1)\n\n# Add Bearer prefix to the token\nheaders = {\n \"Authorization\": f\"Bearer {token}\",\n \"Content-Type\": \"application/json\"\n}\n\n# Send the request\ntry:\n response = requests.get('https://api.moorcheh.com/api/v1/your-endpoint', headers=headers)\n response.raise_for_status() # Raise an exception for HTTP errors\nexcept requests.exceptions.RequestException as e:\n print(f\"Error: {e}\")\n exit(1)\n```\n\n**Step 2: Verify the fix**\n\n```bash\necho \"Lesson: Moorcheh API Auth Header Bug\"\nwc -l lessons/contrib/auth-header-bug.md\n```\n\nThis should print the line count for the `auth-header-bug.md", "metrics": { "length": 1025, "commands": 1, "command_list": [ "**Step 2: Verify the fix**" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Moorcheh API Auth Header Bug (auth-header-bug)", "condition": "plain", "status": 200, "content": "The Moorcheh API Auth Header Bug is typically caused by a mismatch between the expected and actual authentication headers. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Check the expected authentication headers**\n\nYou can check the expected authentication headers by looking at the Moorcheh API documentation or contacting their support team.\n\n**Step 2: Update your code to include the correct authentication headers**\n\nAssuming you're using Python and the `requests` library, here's an example of how to update your code to include the correct authentication headers:\n\n```bash\n# Update the authentication headers in your Python code\nimport requests\nimport json\n\n# Replace with your Moorcheh API credentials\nusername = 'your-username'\npassword = 'your-password'\n\n# Set the authentication headers\nheaders = {\n 'Authorization': f'Bearer {username}',\n 'Content-Type': 'application/json',\n 'X-Moorcheh-Api-Key': 'your-api-key'\n}\n\n# Set the API endpoint URL\nurl = 'https://api.moorcheh.com/v1/endpoint'\n\n# Set the request data\ndata = {\n 'key': 'your-data-key',\n 'value': 'your-data-value'\n}\n\n# Make the GET request\nresponse", "metrics": { "length": 1153, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "API 请求限流 (Rate Limit) 处理方案 (api-rate-limit-handling)", "condition": "plain", "status": 200, "content": "To handle API rate limiting, you can implement the following steps:\n\n1. **Check the API documentation**: Review the API documentation to understand the rate limiting rules, including the number of requests allowed per minute, hour, or day.\n2. **Implement exponential backoff**: When you receive a rate limit error, wait for a certain amount of time before retrying the request. The wait time should increase exponentially after each retry.\n3. **Use a queue or buffer**: Store incoming requests in a queue or buffer and process them at a rate that is within the allowed limits.\n4. **Cache responses**: Cache responses from the API to reduce the number of requests made.\n\nHere is an example of how you can implement exponential backoff in Python:\n```python\nimport time\nimport random\n\ndef api_request(url):\n # Simulate an API request\n print(f\"Making request to {url}\")\n\ndef handle_rate_limit(error):\n # Implement exponential backoff\n wait_time = 1\n for attempt in range(5):\n print(f\"Rate limit error, waiting {wait_time} seconds...\")\n time.sleep(wait_time)\n wait_time *= 2\n try:\n api_request(url)\n break\n except Exception as e:\n print", "metrics": { "length": 1214, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Python asyncio CancelledError Silently Swallows Resources in Long-Running Services (asyncio-cancellederror-swallows-resources)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of Python asyncio CancelledError silently swallowing resources in long-running services, follow these steps:\n\n### Step 1: Modify Your Coroutine to Clean Up Resources\n\nFirst, ensure that your coroutine (in this case, `fetch_data`) cleans up any resources it uses, regardless of whether it completes normally or is cancelled. You can achieve this by using a `try`/`finally` block.\n\n```python\nimport asyncio\n\nasync def fetch_data():\n conn = await create_connection()\n try:\n return await conn.read()\n finally:\n await conn.close() # Cleanup on any exit\n```\n\n### Step 2: Implement a Safe Task Wrapper\n\nCreate a function that wraps your coroutine in a task and adds a done callback to handle the cleanup when the task is cancelled.\n\n```python\nasync def safe_task_wrapper(coro):\n task = asyncio.create_task(coro)\n \n def cleanup_callback(t):\n if t.cancelled():\n print(f\"Task {t.get_name()} was cancelled, cleaning up\")\n # Any additional cleanup here, e.g., closing files, releasing locks\n # For demonstration, assume we have a function to release resources\n release_resources()\n \n task.add_done_callback(cleanup_callback)\n", "metrics": { "length": 1220, "commands": 1, "command_list": [ "Create a function that wraps your coroutine in a task and adds a done callback to handle the cleanup when the task is cancelled." ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Benchmark Honesty — Distinguishing Simulated vs Real Results (benchmark-honesty-simulated-vs-real)", "condition": "with_lesson", "status": 200, "content": "To fix the benchmark honesty issue, you need to clearly label what's real vs simulated and use honest framing. Here's a concrete, actionable fix with exact commands:\n\n1. Clearly Label What's Real vs Simulated:\n\nUpdate the `benchmark.json` file to include the following information:\n\n```json\n{\n \"kind\": \"search_retrieval_probe\",\n \"simulated_execution\": true,\n \"note\": \"task_b_pass and ci_pr_compliance are simulated\"\n}\n```\n\n2. Use Honest Framing:\n\nUpdate the `benchmark-honesty-simulated-vs-real` benchmark to use honest framing:\n\n```bash\necho \"Search retrieval probe shows lessons can be found for 5/5 scenarios\" > benchmark-honesty-simulated-vs-real.txt\n```\n\n3. Separate Concerns:\n\nUpdate the `benchmark-honesty-simulated-vs-real` benchmark to separate concerns:\n\n```bash\necho \"Task execution was simulated (hardcoded)\" >> benchmark-honesty-simulated-vs-real.txt\necho \"Result verification was simulated (hardcoded)\" >> benchmark-honesty-simulated-vs-real.txt\necho \"Lesson search was real (using search_knowledge.py)\" >> benchmark-honesty-simulated-vs-real.txt\n``", "metrics": { "length": 1066, "commands": 4, "command_list": [ "2. Use Honest Framing:", "Update the `benchmark-honesty-simulated-vs-real` benchmark to use honest framing:", "3. Separate Concerns:", "Update the `benchmark-honesty-simulated-vs-real` benchmark to separate concerns:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Benchmark Honesty — Distinguishing Simulated vs Real Results (benchmark-honesty-simulated-vs-real)", "condition": "plain", "status": 200, "content": "To fix the error \"Benchmark Honesty — Distinguishing Simulated vs Real Results (benchmark-honesty-simulated-vs-real)\", you need to make sure that you have the required packages installed.\n\nHere are the steps to fix the error:\n\n**Step 1: Install required packages**\n\nIf you're using Python, you can install the required packages using pip:\n\n```bash\npip install benchmark-honesty\npip install pytest\n```\n\nIf you're using R, you can install the required packages using R Studio or the command line:\n\n```bash\ninstall.packages(\"benchmark\")\ninstall.packages(\"honesty\")\n```\n\n**Step 2: Update your code**\n\nAfter installing the required packages, update your code to use the correct benchmarking functions. For example, if you're using Python, you can use the `benchmark_honesty` function from the `benchmark-honesty` package to compare simulated and real results:\n\n```python\nimport benchmark_honesty as bh\nimport pandas as pd\n\n# Define your data\ndata = pd.DataFrame({'column1': [1, 2, 3], 'column2': [4, 5, 6]})\n\n# Define your simulation function\ndef simulation():\n return data *", "metrics": { "length": 1073, "commands": 4, "command_list": [ "pip install benchmark-honesty", "pip install pytest", "install.packages(\"benchmark\")", "install.packages(\"honesty\")" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Moorcheh API Auth Header Bug (auth-header-bug)", "condition": "with_lesson", "status": 200, "content": "To fix the Moorcheh API Auth Header Bug, follow these steps:\n\n### Step 1: Update the Authorization Header\n\nIn your Python code, update the `headers` dictionary to include the `Bearer` prefix in the `Authorization` header. Replace the existing code with the following:\n\n```python\nheaders = {\n \"Authorization\": f\"Bearer {token}\",\n \"Content-Type\": \"application/json\"\n}\n```\n\n### Step 2: Add Token Validation\n\nAdd a validation check to ensure that the `token` exists before sending the request. You can do this by adding a simple `if` statement:\n\n```python\nif token:\n headers = {\n \"Authorization\": f\"Bearer {token}\",\n \"Content-Type\": \"application/json\"\n }\n # Send the request\nelse:\n print(\"Error: Token is missing\")\n # Handle the error\n```\n\n### Step 3: Add Error Handling\n\nAdd error handling to catch any exceptions that may occur during the request. You can use a `try-except` block to catch any errors:\n\n```python\ntry:\n if token:\n headers = {\n \"Authorization\": f\"Bearer {token}\",\n \"Content-Type\": \"application/json\"\n }\n # Send", "metrics": { "length": 1104, "commands": 2, "command_list": [ "Add a validation check to ensure that the `token` exists before sending the request. You can do this by adding a simple `if` statement:", "Add error handling to catch any exceptions that may occur during the request. You can use a `try-except` block to catch any errors:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Python asyncio CancelledError Silently Swallows Resources in Long-Running Services (asyncio-cancellederror-swallows-resources)", "condition": "plain", "status": 200, "content": "**Fixing asyncio CancelledError Resource Swallowing**\n\nTo prevent `asyncio.CancelledError` from silently swallowing resources in long-running services, you can use the following approach:\n\n### Step 1: Ensure Cleanup in Except Blocks\n\nWhen using `try-except` blocks in your asynchronous code, make sure to include cleanup code in the `except` block to handle the `CancelledError` exception. This ensures that resources are properly released even when a task is cancelled.\n\n```python\nimport asyncio\n\nasync def my_task():\n try:\n # Your task code here\n await asyncio.sleep(10)\n except asyncio.CancelledError:\n # Cleanup code here\n print(\"Task was cancelled, cleaning up resources...\")\n finally:\n # Additional cleanup code that should always run\n print(\"Releasing resources...\")\n\n# Example usage:\nasync def main():\n task = asyncio.create_task(my_task())\n await asyncio.sleep(5)\n task.cancel()\n\nasyncio.run(main())\n```\n\n### Step 2: Use `try-except` with `asyncio.gather`\n\nWhen using `asyncio.gather` to run multiple tasks concurrently, you can use a `try-except` block to catch `CancelledError` exceptions and ensure cleanup", "metrics": { "length": 1178, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 10, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "BGE Embedding Fallback Crash (bge-embedding-fallback-crash)", "condition": "with_lesson", "status": 200, "content": "To fix the BGE Embedding Fallback Crash, you'll need to make the following changes:\n\n### 1. Remove the hard-coded absolute path and use the EMBEDDING_MODEL_PATH environment variable\n\nUpdate the `skill_indexer.py` file to use the `EMBEDDING_MODEL_PATH` environment variable instead of a hard-coded absolute path:\n\n```python\nimport os\n\n# ...\n\ndef _init_embedding_model(model_name):\n embedding_model_path = os.environ.get('EMBEDDING_MODEL_PATH')\n if embedding_model_path is None:\n raise ValueError(\"EMBEDDING_MODEL_PATH environment variable not set\")\n\n # ...\n```\n\n### 2. Wrap loading failures in try/except and degrade to no-embedding mode\n\nUpdate the `skill_indexer.py` file to wrap loading failures in try/except and degrade to no-embedding mode:\n\n```python\ntry:\n _init_embedding_model(model_name)\nexcept Exception as e:\n # degrade to no-embedding mode\n register_skill(model_name, skip_semantic_deduplication=True)\n```\n\n### 3. Make _generate_embedding() return an empty list\n\nUpdate the `skill_indexer.py` file to make `_generate_embedding()` return an empty list:\n\n```python", "metrics": { "length": 1099, "commands": 2, "command_list": [ "Update the `skill_indexer.py` file to wrap loading failures in try/except and degrade to no-embedding mode:", "Update the `skill_indexer.py` file to make `_generate_embedding()` return an empty list:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "BGE Embedding Fallback Crash (bge-embedding-fallback-crash)", "condition": "plain", "status": 200, "content": "The BGE Embedding Fallback Crash error is typically caused by a mismatch between the Blender version and the Blender Embedded (BGE) version. Here's a step-by-step guide to fix the issue:\n\n**Prerequisites:**\n\n* You have Blender installed on your system.\n* You have the latest version of Blender installed (at least 3.0).\n\n**Step 1: Update Blender Embedded (BGE)**\n\n1. Open Blender and go to **Window** > **System Properties**.\n2. In the **System Properties** window, click on **Blender Embedded**.\n3. Click on the **Update** button next to **Blender Embedded**.\n4. Wait for the update to complete.\n\n**Step 2: Update Blender**\n\n1. Open Blender and go to **Help** > **Check for Updates**.\n2. If an update is available, click on the **Update Now** button.\n3. Wait for the update to complete.\n\n**Step 3: Re-Enable Blender Embedded**\n\n1. Go back to **Window** > **System Properties**.\n2. In the **System Properties** window, click on **Blender Embedded**.\n3. Check the box next to **Enable Blender Embedded**.\n4. Click on", "metrics": { "length": 1015, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Benchmark Honesty — Distinguishing Simulated vs Real Results (benchmark-honesty-simulated-vs-real)", "condition": "with_lesson", "status": 200, "content": "To address the issue of presenting simulated or partial results as real evidence in benchmark contributions, follow these concrete, actionable steps:\n\n### 1. Clearly Label What's Real vs Simulated\n\nFirst, ensure that your benchmark results are clearly labeled as either real or simulated. This can be done by including a JSON object in your results that specifies the nature of the execution. For example:\n\n```json\n{\n \"kind\": \"search_retrieval_probe\",\n \"simulated_execution\": true,\n \"note\": \"task_b_pass and ci_pr_compliance are simulated\"\n}\n```\n\n**Command to Create a JSON File:**\n\nIf you're working in a Linux or macOS environment, you can create a JSON file with the above content using the following command:\n\n```bash\necho '{\n \"kind\": \"search_retrieval_probe\",\n \"simulated_execution\": true,\n \"note\": \"task_b_pass and ci_pr_compliance are simulated\"\n}' > benchmark_results.json\n```\n\n### 2. Use Honest Framing\n\nWhen describing your benchmark results, use framing that accurately reflects the nature of the results. Avoid making claims that could be misleading.\n\n- **Incorrect:** \"Benchmark shows +31% improvement with lessons\"\n- **Correct:** \"Search", "metrics": { "length": 1157, "commands": 2, "command_list": [ "**Command to Create a JSON File:**", "If you're working in a Linux or macOS environment, you can create a JSON file with the above content using the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "中文 BM25 搜索:滑动窗口子串加分与唯一候选加分 (bm25-chinese-sliding-window-tuning)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with the Chinese BM25 search having low recall and insufficient sensitivity to short tokens, you can apply the following modifications to your BM25 implementation. We will use the `sliding_window_boost` and `unique_candidate_boost` functions provided in the lesson.\n\nHere's the updated Python code:\n\n```python\nimport numpy as np\nfrom scipy import spatial\n\n# BM25 parameters\nk1 = 1.2\nb = 0.75\nalpha = 1.2\nnum_docs = 1000\nnum_terms = 1000\n\n# Calculate IDF\ndef calculate_idf(doc_freq, num_docs):\n idf = np.log(num_docs / doc_freq)\n return idf\n\n# BM25 scoring function\ndef bm25_score(query, doc):\n doc_tokens = doc.split()\n query_tokens = query.split()\n doc_length = len(doc_tokens)\n query_length = len(query_tokens)\n idf = calculate_idf(doc_freq, num_docs)\n \n # Calculate BM25 score\n score = (k1 * (query_length + 0.5) * np.log((1 + 0.5 + b * (doc_length - 1)) / (1 + b * (doc_length", "metrics": { "length": 927, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Benchmark Honesty — Distinguishing Simulated vs Real Results (benchmark-honesty-simulated-vs-real)", "condition": "plain", "status": 200, "content": "To address the \"Benchmark Honesty — Distinguishing Simulated vs Real Results\" issue, it's essential to understand that this problem often arises in the context of evaluating the performance of algorithms, systems, or applications. Benchmark honesty refers to the practice of ensuring that benchmarks accurately reflect real-world performance and are not skewed by artificial or simulated conditions that might not represent typical usage scenarios.\n\nWithout a specific context (e.g., programming language, framework, or application), I'll provide a general approach to tackling this issue, focusing on distinguishing simulated from real results in benchmarking:\n\n### 1. Identify the Benchmarking Goals\n\nClearly define what aspects of performance you are trying to measure (e.g., execution time, memory usage, throughput). This step is crucial for designing honest and relevant benchmarks.\n\n### 2. Choose Realistic Data and Scenarios\n\n- **Use Real Data:** When possible, use real data that your application or system would encounter in production. This helps ensure that your benchmarks reflect real-world performance.\n- **Simulate Realistic Scenarios:** If you must simulate data or scenarios, ensure they closely mimic real-world conditions. Consider factors like data distribution, user behavior, and potential edge cases.\n\n### 3. Implement Benchmarking Tools\n\nDepending on your environment,", "metrics": { "length": 1393, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "中文 BM25 搜索:滑动窗口子串加分与唯一候选加分 (bm25-chinese-sliding-window-tuning)", "condition": "plain", "status": 200, "content": "To fix the error \"中文 BM25 搜索:滑动窗口子串加分与唯一候选加分 (bm25-chinese-sliding-window-tuning)\", we need to update the BM25 scoring function to support Chinese characters.\n\nHere's a step-by-step solution:\n\n**Step 1: Install the required library**\n\nYou need to install the `nltk` library with the `cmudict` and `pyspellchecker` packages. You can install them using the following command:\n\n```bash\npip install nltk cmudict pyspellchecker\n```\n\n**Step 2: Download the required data**\n\nYou need to download the following NLTK data:\n\n```python\nimport nltk\nnltk.download('cmudict')\nnltk.download('pyspellchecker')\n```\n\n**Step 3: Update the BM25 scoring function**\n\nYou need to update the BM25 scoring function to support Chinese characters. Here's an example of how you can do it:\n\n```python\nimport re\nfrom nltk.corpus import cmudict\nfrom pyspellchecker import SpellChecker\n\nclass BM25:\n def __init__(self, idf, weight):\n self.idf = idf\n self.weight = weight\n\n def calculate", "metrics": { "length": 974, "commands": 3, "command_list": [ "pip install nltk cmudict pyspellchecker", "**Step 3: Update the BM25 scoring function**", "You need to update the BM25 scoring function to support Chinese characters. Here's an example of how you can do it:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "BGE Embedding Fallback Crash (bge-embedding-fallback-crash)", "condition": "plain", "status": 200, "content": "To address the \"BGE Embedding Fallback Crash\" issue, you'll need to update your graphics drivers and possibly adjust some system settings. Here's a step-by-step guide to help you resolve this problem:\n\n### 1. Update Graphics Drivers\n\nOutdated graphics drivers can cause compatibility issues leading to crashes. Update your drivers to the latest version:\n\n- **For Windows:**\n 1. Press `Win + X` and select Device Manager.\n 2. Expand the \"Display Adapters\" section.\n 3. Right-click your graphics card and select \"Update driver\".\n 4. Choose \"Search automatically for updated driver software\" and follow the prompts.\n\n- **For macOS (if applicable):**\n - Updates for macOS usually include graphics driver updates. Ensure your macOS is up to date:\n 1. Click the Apple menu and select \"System Preferences\".\n 2. Click \"Software Update\".\n\n- **For Linux:**\n - The process can vary depending on your distribution. For Ubuntu/Debian-based systems:\n 1. Open a terminal.\n 2. Run `sudo apt update`.\n 3. Run `sudo apt full-upgrade`.\n 4. Reboot your system.\n\n### 2", "metrics": { "length": 1071, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "BM25 + Vector Hybrid Search: configurable blending weights (bm25-vector-hybrid-search-weights)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to add the configurable blending weights for BM25 + Vector Hybrid Search to your config.yaml or env vars. Here's a step-by-step guide:\n\n**Step 1: Update config.yaml**\n\nIf you have a config.yaml file, update it with the following configuration:\n\n```yaml\nsearch:\n hybrid:\n enabled: true\n bm25_weight: 0.7 # adjust the weight for BM25 score (0.0 - 1.0)\n vector_weight: 0.3 # adjust the weight for vector score (0.0 - 1.0)\n blend_method: rrf # options: rrf | linear\n```\n\nIn this example, we're setting the BM25 weight to 0.7 and the vector weight to 0.3, which means BM25 will have a higher impact on the search results.\n\n**Step 2: Update env vars (if applicable)**\n\nIf you're using environment variables, update them with the following commands:\n\n```bash\n# Set the BM25 weight\nexport BM25_WEIGHT=0.7\n\n# Set the vector weight\nexport VECTOR_WEIGHT=0.3\n\n# Set the blend method (optional)\nexport BLEND_METHOD", "metrics": { "length": 955, "commands": 3, "command_list": [ "In this example, we're setting the BM25 weight to 0.7 and the vector weight to 0.3, which means BM25 will have a higher impact on the search results.", "**Step 2: Update env vars (if applicable)**", "If you're using environment variables, update them with the following commands:" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Moorcheh API Auth Header Bug (auth-header-bug)", "condition": "plain", "status": 200, "content": "To fix the Moorcheh API Auth Header Bug (auth-header-bug), follow these steps. This solution assumes you are working with a typical API authentication setup and have access to modify the API's authentication headers.\n\n### Step 1: Identify the Issue\n\nFirst, you need to understand the nature of the bug. The Moorcheh API Auth Header Bug typically involves issues with how authentication headers are set or interpreted by the API. This could be due to incorrect header names, values, or formatting.\n\n### Step 2: Review API Documentation\n\nReview the Moorcheh API documentation to ensure you are setting the authentication headers correctly. Look for sections related to authentication, specifically how to format the `Authorization` header or any other headers required for authentication.\n\n### Step 3: Correct Header Format\n\nEnsure your authentication header is correctly formatted. For many APIs, the `Authorization` header should be in the format:\n```\nAuthorization: Bearer YOUR_TOKEN_HERE\n```\nReplace `YOUR_TOKEN_HERE` with your actual API token.\n\n### Step 4: Use Correct Header Name\n\nVerify that you are using the correct header name. While `Authorization` is standard, some APIs might use custom headers (e.g., `X-Auth-Token`).\n\n### Step 5:", "metrics": { "length": 1243, "commands": 1, "command_list": [ "Authorization: Bearer YOUR_TOKEN_HERE" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "BGE Embedding Fallback Crash (bge-embedding-fallback-crash)", "condition": "with_lesson", "status": 200, "content": "To fix the BGE Embedding Fallback Crash, follow these steps:\n\n### Step 1: Modify the `skill_indexer.py` File\n\n1. Open the `skill_indexer.py` file in your text editor.\n2. Locate the `_init_embedding_model()` function.\n3. Replace the hard-coded absolute path with a constructor parameter, and add a fallback mechanism to use the `EMBEDDING_MODEL_PATH` environment variable.\n\n```python\nimport os\n\nclass SkillIndexer:\n def __init__(self, embedding_model_path=None):\n self.embedding_model_path = embedding_model_path\n\n def _init_embedding_model(self):\n if self.embedding_model_path is None:\n self.embedding_model_path = os.environ.get('EMBEDDING_MODEL_PATH')\n if self.embedding_model_path is None:\n self.embedding_model_path = 'bge-m3' # auto-download\n\n try:\n # Load the model with local_files_only=False to allow auto-download\n self.embedding_model = EmbeddingModel(self.embedding_model_path, local_files_only=False)\n except Exception as e:\n # Degrade to no-embedding mode if loading fails\n print(f\"Error loading embedding model: {e}\")\n self.embedding_model = None", "metrics": { "length": 1179, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 1, "lesson_hit_rate": 0.25 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "BM25 + Vector Hybrid Search: configurable blending weights (bm25-vector-hybrid-search-weights)", "condition": "plain", "status": 200, "content": "To fix the error \"BM25 + Vector Hybrid Search: configurable blending weights (bm25-vector-hybrid-search-weights)\" in Elasticsearch, you need to add the `bm25_vector` and `vector` modules to your `analysis-analyzer` configuration in your Elasticsearch index settings.\n\nHere's an example of how to do it:\n\n```json\n{\n \"settings\": {\n \"analysis\": {\n \"analyzer\": {\n \"my_analyzer\": {\n \"type\": \"custom\",\n \"tokenizer\": \"standard\",\n \"filter\": [\n \"lowercase\",\n \" PorterStemmer\",\n \"my BM25 filter\"\n ],\n \"char_filter\": [\n \"html\"\n ],\n \"filter\": [\n {\n \"name\": \"my BM25 filter\"\n },\n {\n \"name\": \"bm25_vector\"\n },\n {\n \"name\": \"vector\"\n }\n ]\n }\n },\n \"filter\": {\n \"my BM25 filter\": {\n \"type\": \"BM25\",\n \"lowercase_expansion\": true,\n \"field\": \"content\"\n }\n }\n }\n },\n \"mappings\": {\n \"properties\": {\n \"content\": {\n", "metrics": { "length": 1103, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "中文 BM25 搜索:滑动窗口子串加分与唯一候选加分 (bm25-chinese-sliding-window-tuning)", "condition": "with_lesson", "status": 200, "content": "To address the issue of low recall rates for long Chinese queries using the BM25 search algorithm, you can implement the following concrete and actionable fixes:\n\n### Step 1: Implement Sliding Window Substring Boosting\n\nFirst, you need to modify your search algorithm to include a sliding window approach for substring matching. This involves checking for substrings of the query within the documents and applying a boost to the score if matches are found.\n\n```python\ndef sliding_window_boost(query, doc, window_min=4, window_max=6, threshold=10):\n \"\"\"\n Apply a boost to the score based on sliding window substring matches.\n \n :param query: The search query.\n :param doc: The document to check against.\n :param window_min: Minimum window size (default=4).\n :param window_max: Maximum window size (default=6).\n :param threshold: Minimum query length to apply the boost (default=10).\n :return: The boost value.\n \"\"\"\n if len(query) < threshold:\n return 0\n boost = 0\n for w in range(window_min, window_max + 1):\n for i in range(len(query) - w + 1):\n substring = query[i:i", "metrics": { "length": 1131, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CSP blocks JavaScript injection in browser automation of authenticated pages (browser-automation-csp-bypass)", "condition": "with_lesson", "status": 200, "content": "To bypass CSP and inject JavaScript into pages with strict Content Security Policy headers, you can use the following approaches:\n\n**Approach 1: Use a nonce**\n\nIf the CSP policy includes a nonce, you can use it to inject scripts. Here's an example using Puppeteer:\n\n```javascript\nconst puppeteer = require('puppeteer');\n\n(async () => {\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n\n // Get the nonce from the CSP header\n const cspHeader = await page.$eval('head', (head) => head.content);\n const cspPolicy = await page.$eval('head', (head) => head.content.split(';').find((line) => line.trim() === 'Content-Security-Policy'));\n const nonce = cspPolicy.split(';').find((line) => line.trim().startsWith('nonce-')).split('=')[1].trim();\n\n // Inject script with nonce\n await page.evaluate((nonce) => {\n document.head.innerHTML = document.head.innerHTML + `\n \n {\n res.writeHead(302, {\n Location: targetUrl + req.url\n });\n res.end();\n});\n\napp.use('/proxy', httpProxy.createProxyServer({\n target: proxyUrl,\n changeOrigin: true,\n onProxyRes: (proxy", "metrics": { "length": 1110, "commands": 1, "command_list": [ "npm install http-proxy" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "中文 BM25 搜索:滑动窗口子串加分与唯一候选加分 (bm25-chinese-sliding-window-tuning)", "condition": "plain", "status": 200, "content": "To address the issue with BM25 Chinese sliding window tuning, we need to adjust the parameters to optimize the search results. Here's a step-by-step solution:\n\n1. **Adjust the sliding window size**: Increase the sliding window size to capture more context. You can do this by setting the `window_size` parameter to a larger value, such as 10 or 20.\n\n ```python\nfrom pybm25 import BM25\n\n# Initialize the BM25 object with a larger window size\nbm25 = BM25(window_size=10)\n```\n\n2. **Tune the BM25 parameters**: Adjust the `k1` and `b` parameters to fine-tune the ranking. A higher `k1` value gives more weight to term frequency, while a higher `b` value gives more weight to document length.\n\n ```python\nbm25 = BM25(k1=1.2, b=0.75)\n```\n\n3. **Implement a custom scoring function**: Create a custom scoring function that incorporates the sliding window and unique candidate boosts. This function should take into account the term frequency, document length, and the sliding window context.\n\n ```python\ndef custom_scoring(bm25, query, doc):\n # Calculate the BM", "metrics": { "length": 1062, "commands": 2, "command_list": [ "2. **Tune the BM25 parameters**: Adjust the `k1` and `b` parameters to fine-tune the ranking. A higher `k1` value gives more weight to term frequency, while a higher `b` value gives more weight to document length.", "3. **Implement a custom scoring function**: Create a custom scoring function that incorporates the sliding window and unique candidate boosts. This function should take into account the term frequency, document length, and the sliding window context." ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Chroma 建库无 Checkpoint — 进程一死全部丢失 (chroma-rebuild-no-checkpoint-cn)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, here's a concrete, actionable fix for the error:\n\n**Fix 1: Modify `build_edoc_chroma.py` to use batch processing**\n\n```python\npython\nimport os\n\ndef embed_and_build(chunks, model, collection, batch_size=5000):\n for i in range(0, len(chunks), batch_size):\n batch = chunks[i:i+batch_size]\n embeddings = model.encode([c[\"text\"] for c in batch])\n collection.add(\n ids=[c[\"id\"] for c in batch],\n embeddings=embeddings.tolist(),\n documents=[c[\"text\"] for c in batch]\n )\n print(f\"[Checkpoint] Written {i+batch_size}/{len(chunks)}\")\n\ndef main():\n # Your code here\n chunks = ... # Load chunks from somewhere\n model = ... # Load model from somewhere\n collection = ... # Load collection from somewhere\n embed_and_build(chunks, model, collection)\n\nif __name__ == \"__main__\":\n main()\n```\n\n**Fix 2: Run `build_edoc_chroma.py` in a separate terminal**\n\nOpen a new terminal and navigate to the directory where `build_edoc_ch", "metrics": { "length": 1034, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Chroma 建库无 Checkpoint — 进程一死全部丢失 (chroma-rebuild-no-checkpoint-cn)", "condition": "plain", "status": 200, "content": "The error you're encountering is a known issue with Chroma, a popular tool for building and managing Kubernetes clusters. The error message indicates that there's a checkpoint issue during the rebuild process, which can result in data loss if not addressed promptly.\n\nTo fix this issue, you'll need to delete the existing checkpoint and rebuild the cluster from scratch. Here are the steps:\n\n**Step 1: Delete the existing checkpoint**\n\nRun the following command to delete the checkpoint:\n```bash\nchroma delete-rebuild-checkpoint --cluster-name \n```\nReplace `` with the name of your Chroma cluster.\n\n**Step 2: Rebuild the cluster**\n\nRun the following command to rebuild the cluster:\n```bash\nchroma rebuild --cluster-name \n```\nAgain, replace `` with the name of your Chroma cluster.\n\n**Optional: Verify the checkpoint deletion**\n\nTo verify that the checkpoint has been deleted, run the following command:\n```bash\nchroma status --cluster-name \n```\nThis will display the current status of your cluster, including the checkpoint information.\n\n**Note:** Rebuilding the cluster from scratch can take some time, depending on the size of your cluster and the complexity of the rebuild process", "metrics": { "length": 1253, "commands": 3, "command_list": [ "chroma delete-rebuild-checkpoint --cluster-name ", "chroma rebuild --cluster-name ", "chroma status --cluster-name " ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "BM25 + Vector Hybrid Search: configurable blending weights (bm25-vector-hybrid-search-weights)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with BM25 + Vector Hybrid Search, you need to configure the blending weights. Here's a step-by-step solution:\n\n**Step 1: Open your `config.yaml` file**\n\nOpen the `config.yaml` file in a text editor. This file is usually located in the root directory of your project.\n\n**Step 2: Add the hybrid search configuration**\n\nAdd the following configuration to the `config.yaml` file:\n```yml\nsearch:\n hybrid:\n enabled: true\n bm25_weight: 0.5\n vector_weight: 0.5\n blend_method: rrf\n```\n**Explanation:**\n\n* `enabled`: Set to `true` to enable hybrid search.\n* `bm25_weight`: Set the weight for the BM25 score (range: 0.0 - 1.0). A higher value gives more importance to BM25.\n* `vector_weight`: Set the weight for the vector score (range: 0.0 - 1.0). A higher value gives more importance to vector embeddings.\n* `blend_method`: Choose the blending method. Options are `rrf` (default) or `linear`.\n\n**Step 3: Adjust the weights (optional)**\n\n", "metrics": { "length": 958, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 11, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Chroma 建库无 Checkpoint — 进程一死全部丢失 (chroma-rebuild-no-checkpoint-cn)", "condition": "with_lesson", "status": 200, "content": "To address the issue of Chroma database loss upon process death due to the lack of checkpointing, you need to modify the `build_edoc_chroma.py` script to write data to Chroma in batches. This ensures that even if the process dies, the data written up to the last batch will not be lost. Here are the concrete steps and commands to follow:\n\n### Step 1: Modify `build_edoc_chroma.py`\n\nOpen the `build_edoc_chroma.py` file in your preferred text editor. Locate the part of the script where it embeds and writes data to Chroma. Replace that section with the following code to enable batch writing:\n\n```python\ndef embed_and_build(chunks, model, collection, batch_size=5000):\n for i in range(0, len(chunks), batch_size):\n batch = chunks[i:i+batch_size]\n embeddings = model.encode([c[\"text\"] for c in batch])\n collection.add(\n ids=[c[\"id\"] for c in batch],\n embeddings=embeddings.tolist(),\n documents=[c[\"text\"] for c in batch]\n )\n print(f\"[Checkpoint] Written {i+batch_size}/{len(chunks)}\")\n```\n\nThis modification allows the", "metrics": { "length": 1089, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 4, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Chrome Relay 浏览器Automation — CDP over WebSocket 控制无头浏览器 (chrome-relay-browser-automation)", "condition": "with_lesson", "status": 200, "content": "解决 Chrome Relay 浏览器Automation — CDP over WebSocket 控制无头浏览器的错误步骤如下:\n\n**步骤 1:启动带调试端口的 Chrome**\n\n**方式 A — WSL/Linux 下的无头 Chrome**\n```bash\nchromium-browser --remote-debugging-port=9222 --no-sandbox --headless \\\n --user-data-dir=/tmp/chrome-dev-profile\n```\n**方式 B — 复用 Windows 已打开的 Chrome(WSL 网络隔离下不可行)**\n```powershell\nchrome.exe --remote-debugging-port=9222\n```\n**注意:WSL2 和 Windows 之间有 NAT 隔离,WSL 内无法直接访问 Windows localhost 的调试端口。如果用 Windows Chrome,Claw Relay 需要部署在 Windows 上。**\n\n**步骤 2:启动 Claw Relay 连接 Chrome**\n\n```bash\nnpm install -g openclaw\n\n# 配置文件 ~/.claw-relay/config.yaml\ncat ~/.claw-relay/config.yaml << 'EOF'\nserver:\n port: 9333\n host: \"127.0.0.1\"\nagents:\n {\n const browser = await puppeteer.launch({\n headless: false,\n args: ['--disable-web-security'],\n });\n const page = await browser.newPage();\n // Your automation code here\n})();\n```\nFor Playwright, use the following code:\n```javascript\nconst playwright = require('playwright');\n\n(async () => {\n const browser = await playwright.chromium.launch({\n headless: false,\n args: ['--disable-web-security'],\n });\n const page = await browser.newPage();\n // Your automation code here\n})();\n```\n**Approach 2: Set a custom CSP header (Puppeteer/Playwright)**\n\nYou can set a custom CSP header that allows inline scripts and evaluation using the `page.setExtraHTTPHeaders()` method:\n```javascript\nconst puppeteer = require('puppeteer", "metrics": { "length": 1109, "commands": 3, "command_list": [ "For Playwright, use the following code:", "**Approach 2: Set a custom CSP header (Puppeteer/Playwright)**", "You can set a custom CSP header that allows inline scripts and evaluation using the `page.setExtraHTTPHeaders()` method:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Chrome Relay 浏览器Automation — CDP over WebSocket 控制无头浏览器 (chrome-relay-browser-automation)", "condition": "with_lesson", "status": 200, "content": "根据提供的信息,以下是具体的解决步骤:\n\n**步骤 1:启动带调试端口的 Chrome**\n\n您可以选择以下两种方式之一启动 Chrome:\n\n方式 A — WSL/Linux 下的无头 Chrome:\n```bash\nchromium-browser --remote-debugging-port=9222 --no-sandbox --headless \\\n --user-data-dir=/tmp/chrome-dev-profile\n```\n方式 B — 复用 Windows 已打开的 Chrome(WSL 网络隔离下不可行):\n```powershell\nchrome.exe --remote-debugging-port=9222\n```\n**步骤 2:启动 Claw Relay 连接 Chrome**\n\n1. 安装 OpenClaw:\n```bash\nnpm install -g openclaw\n```\n2. 创建配置文件 `~/.claw-relay/config.yaml`:\n```bash\ncat << 'EOF' > ~/.claw-relay/config.yaml\nserver:\n port: 9333\n host: \"127.0.0.1\"\nagents:\n my-agent:\n token: \"my-token\"\n scopes: [\"read\", \"interact\", \"navigate\"]\n allowlist: [\"\"]\n rateLimit: ", "metrics": { "length": 668, "commands": 5, "command_list": [ "chromium-browser --remote-debugging-port=9222 --no-sandbox --headless \\", "--user-data-dir=/tmp/chrome-dev-profile", "**步骤 2:启动 Claw Relay 连接 Chrome**", "1. 安装 OpenClaw:", "2. 创建配置文件 `~/.claw-relay/config.yaml`:" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "BM25 + Vector Hybrid Search: configurable blending weights (bm25-vector-hybrid-search-weights)", "condition": "plain", "status": 200, "content": "To address the issue of implementing BM25 + Vector Hybrid Search with configurable blending weights, you'll need to adjust your search configuration. The exact steps can vary depending on the specific search engine or framework you're using (e.g., Elasticsearch, Weaviate, etc.). However, I'll provide a general approach and an example using Elasticsearch, a popular search engine, to demonstrate how you might implement this.\n\n### Step 1: Understand BM25 and Vector Search\n\n- **BM25 (Best Match 25)**: A traditional TF-IDF ranking algorithm that is effective for keyword-based searches.\n- **Vector Search**: Utilizes vector embeddings (like those from transformer models) to capture semantic meaning, useful for more nuanced searches.\n\n### Step 2: Configure Elasticsearch\n\nFor this example, let's assume you're using Elasticsearch 8.x. You'll need to create an index with a custom mapping that includes both text fields for BM25 search and vector fields for vector search.\n\n1. **Create Index with Custom Mapping**:\n\nFirst, create an index named `hybrid_search_index` with a mapping that includes a text field for BM25 and a dense_vector field for vector search.\n\n```bash\ncurl -X PUT \"localhost:9200/hybrid_search_index\" -", "metrics": { "length": 1222, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Actions CI for AI Agent PRs — DCO decoupling & PYTHONPATH fix (ci-dco-decouple-pythonpath-fork-pr)", "condition": "with_lesson", "status": 200, "content": "以下是一些具体的修复步骤和命令:\n\n1. 用 PYTHONPATH 替代 pip install -e。\n\n在 `pr-checks.yml` 中,替换以下行:\n\n```yaml\n- name: 📦 Install Dependencies\n run: |\n pip install -r requirements.txt 2/dev/null || true\n pip install pytest pytest-cov\n echo \"PYTHONPATH=$(pwd):$PYTHONPATH\" $GITHUB_ENV\n```\n\n替换为:\n\n```yaml\n- name: 📦 Install Dependencies\n run: |\n python -m pip install --no-deps -r requirements.txt 2/dev/null || true\n python -m pip install pytest pytest-cov\n export PYTHONPATH=$PYTHONPATH:.\n```\n\n2. 解耦 DCO 与测试执行。\n\n在 `pr-checks.yml` 中,删除以下行:\n\n```yaml\nif: steps.dco.outputs.dco_passed == 'true'\n```\n\n3. coverage 阈值适配小 PR。\n\n在 `pr-checks.yml` 中,添加以下行:\n\n```yaml\n- name: Run tests and report coverage\n run: |\n pytest --cov=.\n pytest-cov --cov", "metrics": { "length": 740, "commands": 5, "command_list": [ "替换为:", "2. 解耦 DCO 与测试执行。", "在 `pr-checks.yml` 中,删除以下行:", "3. coverage 阈值适配小 PR。", "在 `pr-checks.yml` 中,添加以下行:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Actions CI for AI Agent PRs — DCO decoupling & PYTHONPATH fix (ci-dco-decouple-pythonpath-fork-pr)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the fact that the `PYTHONPATH` environment variable is not being set correctly in your GitHub Actions workflow. Here's a concrete, actionable fix with exact commands:\n\n**Fix:**\n\n1. Update your `ci.yml` file to include the following lines:\n\n```yaml\nname: Python package\n\non:\n pull_request:\n branches:\n - main\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Set up Python 3.9\n uses: actions/setup-python@v3\n with:\n python-version: '3.9'\n\n - name: Install dependencies\n run: |\n pip install --upgrade pip\n pip install -r requirements.txt\n\n - name: Set PYTHONPATH\n run: |\n export PYTHONPATH=$PYTHONPATH:/path/to/your/project\n\n - name: Run tests\n run: |\n python -m unittest discover -s tests\n```\n\nReplace `/path/to/your/project` with the actual path to your project's Python packages.\n\n2. Create a new file named `.github/workflows/ci.yml", "metrics": { "length": 1066, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)", "condition": "with_lesson", "status": 200, "content": "To fix the `CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)` error, you can follow these steps:\n\n1. **Modify the test file to read the source code directly instead of importing the module**:\n\n * Replace the `_import_lambda_module` function with `_extract_default` function that reads the source code text and extracts the default value using regular expressions.\n\n ```python\nimport re\nimport sys\n\ndef _extract_default(source: str) -> str:\n match = re.search(\n r'''os\\.environ\\.get\\(\\s[\"']EXCLUDE_CHARACTERS[\"']\\s,\\s(['\"])((?:[^\\\\]|\\\\.)?)\\1''',\n source,\n )\n return match.group(2)\n\n# Read the source code from the file\nsource = (Path(\"lambda\") / \"index.py\").read_text()\n\n# Extract the default value\ndefault_value = _extract_default(source)\n\n# Assert that the default value contains the expected string\nassert \"/@\" in default_value\n```\n\n2. **Update the test command to run with the correct Python version**:\n\n * Use the `python3` command to", "metrics": { "length": 994, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)", "condition": "plain", "status": 200, "content": "The error \"CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)\" is a common issue in CI/CD pipelines, especially when using AWS Lambda functions. This error occurs when a Lambda function has side effects that affect the import statements, causing the function to fail.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Solution 1: Use a `__init__.py` file to avoid side effects**\n\nIn your Lambda function's directory, create a new file called `__init__.py`. This file will help avoid side effects by allowing Python to import modules without executing the entire function.\n\n```bash\n# Create a new file called __init__.py in your Lambda function's directory\ntouch __init__.py\n```\n\n**Solution 2: Use a separate file for imports**\n\nCreate a new file called `imports.py` in your Lambda function's directory. This file will contain all the imports, and you can avoid side effects by importing modules in this file.\n\n```bash\n# Create a new file called imports.py in your Lambda function's directory\ntouch imports.py\n```\n\n**Solution 3: Use a Lambda function with a fixed set of imports**\n\nIf you're", "metrics": { "length": 1115, "commands": 2, "command_list": [ "touch __init__.py", "touch imports.py" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CSP blocks JavaScript injection in browser automation of authenticated pages (browser-automation-csp-bypass)", "condition": "plain", "status": 200, "content": "To bypass Content Security Policy (CSP) blocks for JavaScript injection in browser automation of authenticated pages, you can use the following approaches. Please note that these solutions are for testing and development purposes only. Always ensure you have the right to automate and inject scripts into the websites you're working with.\n\n### 1. Using Selenium with Python\n\nIf you're using Selenium with Python for browser automation, you can disable CSP by modifying the browser's settings. However, directly disabling CSP might not be straightforward due to browser security restrictions. Instead, you can try to bypass it by injecting scripts that are allowed by the policy or by using a proxy to modify the CSP headers.\n\nFor Selenium, you can try setting up a custom Chrome profile or modifying the command-line arguments to disable web security, which might help in some cases:\n\n```python\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\n# Create a new instance of the Chrome driver with disabled web security\nchrome_options = Options()\nchrome_options.add_argument(\"--disable-web-security\")\nchrome_options.add_argument(\"--allow-running-insecure-content\")\n\n# Create the driver\ndriver = webdriver.Chrome(options=chrome_options)\n\n# Navigate to your page\ndriver.get(\"your_target_url\")\n```\n\n### 2. Using Puppeteer with Node", "metrics": { "length": 1361, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "GitHub Actions CI for AI Agent PRs — DCO decoupling & PYTHONPATH fix (ci-dco-decouple-pythonpath-fork-pr)", "condition": "with_lesson", "status": 200, "content": "To address the issues with your GitHub Actions CI for AI Agent PRs, follow these concrete steps:\n\n### 1. Replace `pip install -e .` with `PYTHONPATH`\n\nIn your `pr-checks.yml` file, update the step that installs dependencies to use `PYTHONPATH` instead of `pip install -e .`. This will help avoid compatibility issues with `pyproject.toml` and speed up the installation process.\n\n```yaml\n- name: Install Dependencies\n run: |\n pip install -r requirements.txt 2>/dev/null || true\n pip install pytest pytest-cov\n echo \"PYTHONPATH=$(pwd):$PYTHONPATH\" >> $GITHUB_ENV\n```\n\n### 2. Decouple DCO from Test Execution\n\nRemove the `if: steps.dco.outputs.dco_passed == 'true'` condition from all test steps in your workflow. This will allow tests to run regardless of the DCO status. The DCO check will still run and report, but it won't block the tests.\n\n```yaml\n# Remove this condition from all test steps\n# if: steps.dco.outputs.dco_passed == 'true'\n```\n\nThen, in your final reporting step, check both the DCO status and", "metrics": { "length": 1019, "commands": 1, "command_list": [ "Remove the `if: steps.dco.outputs.dco_passed == 'true'` condition from all test steps in your workflow. This will allow tests to run regardless of the DCO status. The DCO check will still run and report, but it won't block the tests." ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "GitHub Actions CI for AI Agent PRs — DCO decoupling & PYTHONPATH fix (ci-dco-decouple-pythonpath-fork-pr)", "condition": "plain", "status": 200, "content": "To address the error you're encountering with GitHub Actions CI for AI Agent PRs, specifically related to DCO (Developer Certificate of Origin) decoupling and PYTHONPATH fix, follow these steps. This guide assumes you are working on a GitHub repository and have basic knowledge of Git and GitHub Actions.\n\n### Step 1: Understand the Error\nFirst, identify the exact error message you're seeing. The error might be related to:\n- DCO checks failing due to incorrect commit signatures.\n- PYTHONPATH issues causing import errors in your Python scripts.\n\n### Step 2: Fix DCO Issues\nFor DCO issues, ensure that your commits are signed off correctly. You can do this by adding a sign-off line to your commit messages:\n```bash\ngit commit -m \"Your commit message\nSigned-off-by: Your Name \"\n```\nAlternatively, if you've already made commits without proper sign-off, you can amend the last commit:\n```bash\ngit commit --amend -s -m \"Your commit message\"\ngit push origin --force\n```\n\n### Step 3: Fix PYTHONPATH Issues\nFor PYTHONPATH issues, you need to ensure that your GitHub Actions workflow correctly sets the PYTHONPATH environment variable.", "metrics": { "length": 1169, "commands": 4, "command_list": [ "git commit -m \"Your commit message", "Signed-off-by: Your Name \"", "git commit --amend -s -m \"Your commit message\"", "git push origin --force" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI security checks: action pinning, permissions, README, code style (ci-security-advisory-checks)", "condition": "with_lesson", "status": 200, "content": "To fix the CI security checks, you'll need to add the following YAML script to your `.github/workflows/your-workflow-name.yml` file. Replace `your-workflow-name` with the name of your workflow.\n\n```yml\nname: Security Advisory Checks\non:\n pull_request:\n types: [opened, synchronize]\njobs:\n security-checks:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n\n - name: Run security advisory checks\n run: |\n # Check workflow action pinning (SHA vs version tag)\n for wf in .github/workflows/.yml; do\n UNPINNED=$(grep -E 'uses: [a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+@v[0-9]' \"$wf\" | grep -v '@[a-f0-9]{40}' || true)\n if [ -n \"$UNPINNED\" ]; then\n echo \"::warning file=$wf::Unpinned actions: $UNPINNED\"\n fi\n done\n\n # Check overly broad permissions\n for wf in .github/workflows/.", "metrics": { "length": 919, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI security checks: action pinning, permissions, README, code style (ci-security-advisory-checks)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to CI security checks. Here's a step-by-step solution to fix it:\n\n**Step 1: Install required dependencies**\n\nYou'll need to install `ci-security-advisory-checks` and `github-action-security-scanner`. Run the following commands:\n\n```bash\ngo get -u github.com/securego/gsighook\ngo get -u github.com/securego/gsighook/cmd/gsighook\ngo get -u github.com/google/go-github-v3/github\ngo get -u github.com/google/go-github-v3/github/actions\ngo get -u github.com/google/go-github-v3/github/actions/github-security-scanner\ngo get -u github.com/google/go-github-v3/github/actions/github-security-scanner/cmd/github-security-scanner\n```\n\n**Step 2: Configure GitHub Actions**\n\nCreate a new file in your repository's `.github/workflows` directory called `security.yml`. Add the following YAML configuration:\n\n```yml\nname: Security\n\non:\n push:\n branches:\n - main\n\njobs:\n security:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n\n", "metrics": { "length": 1017, "commands": 6, "command_list": [ "go get -u github.com/securego/gsighook", "go get -u github.com/securego/gsighook/cmd/gsighook", "go get -u github.com/google/go-github-v3/github", "go get -u github.com/google/go-github-v3/github/actions", "go get -u github.com/google/go-github-v3/github/actions/github-security-scanner" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)", "condition": "plain", "status": 200, "content": "The error \"CI 测试陷阱 — 模块级副作用导致 import 失败\" (CI test trap - module-level side effects cause import failure) typically occurs when there are side effects in your module that are executed during import, causing issues in a CI (Continuous Integration) environment. This can happen when your code is designed to run in an environment where certain conditions are assumed to be met, but those conditions are not present in the CI environment.\n\nTo fix this issue, you need to ensure that your code does not execute any side effects at the module level. Side effects can include database connections, file I/O, network requests, or any other operation that affects external state. Here are steps you can take to address the problem:\n\n### 1. Identify the Side Effects\n\nFirst, you need to identify where the side effects are happening in your code. Look for any code that is executed at the module level (i.e., not inside a function or class method) and that interacts with external resources.\n\n### 2. Move Side Effects into Functions\n\nOnce you've identified the side effects, you should move them into functions. This way, they will only be executed when the function is explicitly called, rather than automatically when the module is imported.\n\n", "metrics": { "length": 1235, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Chrome Relay 浏览器Automation — CDP over WebSocket 控制无头浏览器 (chrome-relay-browser-automation)", "condition": "plain", "status": 200, "content": "To fix the issue with Chrome Relay browser automation using CDP (Chrome DevTools Protocol) over WebSocket for controlling a headless browser, follow these steps. The error you're encountering isn't specified, but I'll guide you through a general setup and troubleshooting process.\n\n### 1. Ensure Chrome Browser and ChromeDriver are Up-to-Date\n\nFirst, make sure your Chrome browser and ChromeDriver are updated to the latest versions. This can often resolve compatibility issues.\n\n- **Update Chrome Browser:**\n - Open Chrome, go to `chrome://version/` to check your version.\n - If not up-to-date, go to `chrome://settings/help` to update.\n\n- **Update ChromeDriver:**\n - Check your ChromeDriver version by running `chromedriver --version` in your terminal/command prompt.\n - Download the latest ChromeDriver from [here](https://chromedriver.chromium.org/downloads) that matches your Chrome browser version.\n\n### 2. Set Up ChromeDriver for Headless Mode\n\nEnsure you can run Chrome in headless mode using ChromeDriver. Here’s how you can do it:\n\n- **For Windows:**\n ```bash\n chromedriver --headless --disable-gpu --window-size=1920,1080\n", "metrics": { "length": 1139, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Claude Code can debug low-level cryptography — ML-DSA signature verification (claude-code-debugging-ml-dsa-cryptography)", "condition": "plain", "status": 200, "content": "To debug low-level cryptography, specifically with the `claude-code-debugging-ml-dsa-cryptography` error, you can follow these steps:\n\n**Step 1: Install required packages**\n\nYou'll need to install the following packages:\n```bash\npip install cryptography\n```\nThis will install the `cryptography` library, which provides a common interface to many different cryptographic algorithms.\n\n**Step 2: Update your code**\n\nMake sure your code is up-to-date and uses the latest version of the `cryptography` library. You can do this by updating your `requirements.txt` file or by running the following command:\n```bash\npip install --upgrade cryptography\n```\n**Step 3: Verify your code**\n\nBefore running your code, verify that it's correctly implemented. Make sure you're using the correct algorithms and parameters for your specific use case.\n\n**Step 4: Debug your code**\n\nTo debug your code, you can use the `cryptography` library's built-in debugging tools. Here's an example:\n```python\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.hazmat.primitives.asymmetric import padding\nfrom cryptography.hazmat.backends import default_backend\nimport hashlib\n\n# Load your private key\nwith open('", "metrics": { "length": 1205, "commands": 2, "command_list": [ "pip install cryptography", "pip install --upgrade cryptography" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Claude Code can debug low-level cryptography — ML-DSA signature verification (claude-code-debugging-ml-dsa-cryptography)", "condition": "with_lesson", "status": 200, "content": "To fix the bug, we need to refactor the `w1Encode` function in the Verify path to accept pre-computed high bits. Here are the steps:\n\n1. Identify the problematic line in the Verify path:\n\n```go\nw1 := w1Encode(highBits(UseHint(...)))\n```\n\n2. Refactor the `w1Encode` function to accept pre-computed high bits:\n\n```go\n// Before:\nfunc w1Encode(w []poly) []poly { ... }\n\n// After:\nfunc w1Encode(w1 []poly, highBits []poly) []poly { ... }\n```\n\n3. Update the Verify path to pass the pre-computed high bits:\n\n```go\nhighBits := UseHint(...)\nw1 := w1Encode(w1, highBits)\n```\n\nHere's the complete code snippet with the fix:\n\n```go\n// Sign path: w1Encode(highBits(w)) — correct\nfunc Sign() []poly {\n // ... (rest of the Sign implementation remains the same)\n w1 := w1Encode(highBits(w))\n return w1\n}\n\n// Verify path: w1Encode(highBits(UseHint(...))) — double high bits!\nfunc Verify() bool {\n // ... (rest of the", "metrics": { "length": 911, "commands": 3, "command_list": [ "2. Refactor the `w1Encode` function to accept pre-computed high bits:", "3. Update the Verify path to pass the pre-computed high bits:", "Here's the complete code snippet with the fix:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CI security checks: action pinning, permissions, README, code style (ci-security-advisory-checks)", "condition": "plain", "status": 200, "content": "To address the error related to CI security checks, specifically action pinning, permissions, README, and code style (ci-security-advisory-checks), you'll need to take several steps. These steps are designed to enhance the security and compliance of your GitHub Actions workflow. Here’s how you can fix these issues:\n\n### 1. Action Pinning\n\nAction pinning involves specifying the exact version of an action you're using in your workflow. This is crucial for security and reliability, as it prevents unexpected changes in the actions used by your workflow.\n\n**Fix:**\n\nEdit your workflow file (usually in `.github/workflows/`) and update any actions to pin them to a specific version. For example, if you're using `actions/checkout@v2`, update it to `actions/checkout@v3` or the latest version available.\n\n```yaml\nsteps:\n - name: Checkout code\n uses: actions/checkout@v3\n```\n\nReplace `v3` with the version you intend to use.\n\n### 2. Permissions\n\nEnsure that the permissions in your workflow are set appropriately to minimize exposure. This involves setting `permissions` at the workflow or job level.\n\n**Fix:**\n\nAdd or modify the `permissions` section in your", "metrics": { "length": 1161, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CI security checks: action pinning, permissions, README, code style (ci-security-advisory-checks)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"CI security checks: action pinning, permissions, README, code style (ci-security-advisory-checks)\", you need to add a new step to your GitHub Actions workflow that performs the security advisory checks. Here's a concrete, actionable fix:\n\n**Step 1: Create a new file in your repository's `.github/workflows` directory**\n\nCreate a new file named `security-advisory-checks.yml` in the `.github/workflows` directory of your repository. You can do this by running the following command in your terminal:\n```bash\nmkdir -p .github/workflows\ntouch .github/workflows/security-advisory-checks.yml\n```\n**Step 2: Add the security advisory checks to the new file**\n\nAdd the following YAML code to the `security-advisory-checks.yml` file:\n```yaml\nname: Security Advisory Checks\n\non:\n push:\n branches:\n - main\n\njobs:\n security-checks:\n runs-on: ubuntu-latest\n steps:\n - name: Security Advisory Checks\n run: |\n # Check workflow action pinning (SHA vs version tag)\n for wf in .github/workflows/*.yml; do\n UNPINNED", "metrics": { "length": 1072, "commands": 2, "command_list": [ "mkdir -p .github/workflows", "touch .github/workflows/security-advisory-checks.yml" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF (cloudflare-email-worker-registration-trap)", "condition": "with_lesson", "status": 200, "content": "根据给出的错误信息和解决方案,以下是针对每个错误的具体修复方案和命令:\n\n**错误1:message.text 不存在**\n\n修复: 需要从 `message.raw` 流式读取和解码邮件内容。\n\n命令:\n```bash\necho \"Lesson: Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF\n修复: \n 1. 修改 Worker 代码:\njavascript\nlet rawText = '';\nconst reader = message.raw.getReader();\nconst decoder = new TextDecoder();\nwhile (true) {\n const { done, value } = await reader.read();\n if (done) break;\n rawText += decoder.decode(value, { stream: true });\n}\nmessage.text = rawText;\n\"\n```\n\n**错误2:Node.js crypto 模块不可用**\n\n修复: 使用 Web Crypto API 代替 Node.js crypto 模块。\n\n命令:\n```bash\necho \"Lesson: Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF\n修复: \n 1. 修改 Worker 代码:\njavascript\nconst array = new Uint8Array(16);\ncrypto.getRandomValues(array);\n", "metrics": { "length": 742, "commands": 14, "command_list": [ "echo \"Lesson: Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF", "修复:", "1. 修改 Worker 代码:", "javascript", "let rawText = '';" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF (cloudflare-email-worker-registration-trap)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to Cloudflare Email Worker registration. This issue typically arises when the email server is not configured correctly, causing the registration process to fail.\n\nHere's a step-by-step guide to resolve this issue:\n\n**Step 1: Check your SPF record**\n\n1. Log in to your Cloudflare account.\n2. Go to the \"DNS\" tab.\n3. Click on \"Add a record\" and select \"TXT\" as the record type.\n4. Create a new record with the following settings:\n\t* Name: `_spf`\n\t* Type: TXT\n\t* Content: \"v=spf1 include:cloudflare.com -all\"\n\t* TTL: 1 hour (or lower if you prefer a shorter TTL)\n5. Click \"Add\" to save the changes.\n\n**Step 2: Verify your DKIM record**\n\n1. Log in to your Cloudflare account.\n2. Go to the \"DNS\" tab.\n3. Click on \"Add a record\" and select \"TXT\" as the record type.\n4. Create a new record with the following settings:\n\t* Name: `_dkim`\n\t* Type: TXT\n\t* Content: \"v=DKIM1; k=rsa;", "metrics": { "length": 911, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Claude Code can debug low-level cryptography — ML-DSA signature verification (claude-code-debugging-ml-dsa-cryptography)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with the ML-DSA signature verification, follow these steps:\n\n### Step 1: Refactor `w1Encode` Function\n\nModify the `w1Encode` function to accept pre-computed high bits as input. Change the function signature from:\n```go\nfunc w1Encode(w []poly) []poly { ... }\n```\nto:\n```go\nfunc w1Encode(highBits []poly) []poly { ... }\n```\nUpdate the function implementation to use the provided `highBits` instead of computing them internally.\n\n### Step 2: Update `Sign` Path\n\nNo changes are needed in the `Sign` path, as it is already working correctly. The `w1Encode` function is called with the correct high bits computed by `highBits(w)`.\n\n### Step 3: Update `Verify` Path\n\nIn the `Verify` path, pass the pre-computed high bits from `UseHint` to the refactored `w1Encode` function:\n```go\nhighBits := UseHint(...)\nw1Encoded := w1Encode(highBits)\n```\n### Step 4: Test and Verify\n\nWrite a hypothesis test to reimplement half of the verification process and confirm that the fix resolves the issue. Run", "metrics": { "length": 1001, "commands": 4, "command_list": [ "to:", "Update the function implementation to use the provided `highBits` instead of computing them internally.", "No changes are needed in the `Sign` path, as it is already working correctly. The `w1Encode` function is called with the correct high bits computed by `highBits(w)`.", "In the `Verify` path, pass the pre-computed high bits from `UseHint` to the refactored `w1Encode` function:" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Claude Code can debug low-level cryptography — ML-DSA signature verification (claude-code-debugging-ml-dsa-cryptography)", "condition": "plain", "status": 200, "content": "To debug low-level cryptography issues, specifically with ML-DSA signature verification, follow these steps. This guide assumes you're working in a Python environment, given the nature of the task. If you're using a different language, the principles will be similar, but the commands and libraries will differ.\n\n### Step 1: Ensure Correct Libraries Are Installed\n\nFirst, make sure you have the necessary libraries installed. For cryptographic operations in Python, `cryptography` is a powerful library.\n\n```bash\npip install cryptography\n```\n\n### Step 2: Review Your Code\n\nEnsure your code for generating and verifying ML-DSA signatures is correct. Here's a simplified example of how to generate and verify a signature using the `cryptography` library with DSA (which is similar to ML-DSA in concept, but note that ML-DSA might require specific implementations not directly available in standard libraries):\n\n```python\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.hazmat.primitives.asymmetric import dsa\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric import padding\n\n# Generate a new DSA key pair\nprivate_key = dsa.generate_private_key(\n key_size=2048,\n)\n\n# Get the", "metrics": { "length": 1248, "commands": 1, "command_list": [ "pip install cryptography" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Worker Programmatic Deploy: Three Pitfalls — Sandbox Egress, 32KB (cloudflare-worker-deploy-three-pitfalls)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the Cloudflare Worker Programmatic Deploy issue using Bash script.\n\n**Step 1: Create a new Cloudflare Worker**\n\nFirst, create a new Cloudflare Worker. You can do this by navigating to your Cloudflare dashboard, going to Workers, and clicking on the \"Create Worker\" button.\n\n**Step 2: Write the Bash script**\n\nNext, write a Bash script that will handle the deployment of your Worker. Here's an example script:\n\n```bash\n#!/bin/bash\n\n# Set your Cloudflare account ID and Worker name\nACCOUNT_ID=\"your_account_id\"\nWORKER_NAME=\"your_worker_name\"\n\n# Set the namespace and key for your KV store\nNAMESPACE=\"your_namespace\"\nKEY=\"your_key\"\n\n# Set the GitHub repository URL and branch\nREPO_URL=\"https://raw.githubusercontent.com/your-repo/your-branch/main/your-worker.js\"\nBRANCH=\"main\"\n\n# Set the chunk size for base64 encoding\nCHUNK_SIZE=24 * 1024\n\n# Base64 encode the Worker code and chunk it\nencoded_code=$(echo -n \"$(cat your-worker.js)\" | base64)\nchunks=()\nwhile [ ${#encoded_code} -gt $CHUNK_SIZE ]; do\n ", "metrics": { "length": 1036, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Worker Programmatic Deploy: Three Pitfalls — Sandbox Egress, 32KB (cloudflare-worker-deploy-three-pitfalls)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the Cloudflare Worker's sandbox egress limitation. To overcome this limitation, you'll need to update your worker to use a more efficient method of accessing external resources.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Update your worker to use `fetch` instead of `XMLHttpRequest`**\n\nReplace any occurrences of `XMLHttpRequest` with `fetch` in your worker code. This will help Cloudflare's workers to handle external requests more efficiently.\n\nFor example:\n```javascript\n// Before\nXMLHttpRequest({\n method: 'GET',\n url: 'https://example.com/api/data'\n}).on('load', function() {\n // Process the response\n});\n\n// After\nfetch('https://example.com/api/data')\n .then(response => response.json())\n .then(data => {\n // Process the response\n });\n```\n\n**Step 2: Use `fetch` with the `cache` option set to `false`**\n\nSet the `cache` option to `false` when making external requests using `fetch`. This will prevent the worker from caching the response, which is necessary to avoid the sandbox egress limitation.\n\nFor example:\n```javascript\nfetch('https://example.com/api", "metrics": { "length": 1139, "commands": 3, "command_list": [ "**Step 2: Use `fetch` with the `cache` option set to `false`**", "Set the `cache` option to `false` when making external requests using `fetch`. This will prevent the worker from caching the response, which is necessary to avoid the sandbox egress limitation.", "For example:" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF (cloudflare-email-worker-registration-trap)", "condition": "plain", "status": 200, "content": "To address the issues related to `message.raw`, MIME, and SPF in the context of a Cloudflare Email Worker, especially when dealing with email registration, follow these concrete steps. Note that the specific commands might vary slightly depending on your exact setup and requirements.\n\n### 1. Handling `message.raw`\n\nWhen dealing with `message.raw`, you're likely trying to access the raw content of an email message. Cloudflare Workers provide a `Request` object that can be used to parse incoming requests, including emails. However, directly accessing `message.raw` might not be straightforward due to how Cloudflare handles email messages.\n\n**Actionable Fix:**\n\nEnsure you're correctly parsing the email message. If you're trying to access the raw email content, consider the following example in your worker script:\n\n```javascript\naddEventListener('fetch', (event) => {\n event.respondWith(handleRequest(event.request))\n})\n\nasync function handleRequest(request) {\n const { headers, body } = request;\n // Ensure you're handling the email content correctly\n const emailContent = await request.arrayBuffer();\n const decoder = new TextDecoder('utf-8');\n const emailRaw = decoder.decode(emailContent);\n\n // Process emailRaw as needed\n console.log(emailRaw);\n\n ", "metrics": { "length": 1267, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Dismiss CodeQL False Positive Alerts (codeql-alert-dismissal-false-positive)", "condition": "with_lesson", "status": 200, "content": "To dismiss a false positive alert in CodeQL, you'll need to use the GitHub API to update the alert's state. Here's a step-by-step guide:\n\n1. **Get the alert ID**: First, find the ID of the alert you want to dismiss. You can do this by listing all alerts for your repository using the CodeQL API.\n\n ```bash\ncurl -s -X GET \\\n -H \"Authorization: token $TOKEN\" \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/Ikalus1988/MisakaNet/code-scanning/alerts\n```\n\n This command will return a JSON response with a list of alerts. Look for the `id` field in the response.\n\n2. **Dismiss the alert**: Once you have the alert ID, you can use the `PATCH` endpoint to dismiss the alert.\n\n ```bash\ncurl -s -X PATCH \\\n -H \"Authorization: token $TOKEN\" \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/Ikalus1988/MisakaNet/code-scanning/alerts/ \\\n -d '{\n \"state", "metrics": { "length": 926, "commands": 4, "command_list": [ "curl -s -X GET \\", "-H \"Authorization: token $TOKEN\" \\", "-H \"Accept: application/vnd.github.v3+json\" \\", "https://api.github.com/repos/Ikalus1988/MisakaNet/code-scanning/alerts" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 1, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cloudflare Worker Programmatic Deploy: Three Pitfalls — Sandbox Egress, 32KB (cloudflare-worker-deploy-three-pitfalls)", "condition": "with_lesson", "status": 200, "content": "To address the three pitfalls encountered when deploying large modular Workers via Cloudflare MCP execute, follow these concrete, actionable steps. This solution involves base64 encoding and chunking your code, storing it in a Cloudflare KV namespace, reassembling the code, and then uploading it to Cloudflare Workers using the correct multipart/form-data format.\n\n### Step 1: Base64 Encode and Chunk Your Code\n\nFirst, you need to base64 encode your Worker code and split it into chunks of 24KB or less. You can use the following command to encode your code:\n\n```bash\nbase64 your-worker-code.js > encoded-worker-code.txt\n```\n\nThen, you'll need to split this encoded file into chunks. You can use a tool like `split` to achieve this:\n\n```bash\nsplit -b 24KB encoded-worker-code.txt chunk-\n```\n\nThis will create multiple files named `chunk-aa`, `chunk-ab`, etc., each containing a part of your encoded Worker code.\n\n### Step 2: Store Chunks in Cloudflare KV\n\nNext, you'll store each chunk in a Cloudflare KV namespace. You'll need to use the Cloudflare API for this. First, ensure you have the `curl` command available.\n\n1. **Authenticate", "metrics": { "length": 1136, "commands": 2, "command_list": [ "base64 your-worker-code.js > encoded-worker-code.txt", "split -b 24KB encoded-worker-code.txt chunk-" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CI 测试陷阱 — 模块级副作用导致 import 失败 (ci-lambda-module-level-side-effects)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of CI testing failures due to module-level side effects when importing Lambda functions, follow these concrete steps. The goal is to avoid importing the Lambda module directly and instead analyze its source code text.\n\n### Step 1: Modify Your Test Function\n\nInstead of importing the Lambda module, you will read its source code as text and then analyze it. Replace your existing `_import_lambda_module` function with a new function named `_extract_default` that reads the source code and extracts necessary information using regular expressions.\n\n```python\nimport re\nfrom pathlib import Path\n\ndef _extract_default(source: str) -> str:\n \"\"\"\n Extracts the default value for 'EXCLUDE_CHARACTERS' from the given source code.\n \n :param source: The source code of the Lambda function as a string.\n :return: The default value as a string.\n \"\"\"\n match = re.search(\n r'''os\\.environ\\.get\\(\\s[\"']EXCLUDE_CHARACTERS[\"']\\s,\\s(['\"])((?:[^\\\\]|\\\\.)?)\\1''',\n source,\n )\n return match.group(2) if match else None\n\n# Example usage\nsource_path = Path(\"lambda\") / \"index.py\"\nsource", "metrics": { "length": 1119, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cloudflare Email Worker 邮件注册踩坑Notes — message.raw、MIME 与 SPF (cloudflare-email-worker-registration-trap)", "condition": "with_lesson", "status": 200, "content": "To address the issues encountered with the Cloudflare Email Worker registration process, follow these concrete and actionable fixes:\n\n### Fix for 坑1:message.text 不存在\n\nTo read the email content from `message.raw`, use the following JavaScript code:\n\n```javascript\nlet rawText = '';\nconst reader = message.raw.getReader();\nconst decoder = new TextDecoder();\nwhile (true) {\n const { done, value } = await reader.read();\n if (done) break;\n rawText += decoder.decode(value, { stream: true });\n}\nconsole.log(rawText); // This will log the email content\n```\n\n### Fix for 坑2:Node.js crypto 模块不可用\n\nReplace the `node:crypto` import with the Web Crypto API. To generate a random token, use:\n\n```javascript\nconst array = new Uint8Array(16);\ncrypto.getRandomValues(array);\nconst token = Array.from(array, b => b.toString(16).padStart(2, '0')).join('');\nconsole.log(token); // This will log a random token\n```\n\n### Fix for 坑3:回复邮件被 QQ/163/ Foxmail 拒收\n\nTo avoid email rejection due to SPF issues, modify your registration process to not", "metrics": { "length": 1024, "commands": 1, "command_list": [ "Replace the `node:crypto` import with the Web Crypto API. To generate a random token, use:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cloudflare Worker Programmatic Deploy: Three Pitfalls — Sandbox Egress, 32KB (cloudflare-worker-deploy-three-pitfalls)", "condition": "plain", "status": 200, "content": "The article \"Cloudflare Worker Programmatic Deploy: Three Pitfalls — Sandbox Egress, 32KB\" highlights common issues encountered when deploying Cloudflare Workers programmatically. To address these pitfalls, particularly the 32KB limit and sandbox egress issues, follow these concrete steps. Note that these instructions assume you have a basic understanding of Cloudflare Workers, Node.js, and npm.\n\n### 1. Minifying Your Worker Code\n\nTo avoid hitting the 32KB limit, minify your worker code. You can use tools like `terser` or `uglify-js` for this purpose.\n\nFirst, install `terser` as a development dependency in your project:\n\n```bash\nnpm install terser --save-dev\n```\n\nThen, you can minify your worker code using the following command. Replace `worker.js` with the path to your worker script and `minified-worker.js` with the desired output path:\n\n```bash\nnpx terser worker.js -o minified-worker.js\n```\n\n### 2. Handling Sandbox Egress\n\nFor sandbox egress issues, ensure that your worker is correctly configured to handle external requests. If your worker needs to fetch data from external sources, you might need to adjust the `fetch` calls to comply with", "metrics": { "length": 1158, "commands": 2, "command_list": [ "npm install terser --save-dev", "npx terser worker.js -o minified-worker.js" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Dismiss CodeQL False Positive Alerts (codeql-alert-dismissal-false-positive)", "condition": "plain", "status": 200, "content": "The error \"Dismiss CodeQL False Positive Alerts (codeql-alert-dismissal-f false-positive)\" typically occurs when the CodeQL engine is incorrectly identifying certain alerts as false positives and suggesting that they be dismissed. Here's a concrete, actionable fix to resolve this issue:\n\n**Step 1: Update CodeQL**\n\nFirst, you need to update CodeQL to the latest version. You can do this by running the following command in your terminal:\n\n```bash\ngit pull https://github.com/github/codeql codeql\n```\n\n**Step 2: Re-run the CodeQL analysis**\n\nAfter updating CodeQL, re-run the analysis to ensure that the issue is resolved:\n\n```bash\ncodeql analyze --output /path/to/output --ruleset /path/to/ruleset\n```\n\nReplace `/path/to/output` and `/path/to/ruleset` with the actual paths to your output directory and ruleset file, respectively.\n\n**Step 3: Check the CodeQL configuration**\n\nIf the issue persists, check the CodeQL configuration file (`codeql.yml` or `codeql.json`) for any incorrect settings. You can do this by running the following command:\n\n```bash\ncodeql config --list\n```\n\nThis will display the current CodeQL configuration. Review the configuration", "metrics": { "length": 1157, "commands": 3, "command_list": [ "git pull https://github.com/github/codeql codeql", "codeql analyze --output /path/to/output --ruleset /path/to/ruleset", "codeql config --list" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cross-Repo Contribution Strategy — Finding and Contributing to New Repos (cross-repo-contribution-strategy)", "condition": "with_lesson", "status": 200, "content": "Based on the provided lesson, it seems like the error is related to the \"pr-strategy.md\" file and the \"maintainer\" label. Here's a concrete, actionable fix with exact commands:\n\n1. Check if PR would pass review before submitting:\n\n```bash\npython3 skill/pr_genius.py coach \"feat: add feature\" --repo org/repo --body \"Fixes 123\"\n```\n\n2. Look for Repos with These Signals:\n\nYou can use the following command to check for good first issue labels, help wanted labels, recent merged PRs from external contributors, and active maintainer responses:\n\n```bash\ngit clone https://github.com/org/repo.git\ncd repo\ngit log --format=%an --since=30days\ngit log --format=%an --since=30days --author=external\ngit log --format=%an --since=30days --author=external --author=external\ngit log --format=%an --since=30days --author=external --author=external --author=external\n```\n\n3. Avoid These Red Flags:\n\nYou can use the following command to check for no CONTRIBUTING.md files:\n\n```bash\ngit ls-files CONTRIBUTING.md\n```\n\nIf the file is not found", "metrics": { "length": 1025, "commands": 8, "command_list": [ "python3 skill/pr_genius.py coach \"feat: add feature\" --repo org/repo --body \"Fixes 123\"", "git clone https://github.com/org/repo.git", "cd repo", "git log --format=%an --since=30days", "git log --format=%an --since=30days --author=external" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cross-Repo Contribution Strategy — Finding and Contributing to New Repos (cross-repo-contribution-strategy)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the fact that the `cross-repo-contribution-strategy` repository is private, and you're trying to contribute to it directly from your local repository.\n\nTo fix this issue, you'll need to create a fork of the `cross-repo-contribution-strategy` repository, then submit a pull request to the original repository. Here's a step-by-step guide with exact commands:\n\n### Step 1: Create a fork of the `cross-repo-contribution-strategy` repository\n\n1. Open a terminal or command prompt.\n2. Navigate to your local repository where you want to make the contribution.\n3. Run the following command to create a fork of the `cross-repo-contribution-strategy` repository:\n\n```bash\ngit fork https://github.com/github/cross-repo-contribution-strategy.git my-fork\n```\n\nReplace `my-fork` with a name of your choice for your forked repository.\n\n### Step 2: Clone your forked repository\n\n1. Clone your forked repository to your local machine:\n\n```bash\ngit clone https://github.com/your-username/my-fork.git\n```\n\nReplace `your-username` with the actual username of the owner of your fork", "metrics": { "length": 1110, "commands": 2, "command_list": [ "git fork https://github.com/github/cross-repo-contribution-strategy.git my-fork", "git clone https://github.com/your-username/my-fork.git" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀 (cross-sheet-name-merge-data-chaos)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the error you're encountering:\n\n**Step 1: Update the `robot_id` column with the correct prefix**\n\nReplace the following code in your loop:\n\n```python\ndf['robot_id'] = df['robotName']\n```\n\nwith the following code:\n\n```python\ndf['robot_id'] = sheet_name + '_' + df['robotName']\n```\n\nThis will add the sheet name prefix to the `robot_id` column.\n\n**Step 2: Update the `groupby` aggregation**\n\nReplace the following line in your `groupby` aggregation:\n\n```python\nresult = pd.concat(all_data).groupby('robotName').agg(...)\n```\n\nwith the following line:\n\n```python\nresult = pd.concat(all_data).groupby('robot_id').agg(...)\n```\n\nThis will use the `robot_id` column as the key for grouping instead of `robotName`.\n\nHere's the updated code:\n\n```python\nfor sheet_name, df in sheets.items():\n df['robot_id'] = sheet_name + '_' + df['robotName']\n all_data.append(df)\nresult = pd.concat(all_data).groupby('robot_id').agg(...)\n```\n\n**Step 3: Verify the fix**\n\nRun the following", "metrics": { "length": 1007, "commands": 7, "command_list": [ "with the following code:", "This will add the sheet name prefix to the `robot_id` column.", "**Step 2: Update the `groupby` aggregation**", "Replace the following line in your `groupby` aggregation:", "with the following line:" ], "has_command_block": true, "actionable": true, "inline_code_count": 15, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀 (cross-sheet-name-merge-data-chaos)", "condition": "plain", "status": 200, "content": "The error message you're encountering, \"跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀\" which translates to \"Cross sheet name merge data chaos: Robot unique identifier must have a prefix,\" typically occurs when you're trying to merge data from multiple sheets in a spreadsheet using a script or macro that doesn't properly handle unique identifiers.\n\nTo fix this issue, you'll need to ensure that each unique identifier (e.g., employee IDs, order numbers, etc.) is prefixed with the sheet name or a unique identifier for each sheet. Here's an example of how you can modify your script or macro to achieve this:\n\n### For Google Sheets using Google Apps Script\n\nLet's assume you have a script that merges data from multiple sheets and doesn't handle unique identifiers correctly. You can modify it as follows:\n\n```javascript\nfunction mergeData() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sourceSheets = ['Sheet1', 'Sheet2', 'Sheet3']; // List of source sheets\n \n // Create an object to store data from each sheet\n var data = {};\n sourceSheets.forEach(function(sheetName) {\n var sheet = ss.getSheetByName(sheetName);\n var range =", "metrics": { "length": 1137, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Dismiss CodeQL False Positive Alerts (codeql-alert-dismissal-false-positive)", "condition": "plain", "status": 200, "content": "To dismiss CodeQL false positive alerts, you'll need to use the CodeQL command-line interface. Here's a step-by-step fix:\n\n**Prerequisites:**\n\n1. Ensure you have CodeQL installed and configured on your system.\n2. Familiarize yourself with the CodeQL command-line interface.\n\n**Dismiss False Positive Alerts:**\n\n1. **Identify the alert ID**: First, you need to identify the ID of the false positive alert you want to dismiss. You can do this by running the following command:\n```bash\ncodeql database analyze --search-path /path/to/your/code --format=csv --output=alerts.csv\n```\nThis command will generate a CSV file (`alerts.csv`) containing all the alerts, including their IDs.\n\n2. **Open the CSV file**: Open the `alerts.csv` file and find the ID of the false positive alert you want to dismiss.\n\n3. **Dismiss the alert**: Run the following command to dismiss the false positive alert:\n```bash\ncodeql alert dismiss --alert-id --database /path/to/your/codeql/database\n```\nReplace `` with the actual ID of the false positive alert you want to dismiss.\n\n**Example:**\n```bash\ncodeql alert", "metrics": { "length": 1106, "commands": 2, "command_list": [ "codeql database analyze --search-path /path/to/your/code --format=csv --output=alerts.csv", "codeql alert dismiss --alert-id --database /path/to/your/codeql/database" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cross-Repo Contribution Strategy — Finding and Contributing to New Repos (cross-repo-contribution-strategy)", "condition": "plain", "status": 200, "content": "To address the issue of implementing a cross-repo contribution strategy for finding and contributing to new repositories, follow these steps. This guide assumes you are using Git for version control and have a GitHub account, as it's one of the most common platforms for open-source contributions.\n\n### Step 1: Identify Repositories to Contribute To\n\n1. **Use GitHub's Explore Page**: Start by visiting GitHub's Explore page (https://github.com/explore) to find trending repositories or topics that interest you.\n2. **Search for Repositories**: Use GitHub's search bar to find repositories related to your interests or skills. For example, if you're interested in contributing to Python projects, you can search for `language:Python`.\n\n### Step 2: Evaluate a Repository\n\nBefore contributing, evaluate the repository by checking:\n\n1. **Star and Fork Count**: A higher number indicates the project is more popular and possibly more maintained.\n2. **Issues and Pull Requests**: Look at the issues tab to see if there are open issues you can work on. Also, check the pull requests tab to see how active the maintainers are in reviewing and merging contributions.\n3. **README and CONTRIBUTING Files**: These files usually contain information on how to contribute to the project, including setup", "metrics": { "length": 1289, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CSS z-index Not Working — Stacking Context Inversion in Modal Overlays (css-z-index-stacking-context-modal)", "condition": "with_lesson", "status": 200, "content": "The problem arises from the fact that the parent element with `transform: translateX(...)` creates a new stacking context, which overrides the `z-index` of the modal overlay. To fix this issue, you can use the `will-change` property to force the browser to create a new stacking context for the modal overlay, or you can use the `z-index` property on the parent element that contains the modal overlay, but with a value that is higher than the modal overlay's `z-index`. Here's an example of how you can do it:\n\n```css\n/* Make the parent element with transform create a new stacking context */\n.sidebar {\n position: relative;\n transform: translateX(0);\n will-change: transform; /* Add this line */\n z-index: 1000; /* Increase the z-index of the parent */\n}\n\n/* Make the modal overlay appear on top of the parent */\n.modal-overlay {\n position: fixed;\n z-index: 9999;\n}\n\n/* Make the modal content appear on top of the modal overlay */\n.modal-content {\n position: relative;\n z-index: 10000;\n}\n```\n\nAlternatively, you can also use the `z-index` property on the parent element that contains the modal overlay, but", "metrics": { "length": 1116, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 7, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Dismiss CodeQL False Positive Alerts (codeql-alert-dismissal-false-positive)", "condition": "with_lesson", "status": 200, "content": "To dismiss a CodeQL false positive alert, you will need to use the GitHub API to update the alert's state. Here's a step-by-step guide:\n\n1. **Find the Alert ID**: First, you need to identify the ID of the alert you want to dismiss. You can find this by listing all open alerts using the GitHub API. Replace `YOUR_REPO_OWNER` and `YOUR_REPO_NAME` with your actual repository owner and name, and `YOUR_TOKEN` with your GitHub personal access token.\n\n ```bash\n curl -s -X GET \\\n -H \"Authorization: token YOUR_TOKEN\" \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/YOUR_REPO_OWNER/YOUR_REPO_NAME/code-scanning/alerts\n ```\n\n This command will list all code scanning alerts, including their IDs.\n\n2. **Dismiss the Alert**: Once you have the ID of the alert you want to dismiss, you can use the following command to dismiss it. Replace `ALERT_ID` with the actual ID of the alert, and adjust the `dismissed_comment` to explain why the alert is a false positive.\n\n ```bash\n curl -s -X PATCH \\\n -H \"", "metrics": { "length": 1058, "commands": 4, "command_list": [ "curl -s -X GET \\", "-H \"Authorization: token YOUR_TOKEN\" \\", "-H \"Accept: application/vnd.github.v3+json\" \\", "https://api.github.com/repos/YOUR_REPO_OWNER/YOUR_REPO_NAME/code-scanning/alerts" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CSS z-index Not Working — Stacking Context Inversion in Modal Overlays (css-z-index-stacking-context-modal)", "condition": "plain", "status": 200, "content": "The CSS z-index not working issue can be caused by the stacking context inversion in modal overlays. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Add `position: relative` to the modal container**\n\nAdd the following CSS rule to your modal container:\n```css\n.modal-container {\n position: relative;\n}\n```\nThis sets the modal container to be a positioning context, allowing you to control its z-index.\n\n**Step 2: Add `position: relative` to the overlay**\n\nAdd the following CSS rule to your overlay:\n```css\n.overlay {\n position: relative;\n z-index: 1000; /* adjust the z-index as needed */\n}\n```\nThis sets the overlay to be a positioning context and sets its initial z-index to a high value.\n\n**Step 3: Add `z-index` to the modal content**\n\nAdd the following CSS rule to your modal content:\n```css\n.modal-content {\n z-index: 1001; /* adjust the z-index as needed */\n}\n```\nThis sets the modal content's z-index to a higher value than the overlay, ensuring it appears on top of the overlay.\n\n**Step 4: Adjust the z-index of other elements**\n\nIf you have other elements on", "metrics": { "length": 1090, "commands": 6, "command_list": [ "This sets the modal container to be a positioning context, allowing you to control its z-index.", "**Step 2: Add `position: relative` to the overlay**", "Add the following CSS rule to your overlay:", "This sets the overlay to be a positioning context and sets its initial z-index to a high value.", "**Step 3: Add `z-index` to the modal content**" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀 (cross-sheet-name-merge-data-chaos)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of cross-sheet name merge data chaos, you need to ensure that each robot has a unique identifier that includes the sheet prefix. Here's a step-by-step solution:\n\n### Step 1: Modify the Data Import Process\n\nWhen reading data from multiple sheets, add a prefix to the `robotName` field that includes the sheet name. This will create a unique identifier for each robot across all sheets.\n\n```python\nimport pandas as pd\n\n# Assuming 'sheets' is a dictionary where keys are sheet names and values are DataFrames\nall_data = []\nfor sheet_name, df in sheets.items():\n # Create a new column 'robot_id' that combines the sheet name and robotName\n df['robot_id'] = sheet_name + '_' + df['robotName']\n all_data.append(df)\n\n# Concatenate all DataFrames into one\nresult = pd.concat(all_data)\n```\n\n### Step 2: Use the New Unique Identifier for Grouping\n\nWhen performing aggregation operations, use the `robot_id` column as the key instead of `robotName`. This ensures that robots from different sheets are not merged incorrectly.\n\n```python\n# Group by the new 'robot_id' column and perform aggregation\naggregated_result = result.groupby('robot", "metrics": { "length": 1153, "commands": 1, "command_list": [ "When performing aggregation operations, use the `robot_id` column as the key instead of `robotName`. This ensures that robots from different sheets are not merged incorrectly." ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "Cross-Repo Contribution Strategy — Finding and Contributing to New Repos (cross-repo-contribution-strategy)", "condition": "with_lesson", "status": 200, "content": "To address the issue of finding and contributing to new repositories effectively, follow these concrete steps:\n\n### Step 1: Evaluate Before Contributing\n\nFirst, ensure that your potential contribution would pass review before submitting it. You can use a tool like `Coach` to evaluate your pull request (PR) beforehand.\n\n```bash\npython3 skill/pr_genius.py coach \"feat: add feature\" --repo org/repo --body \"Fixes 123\"\n```\n\nReplace `\"feat: add feature\"` with your feature description, `org/repo` with the target repository, and `\"Fixes 123\"` with your actual commit body or issue reference.\n\n### Step 2: Identify Promising Repositories\n\nLook for repositories with signals that indicate they are open to contributions:\n\n1. **Good First Issue Label**: Indicates the maintainer wants new contributors.\n2. **Help Wanted Label**: Shows an active need for contributions.\n3. **Recent Merged PRs from External Contributors**: Indicates a proven track record of accepting external contributions.\n4. **Active Maintainer Responses**: Suggests you will get feedback on your contributions.\n\nYou can search for these signals on GitHub using the search bar with keywords like `org/repo is:issue label:\"good first issue\"` or `", "metrics": { "length": 1208, "commands": 1, "command_list": [ "python3 skill/pr_genius.py coach \"feat: add feature\" --repo org/repo --body \"Fixes 123\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "curl / wget 请求失败通用Diagnosis (curl-request-troubleshoot)", "condition": "with_lesson", "status": 200, "content": "根据给出的错误信息和解决方案,下面是一些具体的解决方案和命令:\n\n1. 检查 DNS 问题:\n - 使用 `nslookup` 检查 DNS 问题:\n ```bash\nnslookup example.com\n```\n - 如果返回 NXDOMAIN,表示 DNS 问题。需要检查 `/etc/resolv.conf` 和 DNS 服务是否正常工作。\n\n2. 检查网络连通性:\n - 使用 `curl -v --noproxy \"\" https://example.com` 检查网络连通性:\n ```bash\ncurl -v --noproxy \"\" https://example.com\n```\n - 如果返回超时,可能是防火墙或代理问题。\n\n3. 检查证书问题:\n - 使用 `curl -v https://example.com` 检查证书问题:\n ```bash\ncurl -v https://example.com\n```\n - 如果返回 SSL 证书问题,需要检查证书是否过期或自签。\n\n - 临时跳过 SSL 证书验证:\n ```bash\ncurl -k https://example.com\n```\n - **注意:** 这个选项不建议在生产", "metrics": { "length": 566, "commands": 4, "command_list": [ "nslookup example.com", "curl -v --noproxy \"\" https://example.com", "curl -v https://example.com", "curl -k https://example.com" ], "has_command_block": true, "actionable": false, "inline_code_count": 11, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "curl / wget 请求失败通用Diagnosis (curl-request-troubleshoot)", "condition": "plain", "status": 200, "content": "The error \"curl-request-troubleshoot\" typically indicates a problem with the curl request. Here are a few common causes and solutions:\n\n**Cause 1: Insufficient permissions**\n\n* Cause: The curl command is not executed with sufficient permissions.\n* Solution:\n\n ```bash\n# For Linux and macOS\nsudo curl -o output.txt https://example.com\n\n# For Windows\ncurl.exe -o output.txt https://example.com\n```\n\n**Cause 2: Proxy issues**\n\n* Cause: The curl request is being blocked by a proxy.\n* Solution:\n\n ```bash\n# Set the proxy environment variable\nexport HTTP_PROXY=http://your-proxy:8080\nexport HTTPS_PROXY=http://your-proxy:8080\n\n# Run the curl command\ncurl -o output.txt https://example.com\n```\n\n**Cause 3: SSL verification issues**\n\n* Cause: The curl request is having trouble verifying the SSL certificate.\n* Solution:\n\n ```bash\n# Disable SSL verification\ncurl -k -o output.txt https://example.com\n\n# Verify the SSL certificate\ncurl --cert-type PEM --cacert /path/to/ca.crt --key /path/to/your-key.pem https://example.com\n```\n\n**Cause 4: Connection timeout**\n\n*", "metrics": { "length": 1059, "commands": 7, "command_list": [ "sudo curl -o output.txt https://example.com", "curl.exe -o output.txt https://example.com", "export HTTP_PROXY=http://your-proxy:8080", "export HTTPS_PROXY=http://your-proxy:8080", "curl -o output.txt https://example.com" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀 (cross-sheet-name-merge-data-chaos)", "condition": "plain", "status": 200, "content": "To address the issue of \"跨 Sheet 同名合并导致数据混乱:机器人唯一标识必须带前缀\" which translates to \"Cross-sheet same-name merge causing data chaos: Robot unique identifier must have a prefix,\" you need to ensure that each robot or entity across different sheets has a unique identifier that includes a prefix to avoid confusion. Here’s a step-by-step guide to fix this issue, assuming you are working with Excel or a similar spreadsheet program:\n\n### Step 1: Identify the Sheets and Data\n1. **Open your spreadsheet**: Go to the file that contains the sheets with the merging issue.\n2. **List all sheets**: Note down the names of all sheets involved in the merge.\n\n### Step 2: Standardize Unique Identifiers\n1. **Choose a prefix format**: Decide on a prefix format for each sheet. For example, if you have sheets named \"RobotData1\", \"RobotData2\", etc., you could use \"RD1_\", \"RD2_\", etc., as prefixes.\n2. **Apply prefixes**: Go through each sheet and add the corresponding prefix to the unique identifier of each robot or entity. You can do this manually or use a formula.\n\n### Manual Method:\n- **Select the cell", "metrics": { "length": 1090, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "CSS z-index Not Working — Stacking Context Inversion in Modal Overlays (css-z-index-stacking-context-modal)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of the modal overlay being hidden behind another page element due to a stacking context inversion, you need to ensure that the modal overlay is placed outside of any stacking context that could interfere with its visibility. Here's a step-by-step solution:\n\n### 1. Move the Modal Overlay Outside of the Interfering Stacking Context\n\nFirst, you need to move the `.modal-overlay` element outside of the `.sidebar` element that has a `transform` property applied, which creates a new stacking context. Ideally, the `.modal-overlay` should be a direct child of the `body` element to ensure it's at the root level of the stacking context.\n\n```html\n\n \n
\n \n
\n
\n \n
\n \n
\n
\n \n
\n \n
\n Advanced Settings.\n2. Look for the \"Cache Cleanup\" or \"Disk Space Cleanup\" option and select it.\n3. Choose the frequency for the cache cleanup (e.g., \"Daily\" or \"Weekly\").\n4. Click \"Apply\"", "metrics": { "length": 1036, "commands": 1, "command_list": [ "rm -rf chroma_db_v4_cache/*" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "curl / wget 请求失败通用Diagnosis (curl-request-troubleshoot)", "condition": "with_lesson", "status": 200, "content": "To troubleshoot the `curl` request failure, follow these steps with exact commands:\n\n### 1. Check DNS Resolution\n\nFirst, ensure that the domain name can be resolved to an IP address. You can use `nslookup` or `dig` for this:\n\n```bash\nnslookup example.com\n```\nor\n```bash\ndig example.com\n```\n\nIf the domain resolves correctly, you should see an IP address returned. If not, you may have a DNS issue.\n\n### 2. Check Network Connectivity (Bypassing Proxy)\n\nTry connecting to the server without using a proxy to see if the issue is related to your proxy settings:\n\n```bash\ncurl -v --noproxy \"\" https://example.com\n```\n\nIf this command can connect but times out, it might indicate a firewall or proxy issue.\n\n### 3. Check Certificate Validation\n\nCertificate issues can cause `curl` to fail. Check the certificate validation:\n\n```bash\ncurl -v https://example.com\n```\n\nIf you encounter an SSL certificate problem, you can temporarily bypass certificate validation for testing purposes (not recommended for production):\n\n```bash\ncurl -k https://example.com\n```\n\n### 4. Check Proxy Settings\n\nView your current proxy settings:\n\n```", "metrics": { "length": 1119, "commands": 5, "command_list": [ "nslookup example.com", "dig example.com", "curl -v --noproxy \"\" https://example.com", "curl -v https://example.com", "curl -k https://example.com" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Erreur de permission Docker: permission denied sur /var/run/docker.sock (erreur-permission-docker-linux)", "condition": "with_lesson", "status": 200, "content": "To fix the \"permission denied\" error when trying to run Docker commands on Linux, follow these steps:\n\n**Step 1: Check if the docker group exists**\n\nOpen a terminal and run the following command to check if the docker group exists:\n\n```bash\ngrep docker /etc/group\n```\n\nIf the group does not exist, proceed to Step 2.\n\n**Step 2: Create the docker group if it does not exist**\n\nIf the docker group does not exist, create it using the following command:\n\n```bash\nsudo groupadd docker\n```\n\n**Step 3: Add your user to the docker group**\n\nAdd your user to the docker group using the following command:\n\n```bash\nsudo usermod -aG docker $USER\n```\n\nReplace `$USER` with your actual username.\n\n**Step 4: Activate the group change**\n\nLog out of your current session and log back in. Alternatively, you can run the following command to activate the group change:\n\n```bash\nnewgrp docker\n```\n\n**Step 5: Verify the fix (optional)**\n\nIf you want to verify that the fix was successful, run the following command:\n\n```bash\ngrep docker /etc/group\n```\n\nIf the fix was successful, the output should indicate that", "metrics": { "length": 1091, "commands": 5, "command_list": [ "grep docker /etc/group", "sudo groupadd docker", "sudo usermod -aG docker $USER", "newgrp docker", "grep docker /etc/group" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "DCO Signoff Lost During Force Push (dco-signoff-force-push-pitfall)", "condition": "plain", "status": 200, "content": "To fix the \"DCO Signoff Lost During Force Push\" issue, you can follow these steps. This problem occurs when you force push changes to a repository, potentially overwriting commits that included DCO (Developer Certificate of Origin) signoffs, which are crucial for verifying the origin and licensing of contributions.\n\nHere's how to handle the situation:\n\n### 1. Rebase Your Local Branch\n\nFirst, make sure you're on the branch you want to work on. Let's assume it's named `feature/new-feature`. If you've already force-pushed and lost DCO signoffs, you'll need to rebase your branch to reapply the DCO signoffs.\n\n```bash\n# Checkout your branch\ngit checkout feature/new-feature\n\n# Rebase interactively to edit commits\ngit rebase -i origin/main # Assuming 'main' is your upstream branch\n```\n\nIn the interactive rebase menu, you can choose to `edit` the commits where the DCO signoff was lost.\n\n### 2. Amend Commits to Add DCO Signoff\n\nFor each commit you want to edit, you'll amend it to add the DCO signoff. After selecting `edit` for a commit in the rebase menu, Git will pause", "metrics": { "length": 1077, "commands": 2, "command_list": [ "git checkout feature/new-feature", "git rebase -i origin/main # Assuming 'main' is your upstream branch" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "磁盘空间不足 / chroma_db_v4 CacheCleanup (disk-space-cleanup)", "condition": "with_lesson", "status": 200, "content": "To address the \"磁盘空间不足 / chroma_db_v4 CacheCleanup (disk-space-cleanup)\" error, follow these steps. The goal is to free up disk space by cleaning up unnecessary files in `chroma_db_v4`, Hugging Face cache, temporary files, and log files.\n\n### Step 1: Identify Space Occupation\n\nFirst, identify which directories are occupying the most space:\n```bash\ndu -sh ~/.hermes/ 2>/dev/null | sort -h\ndu -sh /mnt/d/Eric/知识库/chroma_db_v4/ 2>/dev/null\n```\n\n### Step 2: Clean Up `chroma_db_v4`\n\n1. **Backup `chroma_db_v4`**: Before making any changes, create a backup.\n ```bash\n cp -r /mnt/d/Eric/知识库/chroma_db_v4/ ~/chroma_db_v4_backup_$(date +%Y%m%d)\n ```\n2. **Check Versions**: List the versions of `chroma_db_v4` to decide which ones to keep.\n ```bash\n ls /mnt/d/Eric/知识库/chroma_db_v4/\n ```\n3. **Remove Old Versions**: Decide which versions", "metrics": { "length": 842, "commands": 4, "command_list": [ "du -sh ~/.hermes/ 2>/dev/null | sort -h", "du -sh /mnt/d/Eric/知识库/chroma_db_v4/ 2>/dev/null", "cp -r /mnt/d/Eric/知识库/chroma_db_v4/ ~/chroma_db_v4_backup_$(date +%Y%m%d)", "ls /mnt/d/Eric/知识库/chroma_db_v4/" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "磁盘空间不足 / chroma_db_v4 CacheCleanup (disk-space-cleanup)", "condition": "plain", "status": 200, "content": "To address the \"磁盘空间不足\" (insufficient disk space) error related to `chroma_db_v4 CacheCleanup` (disk-space-cleanup), you'll need to free up disk space. Here's a step-by-step guide to help you resolve this issue. Please note, the exact commands might vary slightly depending on your operating system (the instructions below are tailored for a Linux-based system, which is common for servers and databases).\n\n### 1. Check Available Disk Space\n\nFirst, check how much disk space is available and which partitions are running low. Open a terminal and run:\n\n```bash\ndf -h\n```\n\nThis command will show you the available disk space on your system.\n\n### 2. Identify Large Files and Directories\n\nTo find large files or directories that might be consuming a lot of space, use:\n\n```bash\nsudo du -h --max-depth=1 /\n```\n\nThis command scans the root directory and its immediate subdirectories for large files and directories. You might need to wait a bit for it to complete.\n\n### 3. Clean Up Package Cache (if applicable)\n\nIf you're using a Debian-based system (like Ubuntu), you can clean up the package cache to free up some space:\n\n```bash\nsudo", "metrics": { "length": 1131, "commands": 2, "command_list": [ "df -h", "sudo du -h --max-depth=1 /" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Erreur de permission Docker: permission denied sur /var/run/docker.sock (erreur-permission-docker-linux)", "condition": "plain", "status": 200, "content": "The error you're experiencing is due to a lack of permissions to access the Docker socket. Here's a step-by-step solution:\n\n**Step 1: Check the current permissions**\n\nRun the following command to check the current permissions of the Docker socket:\n```bash\nls -l /var/run/docker.sock\n```\nThis will display the current permissions of the socket.\n\n**Step 2: Add your user to the Docker group**\n\nTo access the Docker socket, you need to add your user to the Docker group. Run the following command:\n```bash\nsudo usermod -aG docker $USER\n```\nThis command adds your user to the Docker group.\n\n**Step 3: Log out and log back in**\n\nAfter adding your user to the Docker group, you need to log out and log back in to apply the changes.\n\n**Step 4: Verify the permissions**\n\nAfter logging back in, run the following command to verify the permissions of the Docker socket:\n```bash\nls -l /var/run/docker.sock\n```\nThis should display the updated permissions.\n\n**Step 5: Test Docker**\n\nFinally, test Docker by running the following command:\n```bash\ndocker run hello-world\n```\nThis command should run successfully if you have the necessary permissions", "metrics": { "length": 1134, "commands": 4, "command_list": [ "ls -l /var/run/docker.sock", "sudo usermod -aG docker $USER", "ls -l /var/run/docker.sock", "docker run hello-world" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Erro de push rejeitado no Git: branches divergentes e como resolver (erro-push-git-rejeitado-divergente)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the error \"branches divergentes e como resolver (erro-push-git-rejeitado-divergente)\" with exact commands:\n\n**Step 1: Pull the latest changes from the remote repository**\n\nOpen your terminal and navigate to your local repository. Run the following command to pull the latest changes from the remote repository:\n```bash\ngit pull origin main\n```\nThis command will fetch the latest changes from the remote repository and merge them into your local branch.\n\n**Step 2: Resolve any merge conflicts**\n\nIf there are any merge conflicts, Git will show you the conflicting files. Open the file in a text editor and manually resolve the conflicts. You can use a tool like `git mergetool` to help you resolve conflicts.\n\nOnce you've resolved the conflicts, add the file to the staging area and commit the changes:\n```bash\ngit add arquivo.txt\ngit commit -m \"Resolve merge conflicts with origin/main\"\n```\n**Step 3: Push the updated changes to the remote repository**\n\nNow that you've resolved any merge conflicts, you can push the updated changes to the remote repository:\n```bash\ngit push origin main\n```\nThis command will update the remote repository with your latest changes.\n\nAlternatively,", "metrics": { "length": 1218, "commands": 4, "command_list": [ "git pull origin main", "git add arquivo.txt", "git commit -m \"Resolve merge conflicts with origin/main\"", "git push origin main" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Erro de push rejeitado no Git: branches divergentes e como resolver (erro-push-git-rejeitado-divergente)", "condition": "plain", "status": 200, "content": "O erro \"branches divergentes\" ocorre quando você tenta push para um branch que não está em sincronia com a branch remota. Aqui está uma solução passo a passo:\n\n**Passo 1: Verifique a situação atual**\n\n```bash\ngit status\n```\n\nIsso mostrará quais branches estão em sincronia e quais estão divergentes.\n\n**Passo 2: Resolva a divergência**\n\nExistem várias formas de resolver a divergência, dependendo da situação. Aqui estão algumas opções:\n\n### 1. Rebase (reorganize os commits)\n\n```bash\ngit rebase -i HEAD~n\n```\n\nSubstitua `n` pelo número de commits que você deseja reorganizar. Isso irá reorganizar os commits para que eles sejam mais linhosos e em ordem cronológica.\n\n### 2. Merge (unir os branches)\n\n```bash\ngit merge branch-remota\n```\n\nSubstitua `branch-remota` pelo nome do branch remoto que você deseja unir.\n\n### 3. Reset (redefinir o HEAD)\n\n```bash\ngit", "metrics": { "length": 858, "commands": 3, "command_list": [ "git status", "git rebase -i HEAD~n", "git merge branch-remota" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Error de DCO sign-off en commits de Git en Windows (error-dco-signoff-windows)", "condition": "plain", "status": 200, "content": "The \"error-dco-signoff-windows\" error typically occurs when you're trying to commit changes to a Git repository on Windows and the `dco` (Distributed Commit Options) sign-off check fails. This check ensures that all files have a valid DCO sign-off.\n\nTo fix this issue, you'll need to add a DCO sign-off to all files that are missing it. Here are the steps:\n\n1. **Check for missing DCO sign-off**:\n\n Open a Git Bash terminal and navigate to your repository directory. Then, run the following command to check which files are missing a DCO sign-off:\n\n ```bash\ngit diff --name-only --diff-filter=ACMRTUXB\n```\n\n This command will show you the files that have been modified (A), added (C), renamed (R), copied (M), or deleted (D), but do not have a DCO sign-off.\n\n2. **Add DCO sign-off to missing files**:\n\n Once you have identified the missing files, you can add a DCO sign-off to them using the following command:\n\n ```bash\ngit add -u\n```\n\n This command will stage all changes, including the ones without a DCO sign-off.\n\n", "metrics": { "length": 1031, "commands": 2, "command_list": [ "git diff --name-only --diff-filter=ACMRTUXB", "git add -u" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Error de DCO sign-off en commits de Git en Windows (error-dco-signoff-windows)", "condition": "with_lesson", "status": 200, "content": "El error de DCO sign-off en commits de Git en Windows se debe a varias causas, como la configuración de usuario no establecida, el entorno mixto y la diferencia entre mayúsculas y minúsculas en el email. Aquí te presento una serie de pasos y comandos para solucionar este problema:\n\n**Paso 1: Verificar la configuración actual**\n\n Primero, debemos verificar la configuración actual de Git en nuestro sistema. Para hacer esto, podemos utilizar el comando `git config --list --show-origin` con el parámetro `user`. Esto nos mostrará la configuración de usuario actual en cada nivel (sistema, global y local).\n\n```bash\ngit config --list --show-origin user\n```\n\n**Paso 2: Establecer la configuración de usuario**\n\n Para establecer la configuración de usuario, debemos configurar las variables `user.name` y `user.email` en cada nivel (sistema, global y local). Podemos hacer esto utilizando el comando `git config`.\n\n Primero, configuramos la variable `user.name`:\n\n```bash\ngit config --global user.name \"Tu Nombre\"\n```\n\n Luego, configuramos", "metrics": { "length": 1037, "commands": 2, "command_list": [ "git config --list --show-origin user", "git config --global user.name \"Tu Nombre\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Backup Payload Extraction — .VR/.SV Binary Parsing and .LS Text Fallback (fanuc-backup-payload-extraction)", "condition": "with_lesson", "status": 200, "content": "To extract the payload configuration from a FANUC robot backup directory, you can follow these steps:\n\n**Step 1: Install WinOLPC**\n\nFirst, you need to install WinOLPC, which includes the kconvars.exe tool. You can download WinOLPC from the official FANUC website.\n\n**Step 2: Set up robot.ini**\n\nCreate a `robot.ini` file in the root directory of the backup directory. This file is required by the kconvars.exe tool. The contents of the file are as follows:\n```ini\n[DEFAULT]\nBinPath=C:\\path\\to\\kconvars.exe\n```\nReplace `C:\\path\\to\\kconvars.exe` with the actual path to the kconvars.exe executable.\n\n**Step 3: Extract payload configuration using kconvars.exe**\n\nOpen a Command Prompt or PowerShell and navigate to the root directory of the backup directory. Run the following command to extract the payload configuration:\n```bash\nkconvars.exe -p -l\n```\nThis command will extract the payload configuration from the backup directory and display it in the Command Prompt or PowerShell.\n\n**Step 4: Parse the output**\n\nThe output of the kconvars.exe command will be a series of lines", "metrics": { "length": 1076, "commands": 3, "command_list": [ "Replace `C:\\path\\to\\kconvars.exe` with the actual path to the kconvars.exe executable.", "**Step 3: Extract payload configuration using kconvars.exe**", "Open a Command Prompt or PowerShell and navigate to the root directory of the backup directory. Run the following command to extract the payload configuration:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Backup Payload Extraction — .VR/.SV Binary Parsing and .LS Text Fallback (fanuc-backup-payload-extraction)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely related to the FANUC Backup Payload Extraction tool, which is used to extract data from FANUC backup files. Here's a step-by-step guide to fix the issue:\n\n**Error Analysis:**\n\nThe error message `.VR/.SV Binary Parsing and .LS Text Fallback` suggests that the tool is having trouble parsing the binary data in the `.VR` or `.SV` files. This could be due to a corrupted file or an incompatible version of the tool.\n\n**Fix:**\n\nTo resolve the issue, try the following steps:\n\n1. **Update the FANUC Backup Payload Extraction tool:**\n\n ```bash\nsudo apt update\nsudo apt install -y fanuc-backup-payload-extraction\n```\n\n or\n\n ```bash\nsudo yum update\nsudo yum install -y fanuc-backup-payload-extraction\n```\n\n or\n\n ```bash\nsudo pip install fanuc-backup-payload-extraction\n```\n\n2. **Check the file format:**\n\n Verify that the `.VR` or `.SV` files are in the correct format. You can use the `file` command to check the file type:\n\n ```bash\nfile -b *.vr\nfile -b", "metrics": { "length": 1001, "commands": 5, "command_list": [ "sudo apt update", "sudo apt install -y fanuc-backup-payload-extraction", "sudo yum update", "sudo yum install -y fanuc-backup-payload-extraction", "sudo pip install fanuc-backup-payload-extraction" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC INTP-102 DETECT JOINT — OLP Whitespace Bug (fanuc-intp-102-detect-joint-olp-whitespace)", "condition": "with_lesson", "status": 200, "content": "To fix the FANUC INTP-102 DETECT JOINT — OLP Whitespace Bug, follow these steps:\n\n**Step 1: Compare .ls Files**\n\nExtract the `.ls` file from the robot controller and compare it with the OLP-generated version.\n\n```bash\n# Extract the .ls file from the robot controller\nscp robot_original.ls user@server:/path/to/robot/ls\n\n# Compare the .ls files\ndiff robot_original.ls olp_generated.ls\n```\n\n**Step 2: Fix Trailing Whitespace**\n\nRemove extra spaces before semicolons in sensor instructions. Use the following command to fix the trailing whitespace:\n\n```bash\n# Use sed to remove trailing whitespace before semicolons\nsed -i 's/ ;/ ;/g' /path/to/robot/ls\n```\n\nReplace `/path/to/robot/ls` with the actual path to your `.ls` file.\n\n**Step 3: Report to OLP Vendor**\n\nFile a bug with RoboDK (or your OLP tool) about trailing whitespace in sensor instruction generation.\n\n```bash\n# Create a new issue in RoboDK\ncurl -X POST \\\n https://example.com/robodk/issues \\\n -", "metrics": { "length": 958, "commands": 3, "command_list": [ "scp robot_original.ls user@server:/path/to/robot/ls", "diff robot_original.ls olp_generated.ls", "sed -i 's/ ;/ ;/g' /path/to/robot/ls" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC INTP-102 DETECT JOINT — OLP Whitespace Bug (fanuc-intp-102-detect-joint-olp-whitespace)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to a whitespace bug in the FANUC INTP-102's OLP (Optical Linear Position) system. This issue can be fixed by updating the OLP system's firmware. Here's a step-by-step guide to help you resolve the problem:\n\n**Prerequisites:**\n\n* Make sure you have a FANUC INTP-102 robot with an OLP system installed.\n* Ensure that the robot's firmware is up-to-date. You can check the current firmware version using the `FANUC Robot Controller` software.\n* Familiarize yourself with the robot's safety features and operating procedures.\n\n**Fixing the OLP Whitespace Bug:**\n\n1. **Update the OLP system's firmware:**\n - Open the `FANUC Robot Controller` software and navigate to the `Maintenance` tab.\n - Select the `OLP` system and click on the `Update` button.\n - Follow the on-screen instructions to download and install the latest firmware for the OLP system.\n\n Example command:\n ```bash\n # Update OLP system firmware\n FANUC-INTP-102-OLP-Update\n ```\n\n2. **Verify the firmware update:**\n ", "metrics": { "length": 1031, "commands": 1, "command_list": [ "FANUC-INTP-102-OLP-Update" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC IO Marker M[] Instruction — Background Logic Alternative (fanuc-io-marker-m-instruction)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to enable the Marker register by setting `$MIX_LOGIC.$USE_MKR = TRUE` in your FANUC program. Here are the steps:\n\n1. Open your FANUC program in the FANUC HandlingTool.\n2. Go to `MENU → I/O → I/O Replace`.\n3. In the I/O Replace menu, click on the \"M[]\" option.\n4. Since the M[] option is not documented in standard TP programming guides, you will need to enable the Marker register by setting `$MIX_LOGIC.$USE_MKR = TRUE` in the program.\n5. Add the following code to your program: `$MIX_LOGIC.$USE_MKR = TRUE;`\n6. Save your changes and restart the FANUC program.\n\nHere's an example of how to set a Marker register:\n\n```fanuc\n-- Enable Marker register\n$MIX_LOGIC.$USE_MKR = TRUE;\n\n-- Set Marker register M[1]\nM[1] = (DI[1] AND DI[2]);\n```\n\nIn this example, the Marker register M[1] is set to true if both DI[1] and DI[2] are true.\n\nNote: The `$MIX", "metrics": { "length": 872, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC IO Marker M[] Instruction — Background Logic Alternative (fanuc-io-marker-m-instruction)", "condition": "plain", "status": 200, "content": "The error message \"FANUC IO Marker M[] Instruction — Background Logic Alternative\" is not a standard error message, and it's likely a custom error message specific to your FANUC machine or your organization's configuration.\n\nHowever, I can provide you with some general steps to troubleshoot and resolve common issues related to FANUC IO Marker M[] instructions. Please note that these steps are based on general knowledge and may not be specific to your situation.\n\n**Step 1: Check the FANUC machine settings**\n\n1. Log in to the FANUC machine and navigate to the \"Machine Settings\" or \"Configuration\" menu.\n2. Check if the \"IO Marker\" or \"M[]\" settings are enabled and configured correctly.\n3. Verify that the \"Background Logic Alternative\" setting is not causing any issues.\n\n**Step 2: Check the program code**\n\n1. Check the program code for any errors or inconsistencies related to the IO Marker M[] instruction.\n2. Verify that the program code is correctly configured to use the IO Marker M[] instruction.\n3. Check for any errors or warnings related to the IO Marker M[] instruction in the program code.\n\n**Step 3: Check the FANUC machine logs**\n\n1. Check the FAN", "metrics": { "length": 1167, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC MI Standard Software — Complete Instruction Reference (MI01-MI22) (fanuc-mi-standard-software-instructions)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely related to the FANUC MI Standard Software, and I'll provide a general solution. However, please note that without the specific error message, it's difficult to provide an exact fix.\n\nAssuming the error is related to a configuration issue or a missing library, here are some general steps you can try:\n\n**Step 1: Check the software version**\n\nMake sure you're running the latest version of the FANUC MI Standard Software. You can check the version by running the following command:\n\n```bash\nmi_version\n```\n\n**Step 2: Check for missing libraries**\n\nRun the following command to check for missing libraries:\n\n```bash\nmi_libraries\n```\n\nThis will display a list of installed libraries. If you find any missing libraries, you can install them using the following command:\n\n```bash\nmi_install_library \n```\n\nReplace `` with the name of the missing library.\n\n**Step 3: Check configuration files**\n\nCheck the configuration files for any errors or inconsistencies. Run the following command to display the configuration files:\n\n```bash\nmi_config\n```\n\nThis will display a list of configuration files. You can then edit these files manually to resolve any errors or inconsistencies.\n\n**Step", "metrics": { "length": 1245, "commands": 4, "command_list": [ "mi_version", "mi_libraries", "mi_install_library ", "mi_config" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC MI Standard Software — Complete Instruction Reference (MI01-MI22) (fanuc-mi-standard-software-instructions)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, the error is likely due to the incorrect usage of the CALL MIxx_MOD(parameters) instruction. The correct format for the CALL instruction is:\n\nCALL MIxx_MOD(parameters)\n\nHowever, in the provided instruction, the parameters are not enclosed in parentheses.\n\nHere is a concrete, actionable fix with exact commands:\n\nReplace the following instruction:\n\nCALL MI01_CMN(CollZone, Request/Release, ZoneNo.=1, '...')\n\nWith:\n\nCALL MI01_CMN(CollZone, Request/Release, 1, '...')\n\nAnd also replace the following instruction:\n\nCALL MI01_CMN(FestoCheck, '...')\n\nWith:\n\nCALL MI01_CMN(FestoCheck, '...') // No change needed here\n\nThe corrected instruction is:\n\nCALL MI01_CMN(CollZone, Request/Release, 1, '...')\n\nThis fix assumes that the zone number is always 1. If the zone number is dynamic, you should replace the number 1 with the actual zone number.\n\nSimilarly, for the MI02_TCH module, the instruction is:\n\n| Instruction | Function | Format\n|-------------|----------|--------|\n| Init | Reset tool change; check tool change; verify MI03 installation | CALL MI02", "metrics": { "length": 1086, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC R-2000iC 检索混淆Fix — 关键词强制召回 (fanuc-r-2000ic-retrieval-fix)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to add a keyword recovery module to the `retrieve()` function in `rag_core.py`. Here's the updated code:\n\n1. Open the `rag_core.py` file in your favorite text editor.\n2. Add the following code before the `type_model()` function:\n```python\nimport re\n\n_KW = re.compile(r'上位机|robot interface|寄存器读|寄存器写|读写寄存器', re.I)\n\ndef keyword_recovery(query):\n if _KW.search(query):\n kw_results = collection.get(\n where_document={\"$contains\": \"Robot Interface\"},\n limit=10,\n )\n for doc, meta in zip(kw_results[\"documents\"], kw_results[\"metadatas\"]):\n score = 0.92 if \"Robot Interface\" in doc[:500] else 0.85\n return score\n return 0.0\n\ndef retrieve(query):\n # ... (rest of the function remains the same)\n score = keyword_recovery(query)\n if score > 0.85:\n # ... (rest of the function remains the same)\n```\n3. Save the changes to the `rag_core.py` file.\n4. Run the", "metrics": { "length": 959, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC R-2000iC 检索混淆Fix — 关键词强制召回 (fanuc-r-2000ic-retrieval-fix)", "condition": "plain", "status": 200, "content": "The error message \"FANUC R-2000iC 检索混淆Fix — 关键词强制召回 (fanuc-r-2000ic-retrieval-fix)\" is a Chinese error message, but I'll provide a general solution for a similar issue that might occur in Fanuc R-2000iC programming.\n\nThe error is likely related to a keyword conflict or undefined keyword in your program. Here's a step-by-step fix:\n\n**Step 1: Check your program for keyword conflicts**\n\n Review your program to ensure that you're not using a keyword as a variable or label name. Fanuc R-2000iC uses specific keywords for programming, such as `MOV`, `ADD`, `SUB`, etc. If you're using a keyword as a variable name, it may cause a conflict.\n\n**Step 2: Check for undefined keywords**\n\n Verify that all the keywords you're using are defined in your program or in the library. You can check the Fanuc R-2000iC documentation or online resources to ensure that the keyword is valid.\n\n**Step 3: Update your program**\n\nIf you've identified a keyword conflict or undefined keyword, update your program to use a different name or define the keyword.\n\n", "metrics": { "length": 1040, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Spot Weld Tip Max Wear Amount — sysspot.sv Variable Lookup via kconvars (fanuc-spot-wear-max-lookup)", "condition": "plain", "status": 200, "content": "The error message you're encountering is due to an invalid variable lookup in the FANUC Spot Welding system. To resolve this issue, you need to update the `fanuc-spot-wear-max-lookup` variable with the correct value.\n\nHere are the steps to fix this issue:\n\n**Method 1: Update the variable through the FANUC System**\n\n1. Open the FANUC System.\n2. Go to the \"Parameter\" menu.\n3. Select \"Variable\" and then \"Lookup\".\n4. In the \"Lookup\" window, select \"fanuc-spot-wear-max-lookup\" from the list of variables.\n5. Update the value in the \"Value\" field to the correct maximum wear amount.\n6. Click \"OK\" to save the changes.\n\n**Method 2: Update the variable through the FANUC kConVars**\n\n1. Open the FANUC kConVars.\n2. In the \"Variables\" section, find the \"fanuc-spot-wear-max-lookup\" variable.\n3. Update the value in the \"Value\" field to the correct maximum wear amount.\n4. Click \"OK\" to save the changes.\n\n**Method 3: Update the variable through the FANUC System Configuration**\n\n1.", "metrics": { "length": 976, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Spot Weld Tip Max Wear Amount — sysspot.sv Variable Lookup via kconvars (fanuc-spot-wear-max-lookup)", "condition": "with_lesson", "status": 200, "content": "To fix the FANUC Spot Weld Tip Max Wear Amount error, follow these steps:\n\n**Step 1: Locate the sysspot.sv file**\n\n```bash\ncd \nls -l sysspot.sv\n```\n\n**Step 2: Convert the sysspot.sv file with kconvars**\n\n```bash\nkconvars.exe sysspot.sv sysspot_decoded.txt\n```\n\nNote: Make sure the `kconvars.exe` tool is in the same directory or parent as the `sysspot.sv` file. If it's not, you can specify the full path to `kconvars.exe`:\n\n```bash\nkconvars.exe path/to/kconvars.exe sysspot.sv sysspot_decoded.txt\n```\n\n**Step 3: Find the wear parameter**\n\n```bash\ncat sysspot_decoded.txt | grep $SPOTEQSETUP[1].$EPAF_TRGDST\n```\n\nThis command searches for the line containing `$SPOTEQSETUP[1].$EPAF_TRGDST` in the `sysspot_decoded.txt` file.\n\n**Step 4: Extract the maximum wear amount (", "metrics": { "length": 783, "commands": 5, "command_list": [ "cd ", "ls -l sysspot.sv", "kconvars.exe sysspot.sv sysspot_decoded.txt", "kconvars.exe path/to/kconvars.exe sysspot.sv sysspot_decoded.txt", "cat sysspot_decoded.txt | grep $SPOTEQSETUP[1].$EPAF_TRGDST" ], "has_command_block": true, "actionable": false, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "scenario": "DCO Signoff Lost During Force Push (dco-signoff-force-push-pitfall)", "condition": "with_lesson", "status": 200, "content": "To fix the \"DCO Signoff Lost During Force Push\" issue, follow these steps:\n\n1. **Reset your branch to the upstream main branch**:\n ```bash\ngit fetch upstream main\ngit reset --hard upstream/main\n```\n\n2. **Cherry-pick your commit with the `--signoff` option**:\n Replace `` with the actual hash of the commit you want to cherry-pick:\n ```bash\ngit cherry-pick --signoff\n```\n\n3. **Force push your changes to your fork**:\n Replace `fork` with the name of your fork and `branch` with the name of your branch:\n ```bash\ngit push fork branch --force\n```\n\n**Verification**:\nTo ensure that your PR only contains one commit and that the DCO signoff is present, you can use the following commands:\n\n1. **Check the number of commits in your PR**:\n Replace `UPSTREAM` with the name of the upstream repository, `REPO` with the name of the repository, and `NUMBER` with the number of your PR:\n ```bash\ngh api repos/UPSTREAM/REPO/pulls/NUMBER/commits --jq '", "metrics": { "length": 979, "commands": 4, "command_list": [ "git fetch upstream main", "git reset --hard upstream/main", "git cherry-pick --signoff", "git push fork branch --force" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fatal-guard CLI: harden entry point with --help, --version, exit codes (fatal-guard-cli-hardening)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the given error:\n\n**Step 1: Install `argparse` if not already installed**\n\nOpen your terminal and run the following command to install `argparse` if it's not already installed:\n```bash\npip install argparse\n```\n**Step 2: Create a new file for your CLI tool**\n\nCreate a new file, e.g., `fatal-guard-cli.py`, and add the following code:\n```python\nimport argparse\nimport sys\n\n__version__ = \"1.4.2\"\n\ndef build_parser():\n parser = argparse.ArgumentParser(\n prog=\"fatal-guard\",\n description=\"Monitor and guard critical processes against fatal failures.\",\n epilog=\"Exit codes: 0=success, 1=guard failure, 2=usage error, 3=timeout\",\n )\n parser.add_argument(\n \"--version\", action=\"version\", version=f\"%(prog)s {__version__}\"\n )\n parser.add_argument(\n \"--timeout\",\n type=int,\n default=30,\n metavar=\"SECONDS\",\n help=\"Maximum seconds to wait for a guarded process to respond (default: 30)\",\n )\n parser.add_argument(\n \"--config\",\n type=str,\n default=\"/", "metrics": { "length": 1081, "commands": 1, "command_list": [ "pip install argparse" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fatal-guard CLI: harden entry point with --help, --version, exit codes (fatal-guard-cli-hardening)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the hardening of entry points in Fatal-guard CLI. Here's a concrete, actionable fix:\n\n**Step 1: Install Fatal-guard CLI**\n\nFirst, make sure you have Fatal-guard CLI installed. If not, you can install it using the following command:\n\n```bash\npip install fatal-guard-cli\n```\n\n**Step 2: Hardening Entry Point**\n\nTo harden the entry point, you'll need to create a `hardening.toml` file in the root directory of your project. This file will contain the configuration for the hardening.\n\nHere's an example `hardening.toml` file:\n\n```toml\n[hardening]\nentry_points = [\n {\n name = \"fatal-guard-cli\"\n paths = [\n \"fatal-guard-cli --help\",\n \"fatal-guard-cli --version\",\n \"fatal-guard-cli exit\"\n ]\n }\n]\n```\n\n**Step 3: Configure Fatal-guard CLI**\n\nNext, you'll need to configure Fatal-guard CLI to use the `hardening.toml` file. You can do this by adding the following command to your `~/.bashrc` or `~/.bash_profile` file:\n\n```bash\nexport FATAL_GUARD_CONFIG=~/.", "metrics": { "length": 1018, "commands": 3, "command_list": [ "pip install fatal-guard-cli", "**Step 3: Configure Fatal-guard CLI**", "Next, you'll need to configure Fatal-guard CLI to use the `hardening.toml` file. You can do this by adding the following command to your `~/.bashrc` or `~/.bash_profile` file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ModuleNotFoundError in Python trotz pip install (fehler-python-modul-nicht-gefunden)", "condition": "with_lesson", "status": 200, "content": "To fix the `ModuleNotFoundError` in Python despite `pip install` succeeding, you need to ensure that the Python environment where `pip install` was run is the same as the environment executing the script. Here are the steps to follow:\n\n**Step 1: Identify the Python and pip versions in use**\n\nOpen a terminal and run the following commands to identify the Python and pip versions in use:\n```bash\n# Check the Python version\npython --version\n\n# Check the pip version\npip --version\n```\nTake note of the versions of Python and pip.\n\n**Step 2: Check if the Python and pip versions match**\n\nCompare the versions of Python and pip from the previous step. If they don't match, you may need to adjust the Python interpreter or pip version.\n\n**Step 3: Create a virtual environment (if not already created)**\n\nCreate a new virtual environment using the following command:\n```bash\npython -m venv myenv # Replace 'myenv' with your desired environment name\n```\n**Step 4: Activate the virtual environment**\n\nActivate the virtual environment using the following command:\n```bash\nsource myenv/bin/activate # On Linux/Mac\n. myenv\\Scripts\\activate # On Windows", "metrics": { "length": 1144, "commands": 3, "command_list": [ "python --version", "pip --version", "python -m venv myenv # Replace 'myenv' with your desired environment name" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ModuleNotFoundError in Python trotz pip install (fehler-python-modul-nicht-gefunden)", "condition": "plain", "status": 200, "content": "The error \"ModuleNotFoundError in Python trotz pip install\" usually occurs when the Python interpreter is unable to find the module that you're trying to import, even after installing it using pip. Here's a step-by-step solution to fix this issue:\n\n**Step 1: Update pip**\n\nBefore we proceed, make sure you're using the latest version of pip. Run the following command:\n\n```bash\npython -m pip install --upgrade pip\n```\n\n**Step 2: Check for package name spelling mistake**\n\nDouble-check that the package name is spelled correctly. Make sure to use the exact same name as the package you're trying to install.\n\n**Step 3: Install the package using pip**\n\nTry installing the package again using pip:\n\n```bash\npython -m pip install python-modul\n```\n\nReplace `python-modul` with the actual name of the package you're trying to install.\n\n**Step 4: Check if the package is installed correctly**\n\nAfter installation, try importing the package again in your Python script:\n\n```python\nimport python_modul\n```\n\nIf the package is installed correctly, this command should not raise a ModuleNotFoundError.\n\n**Step 5: Check the Python path**\n\nIf the package is installed correctly, but still can't be", "metrics": { "length": 1183, "commands": 2, "command_list": [ "python -m pip install --upgrade pip", "python -m pip install python-modul" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu Block API returns code=0 but creates zero blocks under rate limiting (feishu-block-api-false-success)", "condition": "plain", "status": 200, "content": "The error \"feishu-block-api-false-success\" typically indicates that the Feishu Block API is returning a successful response (code=0) but not actually creating any blocks due to rate limiting.\n\nTo fix this issue, you can try the following steps:\n\n1. **Increase the rate limit**: You can increase the rate limit by setting the `X-Feishu-Block-Api-Limit` header to a higher value. This will allow more requests to be made within a certain time frame.\n\n```bash\ncurl -X POST \\\n https://open.feishu.cn/open-apis/block/api/v1/blocks \\\n -H 'Content-Type: application/json' \\\n -H 'X-Feishu-Block-Api-Limit: 100' \\\n -d '{\"block_type\": \"text\", \"content\": \"Hello, world!\", \"trigger_type\": \"user\", \"trigger_value\": \"John\", \"trigger_operator\": \"==\"}'\n```\n\n2. **Wait for the rate limit reset**: If you're making requests too quickly, the rate limit might not have reset yet. You can wait for a few minutes and then try again.\n\n3. **Use a different block type**: Try using a different block", "metrics": { "length": 978, "commands": 5, "command_list": [ "curl -X POST \\", "https://open.feishu.cn/open-apis/block/api/v1/blocks \\", "-H 'Content-Type: application/json' \\", "-H 'X-Feishu-Block-Api-Limit: 100' \\", "-d '{\"block_type\": \"text\", \"content\": \"Hello, world!\", \"trigger_type\": \"user\", \"trigger_value\": \"John\", \"trigger_operator\": \"==\"}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu Block API returns code=0 but creates zero blocks under rate limiting (feishu-block-api-false-success)", "condition": "with_lesson", "status": 200, "content": "To fix this issue, you can add a validation step to ensure that the response contains actual block data. Here's a concrete, actionable fix:\n\n```bash\n# Update your script to include the validation step\nimport time\nimport requests\n\ndef create_blocks_safe(doc_id, parent_id, blocks, max_retries=3):\n \"\"\"Create blocks with rate limiting and body size limit checks\"\"\"\n \n # Initialize retry counter\n retries = 0\n \n while retries <= max_retries:\n try:\n # Send the POST request\n response = requests.post(\n f\"https://openapi.feishu.cn/open-apis/docx/v1/documents/{doc_id}/blocks/{parent_id}/children\",\n json=blocks,\n headers={\"Content-Type\": \"application/json\"},\n timeout=30\n )\n \n # Check if the response was successful\n if response.status_code == 200:\n # Parse the response JSON\n response_data = response.json()\n \n # Check if the response contains actual block data\n if \"children\" in response_data and len(response_data[\"children\"]) > 0:\n return True\n else:\n print(\"No blocks created. Response data:\", response_data)\n else:\n print", "metrics": { "length": 1327, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu block batch limit (feishu-block-batch-limit)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you can modify the code to control the batch size and add a delay between batches. Here's an updated version of the code:\n\n```python\nimport time\n\ndef batch_create_blocks(client, doc_id, blocks):\n batch_size = 20\n interval = 0.5\n\n for i in range(0, len(blocks), batch_size):\n batch = blocks[i:i + batch_size]\n client.document.blocks.children.create(doc_id, children=batch)\n if i + batch_size < len(blocks):\n time.sleep(interval)\n\n# Usage\nblocks = [...] # your list of blocks\nbatch_create_blocks(client, doc_id, blocks)\n```\n\nHowever, this code still doesn't handle the case where the batch size exceeds the limit of 20 blocks. To handle this, you can add a check to ensure the batch size doesn't exceed 20:\n\n```python\nimport time\n\ndef batch_create_blocks(client, doc_id, blocks):\n max_batch_size = 20\n interval = 0.5\n\n for i in range(0, len(blocks), max_batch_size):\n batch = blocks[i:i + max_batch_size]\n if len(batch) < max_batch_size:\n client.document.blocks.children.create", "metrics": { "length": 1069, "commands": 1, "command_list": [ "However, this code still doesn't handle the case where the batch size exceeds the limit of 20 blocks. To handle this, you can add a check to ensure the batch size doesn't exceed 20:" ], "has_command_block": true, "actionable": false, "inline_code_count": 2, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu block batch limit (feishu-block-batch-limit)", "condition": "plain", "status": 200, "content": "The error message \"feishu block batch limit (feishu-block-batch-limit)\" is related to the Feishu bot API, which has a limit on the number of batches you can send per second.\n\nTo fix this issue, you can try the following steps:\n\n1. **Increase the request rate limit**:\n You can increase the request rate limit by setting the `X-Feishu-Request-Rate-Limit` header to a higher value. You can do this by adding the following header to your request:\n ```bash\ncurl -X POST \\\n https://open.feishu.cn/open-apis/bot/v3/batchSend \\\n -H 'Authorization: Bearer YOUR_BOT_TOKEN' \\\n -H 'X-Feishu-Request-Rate-Limit: 1000' \\\n -H 'Content-Type: application/json' \\\n -d '[\n {\n \"type\": \"text\",\n \"text\": \"Hello, world!\"\n },\n {\n \"type\": \"text\",\n \"text\": \"This is a test message.\"\n }\n ]'\n```\n Replace `YOUR_BOT_TOKEN` with your actual bot token.\n\n2. **Use a queueing", "metrics": { "length": 905, "commands": 15, "command_list": [ "curl -X POST \\", "https://open.feishu.cn/open-apis/bot/v3/batchSend \\", "-H 'Authorization: Bearer YOUR_BOT_TOKEN' \\", "-H 'X-Feishu-Request-Rate-Limit: 1000' \\", "-H 'Content-Type: application/json' \\" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu block type values limits (feishu-block-type-values-limits)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"feishu block type values limits (feishu-block-type-values-limits)\", you need to update your code to use the correct block type values and handle any potential issues with image tokens.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Update your JSON payload to use the correct block type values**\n\nReplace the following lines:\n```json\n{\n \"block_type\": 3,\n \"heading\": {\n \"level\": 3,\n \"elements\": [\n {\n \"type\": \"text_run\",\n \"text_run\": {\n \"content\": \"This is a heading\"\n }\n }\n ]\n }\n},\n{\n \"block_type\": 27,\n \"image\": {\n \"src\": \"https://example.com/image.jpg\"\n }\n}\n```\nWith the following updated lines:\n```json\n{\n \"block_type\": 1770001, // Use the correct heading type\n \"heading\": {\n \"level\": 3,\n \"elements\": [\n {\n \"type\": \"text_run\",\n \"text_run\": {\n \"content\": \"This is a heading\"\n }\n }\n ]\n }\n},\n{\n \"block_type\": 2,", "metrics": { "length": 952, "commands": 1, "command_list": [ "With the following updated lines:" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu block type values limits (feishu-block-type-values-limits)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to Feishu block type values limits. To resolve this issue, you'll need to update the block type values limits in your Feishu configuration.\n\nHere's a step-by-step guide to fix the issue:\n\n**Prerequisites:**\n\n* You have the Feishu SDK installed in your project.\n* You have a Feishu workspace set up.\n\n**Fix:**\n\n1. **Update the block type values limits in the Feishu configuration file:**\n\n If you're using a YAML configuration file, open the file in a text editor and update the block type values limits as follows:\n\n ```yml\nblock_type_values_limits:\n - type: text\n values:\n - short\n - long\n - type: image\n values:\n - small\n - medium\n - large\n```\n\n If you're using a JSON configuration file, update the block type values limits as follows:\n\n ```json\n{\n \"block_type_values_limits\": [\n {\n \"type\": \"text\",\n \"values\": [\"short\", \"long\"]\n },\n {\n \"type\": \"image\",\n \"values\": [\"small\", \"medium\", \"large\"]\n }\n ", "metrics": { "length": 1015, "commands": 1, "command_list": [ "If you're using a JSON configuration file, update the block type values limits as follows:" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Near-duplicate Feishu bot lessons: keep cc-connect, archive generic stub (feishu-bot-setup-complete)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to follow these steps:\n\n1. Move the old generic body to a new file in the `_archive` directory.\n2. Update the canonical setup guide to point to the new file.\n3. Create a decision lesson at the old path.\n\nHere are the exact commands to achieve this:\n\n```bash\n# Move the old generic body to a new file in the _archive directory\ngit mv lessons/contrib/cc-connect-feishu-setup-complete.md lessons/_archive/cc-connect-feishu-setup-complete.md\n\n# Update the canonical setup guide to point to the new file\ngit mv lessons/contrib/feishu-bot-setup-complete.md lessons/contrib/cc-connect-feishu-setup-complete.md\n\n# Create a decision lesson at the old path\necho \"# Feishu Bot Setup\" > lessons/contrib/feishu-bot-setup-complete.md\necho \"## Problem\" >> lessons/contrib/feishu-bot-setup-complete.md\necho \"## Cause\" >> lessons/contrib/feishu-bot-setup-complete.md\necho \"## Fix\" >> lessons/contrib/feishu-bot-setup-complete.md\necho \"## Verify\" >> lessons/contrib/feishu-bot-setup-complete.md\n\n# Add a see_also", "metrics": { "length": 1024, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "飞书 doc_delete_blocks_by_range 不传 end 会删到文档末尾 (feishu-doc-delete-blocks-by-range-pitfall)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is due to the fact that when you don't provide the `end` parameter in the `doc_delete_blocks_by_range` method, it will delete all remaining blocks in the document instead of stopping at the specified `start` index.\n\nTo fix this issue, you can modify your code to always provide the `end` parameter, even if it's set to `start + count`. Here's an example of how you can do this in Python:\n\n```python\nimport requests\n\n# Replace with your Feishu API token and document ID\ntoken = \"your_token\"\ndoc_id = \"your_doc_id\"\n\n# Define the start and end indices\nstart = 0\ncount = 5\n\n# Get the block IDs for the specified range\nresponse = requests.get(f\"https://open.feishu.cn/document_api/v1/document/{doc_id}/fetch?scope=block&start={start}&count={count}&keyword=&order=desc\")\nblock_ids = response.json()[\"data\"][\"block_ids\"]\n\n# Delete the blocks\nresponse = requests.post(f\"https://open.feishu.cn/document_api/v1/document/{doc_id}/delete_blocks_by_ids\", \n json={\"block_ids\": block_ids}, \n headers={\"Authorization\": f", "metrics": { "length": 1082, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Near-duplicate Feishu bot lessons: keep cc-connect, archive generic stub (feishu-bot-setup-complete)", "condition": "plain", "status": 200, "content": "The error message you're seeing is related to duplicate Feishu bot lessons. To fix this, you'll need to delete the duplicate lessons. Here are the steps to follow:\n\n**Step 1: Delete the duplicate lesson**\n\nYou can delete the duplicate lesson by running the following command:\n\n```bash\nfeishu delete-lesson --lesson-name keep cc-connect, archive generic stub (feishu-bot-setup-complete)\n```\n\nReplace `feishu-bot-setup-complete` with the actual name of the duplicate lesson.\n\n**Step 2: Verify the lesson is deleted**\n\nAfter deleting the lesson, you can verify that it's been removed by running the following command:\n\n```bash\nfeishu lessons\n```\n\nThis will list all your Feishu bot lessons. If the duplicate lesson is deleted, you should no longer see it in the list.\n\n**Step 3: Re-create the lesson (if necessary)**\n\nIf the lesson was deleted by mistake, you'll need to re-create it. You can re-create the lesson by running the following command:\n\n```bash\nfeishu create-lesson --lesson-name keep cc-connect, archive generic stub (feishu-bot-setup-complete)\n```\n\nReplace `feishu-bot-setup-complete` with the actual", "metrics": { "length": 1111, "commands": 3, "command_list": [ "feishu delete-lesson --lesson-name keep cc-connect, archive generic stub (feishu-bot-setup-complete)", "feishu lessons", "feishu create-lesson --lesson-name keep cc-connect, archive generic stub (feishu-bot-setup-complete)" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.4 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "飞书 doc_delete_blocks_by_range 不传 end 会删到文档末尾 (feishu-doc-delete-blocks-by-range-pitfall)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the `end` parameter not being provided in the `doc_delete_blocks_by_range` API method of the Feishu SDK. This can lead to unintended deletion of blocks at the end of the document.\n\nTo fix this issue, you need to provide the `end` parameter with the correct value. Here's an example of how to do it:\n\n```python\nfrom feishu import *\n\n# Initialize the client\nclient = Client()\n\n# Define the document ID and the start and end positions of the block range\ndoc_id = \"your_document_id\"\nstart = 1\nend = 5\n\n# Define the request body\nbody = {\n \"doc_id\": doc_id,\n \"start\": start,\n \"end\": end\n}\n\n# Send the request\nresponse = client.doc.delete_blocks_by_range(body)\n\n# Check if the request was successful\nif response.status_code == 200:\n print(\"Blocks deleted successfully\")\nelse:\n print(\"Error deleting blocks:\", response.text)\n```\n\nIn the above code:\n\n* `doc_id` is the ID of the document where you want to delete blocks.\n* `start` and `end` are the positions of the block range that you want to", "metrics": { "length": 1044, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "飞书 bot 在群聊里静默吞消息 — gateway 与 adapter 双层 allowlist 陷阱 (feishu-gateway-group-policy-silently-drops-messages)", "condition": "with_lesson", "status": 200, "content": "以下是修复错误的步骤:\n\n**步骤 1: 创建一个新文件 `feishu-allowlist-example.py`**\n\n```bash\ntouch feishu-allowlist-example.py\n```\n\n**步骤 2: 将以下代码写入 `feishu-allowlist-example.py`**\n\n```python\nimport os\nimport logging\n\nfrom hermes import Hermes\n\n# 使 logger 显示详细信息\nlogging.basicConfig(level=logging.INFO)\n\n# 读取 Hermes Agent 的配置文件\nconfig_file = 'config.yaml'\nconfig = Hermes().config\n\n# 读取环境变量\nenv_file = '.env'\nenv = Hermes().env\n\n# 使 adapter 支持 allowlist\nadapter_config = {\n 'feishu': {\n 'policy': 'allowlist',\n 'allowed_users': env.get('FEISHU_ALLOWED_USERS', '')\n }\n}\n\n# 使 gateway 支持 allowall\ngateway_config = {\n 'feishu': {\n 'allowed_chats': env.get('FEISHU_GROUP_ALLOWED_CHATS', '')\n }\n}\n\n# 使 GATEWAY_ALLOW_ALL_USERS=false\ngateway_config['feishu']['allow_all_users'] = False\n\n", "metrics": { "length": 788, "commands": 1, "command_list": [ "touch feishu-allowlist-example.py" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "飞书 bot 在群聊里静默吞消息 — gateway 与 adapter 双层 allowlist 陷阱 (feishu-gateway-group-policy-silently-drops-messages)", "condition": "plain", "status": 200, "content": "The error message \"飞书 bot 在群聊里静默吞消息 — gateway 与 adapter 双层 allowlist 陷阱 (feishu-gateway-group-policy-silently-drops-messages)\" indicates that the Feishu bot is silently dropping messages in a group chat due to a configuration issue with the gateway and adapter layers.\n\nTo fix this issue, you can try the following steps:\n\n1. Check the Feishu dashboard for any updates or changes to the gateway and adapter configurations.\n2. Ensure that the `allowlist` configuration is set correctly for the bot. You can do this by checking the `feishu-gateway-group-policy-silently-drops-messages` log for any errors related to the `allowlist`.\n3. Update the `feishu-gateway` and `feishu-adapter` configurations to ensure that they are compatible with each other.\n\nHere are some exact commands you can use to troubleshoot and fix the issue:\n\n**Step 1: Check the Feishu dashboard**\n\nOpen the Feishu dashboard and navigate to the \"Gateway\" tab. Check if there are any updates or changes to the gateway configuration.\n\n**Step 2: Check the `allowlist` configuration**\n\nRun the following command to", "metrics": { "length": 1079, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu markdown table not rendered (feishu-markdown-table-not-rendered)", "condition": "plain", "status": 200, "content": "The error \"feishu markdown table not rendered\" is typically caused by a missing or incorrect markdown syntax for tables in the Feishu bot. Here's a concrete and actionable fix:\n\n**Fix:**\n\n1. **Check your markdown syntax**: Ensure that your table is formatted correctly using the following syntax:\n```markdown\n| Column 1 | Column 2 | Column 3 |\n|----------|----------|----------|\n| Cell 1 | Cell 2 | Cell 3 |\n|----------|----------|----------|\n| Cell 4 | Cell 5 | Cell 6 |\n```\nNote the pipe (`|`) characters separating the columns and rows.\n\n2. **Use the correct table syntax**: If you're using Feishu's `markdown_table` element, make sure to use the correct syntax:\n```javascript\n{\n \"markdown_table\": {\n \"title\": \"Example Table\",\n \"rows\": [\n [\"Cell 1\", \"Cell 2\", \"Cell 3\"],\n [\"Cell 4\", \"Cell 5\", \"Cell 6\"]\n ]\n }\n}\n```\n3. **Test your markdown table**: Before sending the message, test your markdown table using a markdown parser like Markdown.it", "metrics": { "length": 977, "commands": 2, "command_list": [ "Note the pipe (`|`) characters separating the columns and rows.", "2. **Use the correct table syntax**: If you're using Feishu's `markdown_table` element, make sure to use the correct syntax:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu markdown table not rendered (feishu-markdown-table-not-rendered)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with the Feishu markdown table not rendering, you can use the following steps:\n\n1. Install the required Python package:\n\n```bash\npip install re\n```\n\n2. Create a new file named `optimize_markdown_style.py` and add the following code:\n\n```python\nimport re\n\ndef optimize_markdown_style(content: str) -> str:\n \"\"\"Feishu post middle markdown table render fix: use
', line)\n # Clean up extra
before and after spaces\n line = re.sub(r'\\s before and after the line\n line = f'
{line}
'\n in_table = True\n else:\n in_table = False\n result.append(line)\n \n return '\\n'.join(result)\n```\n\n3. Run", "metrics": { "length": 1027, "commands": 1, "command_list": [ "pip install re" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Finding and fixing Ghostty's largest memory leak (finding-and-fixing-ghostty-s-largest-memory-leak)", "condition": "with_lesson", "status": 200, "content": "To fix the memory leak in Ghostty, you'll need to modify the `scrollback_pruning` function to properly handle non-standard pages. Here's a concrete, actionable fix with exact commands:\n\n**Ghostty Code Modification**\n\n```c\n// In ghostty/scrollback.c\n\n// Modify the scrollback_pruning function to properly handle non-standard pages\nvoid scrollback_prune(PageList *page_list) {\n // ... (rest of the function remains the same)\n\n // Check if the page is non-standard and needs to be destroyed\n if (page->mmap_len > PAGE_SIZE) {\n munmap(page->mmap, page->mmap_len);\n }\n\n // Allocate a fresh standard-sized page from the pool\n page = page_list->pool->alloc_page(PAGE_SIZE);\n if (page) {\n // ... (rest of the function remains the same)\n }\n}\n\n// Modify the page_list_destroy function to properly free non-standard pages\nvoid page_list_destroy(PageList *page_list) {\n // ... (rest of the function remains the same)\n\n // Check if the page is non-standard and needs to be destroyed\n if (page->mmap_len > PAGE_SIZE) {\n munmap", "metrics": { "length": 1066, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 0.2 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "cc-connect Feishu bot complete setup guide (feishu-setup-complete-cc-connect)", "condition": "plain", "status": 200, "content": "The error message \"cc-connect Feishu bot complete setup guide (feishu-setup-complete-cc-connect)\" suggests that there might be an issue with the Feishu bot setup or the connection to the Feishu platform.\n\nHere's a step-by-step guide to resolve this issue:\n\n**Step 1: Check your Feishu bot token**\n\n1. Open the Feishu platform and navigate to your bot's settings.\n2. Look for the \"Bot Token\" or \"API Token\" section.\n3. Make sure you have copied the bot token correctly.\n\n**Step 2: Update your `~/.cc` configuration file**\n\n1. Open a terminal and navigate to your home directory (`cd ~`).\n2. Run the following command to update the `~/.cc` configuration file:\n```\ncc config update\n```\n3. If you don't have a `~/.cc` file, create it with the following command:\n```\ncc config init\n```\n4. Update the Feishu bot token in the `~/.cc` file by running:\n```\ncc config set feishu.token \n```\nReplace `` with the actual bot token you copied from the Feishu", "metrics": { "length": 975, "commands": 3, "command_list": [ "cc config update", "cc config init", "cc config set feishu.token " ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "cc-connect Feishu bot complete setup guide (feishu-setup-complete-cc-connect)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the error:\n\n1. **Update the `cc-connect` package to the latest version**:\n\n ```bash\nnpm install -g cc-connect@latest\n```\n\n2. **Create a configuration file for `cc-connect`**:\n\n ```bash\nmkdir -p ~/.cc-connect\ncp /path/to/cc-connect/config.example.toml ~/.cc-connect/config.toml\n```\n\n3. **Update the configuration file with the correct `app_id` and `app_secret`**:\n\n Replace `/path/to/your/project` with your actual project path.\n\n ```toml\n[[projects]]\nname = \"cc-connect-feishu\"\n\n[projects.agent]\ntype = \"claudecode\"\n\n[projects.agent.options]\nwork_dir = \"/path/to/your/project\"\nmode = \"default\"\n\n[[projects.platforms]]\ntype = \"feishu\"\n\n[projects.platforms.options]\napp_id = \"YOUR_APP_ID\"\napp_secret = \"YOUR_APP_SECRET\"\n\n```\n\n4. **Verify the installation and configuration**:\n\n ```bash\nnpm install -g cc-connect@latest\ncc-connect --version\n```\n\n5. **Display the optimized configuration**:\n\n ```bash\ncc-connect", "metrics": { "length": 968, "commands": 5, "command_list": [ "npm install -g cc-connect@latest", "mkdir -p ~/.cc-connect", "cp /path/to/cc-connect/config.example.toml ~/.cc-connect/config.toml", "4. **Verify the installation and configuration**:", "5. **Display the optimized configuration**:" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Finding and fixing Ghostty's largest memory leak (finding-and-fixing-ghostty-s-largest-memory-leak)", "condition": "plain", "status": 200, "content": "To fix Ghostty's largest memory leak, you'll need to identify the cause of the memory leak and then address it. Here are some general steps and concrete commands to help you get started:\n\n**Step 1: Identify the cause of the memory leak**\n\nYou can use the following command to get a list of processes that are consuming the most memory:\n```bash\nps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem\n```\nThis command will show you a list of processes, sorted by the amount of memory they are consuming.\n\n**Step 2: Analyze the memory usage**\n\nYou can use the `pmap` command to analyze the memory usage of a specific process:\n```bash\npmap -d \n```\nReplace `` with the ID of the process you want to analyze.\n\n**Step 3: Identify the memory leak**\n\nYou can use the `strace` command to analyze the system calls made by a process and identify the source of the memory leak:\n```bash\nstrace -s 1000 -p \n```\nThis command will show you a list of system calls made by the process, including the amount of memory used by each call.\n\n**Step", "metrics": { "length": 1048, "commands": 3, "command_list": [ "ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem", "pmap -d ", "strace -s 1000 -p " ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Frontmatter Parsing Edge Cases — Silent Failures and Data Loss (frontmatter-parsing-edge-cases)", "condition": "with_lesson", "status": 200, "content": "The issue you're experiencing is due to the `extract_frontmatter` function not handling edge cases properly. Here's a concrete, actionable fix:\n\n**Step 1: Update the `extract_frontmatter` function**\n\n```python\nimport re\nimport json\nimport yaml\nfrom typing import Tuple\n\ndef extract_frontmatter(path: 'Path') -> Tuple[dict | None, str | None]:\n \"\"\"\n Extract frontmatter from a file.\n\n Args:\n path: The path to the file.\n\n Returns:\n A tuple containing the extracted frontmatter as a dictionary or None, and an error message or None.\n \"\"\"\n content = path.read_text(encoding=\"utf-8\")\n # Check for UTF-8 BOM encoding\n if content.startswith('\\ufeff'):\n content = content[1:]\n\n m = re.match(r\"^---\\s*\\n(.?)\\n---\", content, re.DOTALL)\n if not m:\n # Return empty dict for empty frontmatter blocks\n return {}, None\n\n raw = m.group(1).strip()\n try:\n # Try to parse as JSON\n fm = json.loads(raw)\n except json.JSONDecodeError:\n # Fall back to simple YAML-like parser", "metrics": { "length": 1040, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Game MCP: End Turn Returns 409 Conflict (game-mcp-end-turn-conflict-409)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"Game MCP: End Turn Returns 409 Conflict\", you can follow these steps:\n\n1. Send the `end_turn` command to the MCP endpoint.\n2. Check if the response is a 409 Conflict. If it is, ignore it and proceed with the next steps.\n3. Use the `get_state` command to query the current game state.\n4. Verify that the game state shows the next turn has started.\n\nHere are the exact commands:\n\n```bash\n# Send end_turn command\nend_turn\n\n# Check if the response is a 409 Conflict\nif [ $? -eq 409 ]; then\n # Ignore the 409 response and proceed with the next steps\n echo \"Ignoring 409 response\"\nelse\n echo \"Received non-409 response\"\nfi\n\n# Query game state\nget_state\n\n# Verify that the game state shows the next turn has started\nif [ \"$(get_state | jq -r '.turn')\" == \"next\" ]; then\n echo \"Game state shows next turn has started\"\nelse\n echo \"Game state does not show next turn has started\"\nfi\n```\n\nNote: The `jq` command is used to parse the JSON response from the `get_state` command.\n\n", "metrics": { "length": 990, "commands": 12, "command_list": [ "end_turn", "if [ $? -eq 409 ]; then", "echo \"Ignoring 409 response\"", "else", "echo \"Received non-409 response\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Game MCP: End Turn Returns 409 Conflict (game-mcp-end-turn-conflict-409)", "condition": "plain", "status": 200, "content": "The error \"Game MCP: End Turn Returns 409 Conflict (game-mcp-end-turn-conflict-409)\" typically occurs when the MCP (Multiplayer Combat Protocol) is unable to update the game state because it has been modified by another player. This conflict can happen when multiple players try to end their turns simultaneously.\n\nHere's a concrete, actionable fix:\n\n**Step 1: Wait for 30 seconds**\n\nThe MCP will retry updating the game state after a short delay. Wait for 30 seconds to see if the conflict resolves itself.\n\n**Step 2: Check for conflicting players**\n\nIf the conflict persists, check the game's chat or observer window to see if any other players are trying to end their turns. If you find another player attempting to end their turn, inform them of the conflict and ask them to wait until the game is updated.\n\n**Step 3: End your turn manually**\n\nIf the conflict persists, try ending your turn manually by typing `/endturn` in the chat window. This will force the game to update the state without relying on the MCP.\n\n**Step 4: Reconnect to the game**\n\nIf the conflict still persists, try reconnecting to the game. Sometimes, reconnecting can resolve the conflict and allow the MCP to update", "metrics": { "length": 1192, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Frontmatter Parsing Edge Cases — Silent Failures and Data Loss (frontmatter-parsing-edge-cases)", "condition": "plain", "status": 200, "content": "The error \"Frontmatter Parsing Edge Cases — Silent Failures and Data Loss\" typically occurs when the `frontmatter-parsing-edge-cases` plugin is used in conjunction with other plugins that modify or delete frontmatter data. To resolve this issue, you can try the following steps:\n\n1. **Update the `frontmatter-parsing-edge-cases` plugin**:\n\n * If you're using npm or yarn, run the following command to update the plugin:\n\n ```bash\nnpm install --save-dev frontmatter-parsing-edge-cases@latest\n```\n\n or\n\n ```bash\nyarn add frontmatter-parsing-edge-cases@latest --dev\n```\n\n2. **Disable the `frontmatter-parsing-edge-cases` plugin temporarily**:\n\n * If the issue persists, try disabling the plugin temporarily by commenting out the line in your `package.json` file that enables it:\n\n ```json\n \"scripts\": {\n // ...\n \"build\": \"gatsby build --disable-plugin=frontmatter-parsing-edge-cases\",\n // ...\n },\n```\n\n Then, run the following command to build your site:\n\n ```bash\nnpm run build\n```\n\n or\n\n ```bash\ny", "metrics": { "length": 1085, "commands": 4, "command_list": [ "npm install --save-dev frontmatter-parsing-edge-cases@latest", "yarn add frontmatter-parsing-edge-cases@latest --dev", "Then, run the following command to build your site:", "or" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Gateway 进程挂死未崩溃 — watchdog 自动Recovery (gateway-hang-watchdog-recovery)", "condition": "with_lesson", "status": 200, "content": "根据给出的解决方案,这是解决 Gateway 进程挂死未崩溃的问题的具体步骤:\n\n1. **杀掉 TTY 里的 Hermes CLI过程**:\n\n ```bash\n pkill -f \"hermes cli\" || true\n ```\n\n 这个命令会杀掉 TTY 里的 Hermes CLI过程。如果 Hermes CLI过程存在,则会被杀掉。\n\n2. **通过 systemd 运行 Gateway**:\n\n ```bash\n systemctl --user status hermes-gateway.service\n ```\n\n 这个命令会检查 Gateway 服务是否通过 systemd 运行。如果服务没有运行,则会显示错误信息。\n\n3. **验证命令**:\n\n ```bash\n pkill -f \"hermes cli\" || true\n echo \"Verification passed: fix command exited 0\"\n ```\n\n 这个命令会杀掉 TTY 里的 Hermes CLI过程。如果 Hermes CLI过程存在,则会被杀掉。然后,会打印 \"Verification passed: fix command exited 0\" 的信息,表明命令执行成功。\n\n**具体步骤:**\n\n1. **使用命令 pkill -f \"hermes cli\" || true**:", "metrics": { "length": 648, "commands": 4, "command_list": [ "pkill -f \"hermes cli\" || true", "systemctl --user status hermes-gateway.service", "pkill -f \"hermes cli\" || true", "echo \"Verification passed: fix command exited 0\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Gateway 进程挂死未崩溃 — watchdog 自动Recovery (gateway-hang-watchdog-recovery)", "condition": "plain", "status": 200, "content": "The error message \"Gateway 进程挂死未崩溃 — watchdog 自动Recovery (gateway-hang-watchdog-recovery)\" is a common issue in Linux systems. This error occurs when the gateway process hangs and the watchdog timer fails to recover from it.\n\nTo fix this issue, you can try the following steps:\n\n**Step 1: Check the system logs**\n\nFirst, check the system logs to see if there are any error messages related to the gateway process.\n\n```bash\nsudo journalctl -u systemd-networkd\n```\n\nThis command will display the journal entries for the systemd-networkd service, which is responsible for managing network interfaces.\n\n**Step 2: Restart the gateway service**\n\nTry restarting the gateway service to see if it resolves the issue.\n\n```bash\nsudo systemctl restart gateway\n```\n\nor\n\n```bash\nsudo systemctl restart systemd-networkd\n```\n\n**Step 3: Disable and re-enable the gateway service**\n\nDisable the gateway service, wait for a few seconds, and then re-enable it.\n\n```bash\nsudo systemctl stop gateway\nsudo systemctl disable gateway\nsudo systemctl enable gateway\n```\n\n**Step 4: Check the watchdog configuration**\n\nCheck the watchdog configuration file to ensure it is set up correctly.\n\n```bash", "metrics": { "length": 1170, "commands": 6, "command_list": [ "sudo journalctl -u systemd-networkd", "sudo systemctl restart gateway", "sudo systemctl restart systemd-networkd", "sudo systemctl stop gateway", "sudo systemctl disable gateway" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GFW TLS SNI 阻断:工具层全部无效,只有代理能解 (gfw-tls-sni-blocking-tool-layer-ineffective)", "condition": "plain", "status": 200, "content": "The error message \"GFW TLS SNI 阻断:工具层全部无效,只有代理能解\" indicates that the TLS SNI (Server Name Indication) is blocked by the Great Firewall of China (GFW), and only proxy servers can resolve it. Here's a concrete fix using a proxy server:\n\n**Method 1: Using a proxy server with a VPN**\n\n1. Install a VPN client on your device (e.g., TunnelBear, ExpressVPN, or NordVPN).\n2. Connect to a VPN server that bypasses the GFW (e.g., a server in the US or Canada).\n3. Configure your browser to use the VPN connection as the proxy server. The steps vary depending on your browser:\n\n**Google Chrome:**\n\n* Open Chrome settings (chrome://settings/)\n* Click on \"Advanced\"\n* Click on \"System\"\n* Click on \"Proxy settings\"\n* Select \"Use a proxy server\"\n* Enter the VPN server's IP address and port (e.g., `tunnelbear.com:8080`)\n* Click \"Save\"\n\n**Mozilla Firefox:**\n\n* Open Firefox settings (about:config)\n* Search for \"network.proxy.type\" and set it to 3 (System proxy)\n* Search for \"network", "metrics": { "length": 970, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ghidra MCP Server — AI-Assisted Reverse Engineering (ghidra-mcp-server-reverse-engineering)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to install the Ghidra plugin and MCP server, and then connect from any MCP client. Here's a step-by-step guide:\n\n**Step 1: Install Ghidra plugin and MCP server**\n\n1. Clone the GhidraMCP repository:\n ```bash\ngit clone https://github.com/LaurieWired/GhidraMCP.git\n```\n\n2. Navigate to the cloned repository:\n ```bash\ncd GhidraMCP\n```\n\n3. Install the Ghidra plugin:\n ```bash\n./install-plugin.sh\n```\n\n4. Install the MCP server:\n ```bash\n./install-server.sh\n```\n\n5. Start the MCP server:\n ```bash\n./start-server.sh\n```\n\n**Step 2: Connect from any MCP client**\n\n1. Clone the MCP client repository (e.g., MCP-Client):\n ```bash\ngit clone https://github.com/LaurieWired/MCP-Client.git\n```\n\n2. Navigate to the cloned repository:\n ```bash\ncd MCP-Client\n```\n\n3. Build the MCP client:\n ```bash\n./build.sh\n```\n\n4. Connect to the MCP server:\n ```", "metrics": { "length": 878, "commands": 8, "command_list": [ "git clone https://github.com/LaurieWired/GhidraMCP.git", "cd GhidraMCP", "./install-plugin.sh", "./install-server.sh", "./start-server.sh" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GFW TLS SNI 阻断:工具层全部无效,只有代理能解 (gfw-tls-sni-blocking-tool-layer-ineffective)", "condition": "with_lesson", "status": 200, "content": "解决GFW TLS SNI 阻断问题的步骤如下:\n\n**步骤 1: 安装 proxychains**\n\n由于 GFW 阻断了所有工具层,需要使用代理来解析。我们需要安装 `proxychains` 和 `tor`:\n\n```bash\nsudo apt-get update\nsudo apt-get install proxychains tor\n```\n\n**步骤 2: 配置 proxychains**\n\n编辑 `~/.proxychains.conf`文件:\n\n```bash\nsudo nano ~/.proxychains.conf\n```\n\n添加以下内容:\n\n```\nroot\n # No Tor connection\n 0 0.0.0.0 0.0.0.0 TOR\n```\n\n**步骤 3: 配置 tor**\n\n编辑 `~/.torrc`文件:\n\n```bash\nsudo nano ~/.torrc\n```\n\n添加以下内容:\n\n```\nControlPort 443\nListenAddress 127.0.0.1\n```\n\n**步骤 4: 启动 tor**\n\n```bash\nsudo systemctl start tor\n```\n\n**步骤 5: 配置 curl**\n\n编辑 `~/.curlrc`文件:\n\n```bash\nsudo nano ~/.curlrc\n", "metrics": { "length": 598, "commands": 9, "command_list": [ "sudo apt-get update", "sudo apt-get install proxychains tor", "sudo nano ~/.proxychains.conf", "root", "0 0.0.0.0 0.0.0.0 TOR" ], "has_command_block": true, "actionable": false, "inline_code_count": 17, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ghidra MCP Server — AI-Assisted Reverse Engineering (ghidra-mcp-server-reverse-engineering)", "condition": "plain", "status": 200, "content": "I can help you troubleshoot the issue with Ghidra MCP Server. However, I need more information about the error message you're seeing. Could you please provide the exact error message you're encountering?\n\nThat being said, here are some common issues that might cause problems with Ghidra MCP Server:\n\n1. Missing dependencies:\nGhidra requires several dependencies to be installed on your system. Make sure that you have the following packages installed:\n\n - `libssl-dev` (for SSL support)\n - `libgmp-dev` (for arbitrary-precision arithmetic)\n - `liblzma-dev` (for LZMA compression)\n\n You can install these packages using the following commands:\n\n ```bash\nsudo apt-get update\nsudo apt-get install -y libssl-dev libgmp-dev liblzma-dev\n```\n\n2. Ghidra not installed:\n Make sure that Ghidra is installed on your system. You can install it using the following command:\n\n ```bash\nsudo apt-get install -y ghidra\n```\n\n3. MCP Server not running:\n If you're trying to use the MCP Server with Ghidra, make sure that it's running. You can start the MCP Server using the following command:\n\n", "metrics": { "length": 1092, "commands": 3, "command_list": [ "sudo apt-get update", "sudo apt-get install -y libssl-dev libgmp-dev liblzma-dev", "sudo apt-get install -y ghidra" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Чистая ветка после слияния предыдущего pull request (git-clean-branch-after-merged-pr-ru)", "condition": "with_lesson", "status": 200, "content": "Чтобы решить эту проблему, нужно сделать следующее:\n\n1. Войти в исходную ветку `main` с помощью `git checkout main`.\n2. Сравнить HEAD с основной веткой `origin/main` с помощью `git log --oneline origin/main..HEAD`.\n3. Если есть конфликты, решить их с помощью `git merge --abort` и повторить шаги.\n4. Если все ок, то создать новую ветку с помощью `git switch -c docs/next-lesson` (или любая другая комбинация, используемая в вашем репозитории).\n\nHere's как это выглядит в терминале:\n\n```bash\n# Войти в исходную ветку main\ngit checkout main\n\n# Сравнить HEAD с основной веткой origin/main\ngit log --oneline origin/main..HEAD\n\n# Решить конфликты, если есть\ngit merge --abort\n\n# Повторить шаги, если все еще есть конфликты\ngit log --oneline origin/main..HEAD\n\n# Если все ок, то создать новую ветку\ngit switch -c docs/next-lesson\n```\n\nAlternatively, если вы хот", "metrics": { "length": 855, "commands": 5, "command_list": [ "git checkout main", "git log --oneline origin/main..HEAD", "git merge --abort", "git log --oneline origin/main..HEAD", "git switch -c docs/next-lesson" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Чистая ветка после слияния предыдущего pull request (git-clean-branch-after-merged-pr-ru)", "condition": "plain", "status": 200, "content": "The error \"Чистая ветка после слияния предыдущего pull request (git-clean-branch-after-merged-pr-ru)\" is a Russian translation of a Git error that occurs when you try to delete a branch that has unmerged commits.\n\nTo fix this error, you need to use the following command:\n\n```bash\ngit merge --no-ff -m \"Clean up the branch\" \n```\n\nHere's what each part of the command does:\n\n- `git merge`: This command merges the current branch with another branch.\n- `--no-ff`: This option prevents the merge from being a fast-forward. When a merge is a fast-forward, Git doesn't create a new merge commit, but instead updates the tip of the current branch to point directly to the tip of the other branch.\n- `-m \"Clean up the branch\"`: This is the commit message for the merge commit. You can customize it as needed.\n- ``: Replace `` with the name of the branch you want to clean up.\n\nAfter running the command, you can then delete the branch:\n\n```bash\ngit branch -d \n```\n\nIf you want to force delete the branch (i.e", "metrics": { "length": 1053, "commands": 2, "command_list": [ "git merge --no-ff -m \"Clean up the branch\" ", "git branch -d " ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gh credential helper 路径Error导致 git push 静默失败 (git-credential-helper-gh-path-mismatch)", "condition": "with_lesson", "status": 200, "content": "解决 gh credential helper 路径Error导致 git push 靜默失败的问题步骤如下:\n\n**步骤 1: 查看当前 credential helper 配置**\n\n```bash\ngit config --global --list | grep credential\n```\n\n**步骤 2: 移除路径错误的 gh credential helper**\n\n```bash\ngit config --global --unset-all credential.https://github.com.helper\ngit config --global --unset-all credential.https://gist.github.com.helper\n```\n\n**步骤 3: 确保保留正确的 credential store**\n\n```bash\ngit config --global credential.helper store\n```\n\n**步骤 4: 确认 .git-credentials 里有有效 token**\n\n```bash\ncat ~/.git-credentials\n```\n\n**步骤 5: 验证**\n\n```bash\ngit ls-remote origin HEAD\n```\n\n如果没有报错,说明解决方案成功。\n\n**步骤 6: 验证配置**\n\n```bash\ngit config --global --list | grep credential\necho \"Verification passed: fix command exited 0\"\n```\n\n如果没有报错,说明验证成功。", "metrics": { "length": 727, "commands": 8, "command_list": [ "git config --global --list | grep credential", "git config --global --unset-all credential.https://github.com.helper", "git config --global --unset-all credential.https://gist.github.com.helper", "git config --global credential.helper store", "cat ~/.git-credentials" ], "has_command_block": true, "actionable": false, "inline_code_count": 11, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gh credential helper 路径Error导致 git push 静默失败 (git-credential-helper-gh-path-mismatch)", "condition": "plain", "status": 200, "content": "The error \"git-credential-helper-gh-path-mismatch\" occurs when the path to the GitHub credential helper is not correctly set. Here's a step-by-step fix:\n\n**Fix 1: Update the GitHub Credential Helper Path**\n\n1. Open your terminal or command prompt.\n2. Run the following command to update the path to the GitHub credential helper:\n ```bash\ngit config --global credential.helper path /usr/bin/git-credential-cache\n```\n If you're on Windows, replace `/usr/bin/git-credential-cache` with the path to the `git-credential-cache` executable on your system.\n\n**Fix 2: Verify the Path (Optional)**\n\n1. Run the following command to verify the path to the GitHub credential helper:\n ```bash\ngit config --global credential.helper path\n```\n This command should display the updated path.\n\n**Fix 3: Run `git push` Again**\n\n1. Try running `git push` again to see if the issue is resolved.\n\nIf you're still facing issues, you can try resetting the credential helper path to its default value:\n```bash\ngit config --global --unset credential.helper\n```\nThis will reset the credential helper path to its default value, which should resolve the issue", "metrics": { "length": 1136, "commands": 3, "command_list": [ "git config --global credential.helper path /usr/bin/git-credential-cache", "git config --global credential.helper path", "git config --global --unset credential.helper" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git 凭证Setup — Automation push 免密码 (git-credentials-automation)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"Git 凭证Setup — Automation push 免密码\" when running a script that automates a git push, you can follow these steps:\n\n**Step 1: Configure Git to use a non-interactive credential helper**\n\nOpen your terminal and run the following command to configure Git to use a non-interactive credential helper:\n```bash\ngit config --global credential.helper store\n```\nThis will store your credentials in a file instead of prompting you for input.\n\n**Step 2: Create a file to store your credentials**\n\nCreate a file named `.git-credentials` in your home directory (e.g., `~/.git-credentials`) with the following contents:\n```bash\nhttps://username:${GITHUB_TOKEN}@github.com\n```\nReplace `username` with your actual GitHub username and `GITHUB_TOKEN` with your personal access token (more on this later).\n\n**Step 3: Test the configuration**\n\nRun the following command to test the configuration:\n```bash\ngit ls-remote https://github.com/your-org/your-repo.git\n```\nThis should return the HEAD reference without prompting you for input.\n\n**Verification**\n\nTo verify that the fix worked, run the following command:\n```bash\ngit config --global credential", "metrics": { "length": 1145, "commands": 3, "command_list": [ "git config --global credential.helper store", "https://username:${GITHUB_TOKEN}@github.com", "git ls-remote https://github.com/your-org/your-repo.git" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 5, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git 凭证Setup — Automation push 免密码 (git-credentials-automation)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to Git not being able to find your credentials. To fix this, you can use the `git-credential-store` and `git credential store` commands to automate the process of storing your credentials. Here are the steps:\n\n**Step 1: Install the required packages**\n\nIf you're using a Linux or macOS system, you can install the required packages using the following commands:\n\n```bash\nsudo apt-get update\nsudo apt-get install git-credential-store\n```\n\nFor Windows, you can use the following commands:\n\n```bash\ngit config --global credential.helper store\ngit credential store --add --server https://github.com --username your-username --password your-password\n```\n\n**Step 2: Configure Git to use credential store**\n\nTo configure Git to use the credential store, you can run the following command:\n\n```bash\ngit config --global credential.helper store\n```\n\n**Step 3: Add your credentials to the credential store**\n\nTo add your credentials to the credential store, you can run the following command:\n\n```bash\ngit credential store --add --server https://github.com --username your-username --password your-password\n```\n\nReplace `your-username` and `your-password` with your", "metrics": { "length": 1198, "commands": 6, "command_list": [ "sudo apt-get update", "sudo apt-get install git-credential-store", "git config --global credential.helper store", "git credential store --add --server https://github.com --username your-username --password your-password", "git config --global credential.helper store" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 3, "lesson_hit_rate": 0.6 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push Force-With-Lease — Detached HEAD Recovery After Hash Change (git-force-with-lease-detached-head)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"Git Push Force-With-Lease — Detached HEAD Recovery After Hash Change\" (git-force-with-lease-detached-head), you need to use `git push --force-with-lease` instead of `git push --force`. This command checks that the remote ref is still at the commit you expect before overwriting.\n\nHere are the exact steps to follow:\n\n1. First, pull the latest changes from the remote repository to ensure you have the most up-to-date information.\n\n```bash\ngit pull origin feat/foo\n```\n\n2. Then, force-push your changes using `git push --force-with-lease`.\n\n```bash\ngit push --force-with-lease origin feat/foo\n```\n\nBy using `--force-with-lease`, Git will check that the remote ref is still at the commit you expect before overwriting it. If someone else has pushed in the meantime, Git will reject the push with an error message.\n\nNote that if you're using a Git version older than 2.24, you won't have the `--force-with-lease` option. In that case, you can use `--force` with the `--no-verify` option to achieve similar behavior:\n\n```bash\ngit push origin feat/foo --", "metrics": { "length": 1067, "commands": 2, "command_list": [ "git pull origin feat/foo", "git push --force-with-lease origin feat/foo" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push Force-With-Lease — Detached HEAD Recovery After Hash Change (git-force-with-lease-detached-head)", "condition": "plain", "status": 200, "content": "The error \"Git Push Force-With-Lease — Detached HEAD Recovery After Hash Change (git-force-with-lease-detached-head)\" occurs when you try to push a detached HEAD to a remote repository using the `--force-with-lease` option. This option is used to prevent accidental overwrites of remote branches.\n\nHere's a step-by-step fix:\n\n**Step 1: Identify the detached HEAD**\n\nFirst, check if your HEAD is detached:\n```bash\ngit status\n```\nThis will show you the current state of your repository. If your HEAD is detached, it should indicate that you're working on a new branch or have made changes to the current branch without checking out a new branch.\n\n**Step 2: Reset your HEAD to a valid branch**\n\nReset your HEAD to a valid branch, such as the master branch:\n```bash\ngit checkout master\n```\nAlternatively, you can reset your HEAD to the previous commit:\n```bash\ngit reset --hard HEAD~1\n```\nThis will move your HEAD to the previous commit, which should be a valid branch.\n\n**Step 3: Force-push your changes (if necessary)**\n\nIf you've made changes to your repository and want to push them to the remote repository, you'll need to", "metrics": { "length": 1123, "commands": 3, "command_list": [ "git status", "git checkout master", "git reset --hard HEAD~1" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git 合并ConflictHandling — 手动解决最佳实践 (git-merge-conflict-resolution)", "condition": "with_lesson", "status": 200, "content": "解决 Git 合并冲突时的最佳实践如下:\n\n**步骤 1:查看冲突文件**\n\n```bash\ngit status\n```\n\n**步骤 2:查看冲突的具体差异**\n\n```bash\ngit diff\n```\n\n**步骤 3:选择解决方法**\n\n### 3a. 快捷方式:直接选择某一方的完整版本\n\n```bash\ngit checkout --ours src/config.py\n```\n\n或\n\n```bash\ngit checkout --theirs src/config.py\n```\n\n这将保留当前分支(HEAD)的版本或合并进来的分支的版本。\n\n### 3b. 推荐方式:手动编辑,精确合并双方改动\n\n1. 打开编辑器,找到 <<<<<<< 标记。\n2. 手动决定最终内容。\n3. 删除 <<<<<<<、=======、>>>= 三行标记。\n4. 保存编辑。\n\n**步骤 4:确认文件中已无残留冲突标记**\n\n```bash\ngrep -rn \"<<<<<<\" src/\n```\n\n**步骤 5:标记为已解决**\n\n```bash\ngit add src/config.py\n", "metrics": { "length": 494, "commands": 5, "command_list": [ "git status", "git diff", "git checkout --ours src/config.py", "git checkout --theirs src/config.py", "grep -rn \"<<<<<<\" src/" ], "has_command_block": true, "actionable": false, "inline_code_count": 10, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git 合并ConflictHandling — 手动解决最佳实践 (git-merge-conflict-resolution)", "condition": "plain", "status": 200, "content": "Git 合并 ConflictHandling 是一个常见的错误,下面是如何手动解决它的最佳实践:\n\n1. **停止工作**:使用 `git checkout --theirs` 或 `git checkout --ours` 来停止工作并保留一个版本。\n\n ```bash\ngit checkout --theirs <文件名>\n```\n\n 或者\n\n ```bash\ngit checkout --ours <文件名>\n```\n\n2. **手动修改**:打开 conflicts.txt 文件并手动修改它。\n\n 例如:\n\n ```markdown\n# conflicts.txt\n<<<<<<< HEAD\n\n=======\n\n\n>>>>>>> current-branch-name\n```\n\n 例如:\n\n ```markdown\n# conflicts.txt\n<<<<<<< HEAD\n\n<<<<<<< HEAD\n\n>>>>>>> current-branch-name\n```\n\n3. **保存并提交**:使用 `git add` 和 `git commit` 来保存并提交修改。\n\n ```bash\ngit add .\ngit commit -m \"手动解决合并冲突\"\n```\n\n4. **合并**:使用 `git merge` 来合并两个分支。\n\n ", "metrics": { "length": 775, "commands": 4, "command_list": [ "git checkout --theirs <文件名>", "git checkout --ours <文件名>", "例如:", "3. **保存并提交**:使用 `git add` 和 `git commit` 来保存并提交修改。" ], "has_command_block": true, "actionable": false, "inline_code_count": 14, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub TLS 握手失败 — gnutls_handshake() Error (git-tls-handshake-failure)", "condition": "plain", "status": 200, "content": "The error you're experiencing, \"git-tls-handshake-failure,\" typically occurs when there's a problem with the TLS handshake between your Git client and the remote repository. Here's a step-by-step guide to resolve the issue:\n\n**Method 1: Update Git and GnuTLS**\n\n1. **Update Git**: Run the following command to ensure you have the latest version of Git installed.\n\n ```bash\ngit --version\n```\n\n If you're not on the latest version, update Git using the following command.\n\n ```bash\nsudo apt update && sudo apt install git -y\n```\n\n (For macOS users, use Homebrew to update Git.)\n\n ```bash\nbrew update && brew upgrade git\n```\n\n2. **Update GnuTLS**: GnuTLS is a dependency for Git. Run the following command to update GnuTLS.\n\n ```bash\nsudo apt update && sudo apt install libgnutls28-dev -y\n```\n\n (For macOS users, use Homebrew to update GnuTLS.)\n\n ```bash\nbrew update && brew install gnustl\n```\n\n**Method 2: Remove and Reinstall Git**\n\n1. **Remove Git**: Run the following command to remove Git", "metrics": { "length": 1017, "commands": 5, "command_list": [ "git --version", "sudo apt update && sudo apt install git -y", "brew update && brew upgrade git", "sudo apt update && sudo apt install libgnutls28-dev -y", "brew update && brew install gnustl" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub TLS 握手失败 — gnutls_handshake() Error (git-tls-handshake-failure)", "condition": "with_lesson", "status": 200, "content": "解决 GitHub TLS 握手失败 — gnutls_handshake() Error 的方法如下:\n\n### 步骤 1:重试(排除瞬时抖动)\n\n```bash\ngit pull origin main\n```\n\n### 步骤 2:检查并配置代理\n\n#### 1.查看当前 git 代理设置\n\n```bash\ngit config --global --list | grep proxy\n```\n\n#### 2.配置 git 走代理(如果使用代理)\n\n```bash\ngit config --global http.proxy http://127.0.0.1:7890\ngit config --global https.proxy http://127.0.0.1:7890\n```\n\n#### 3.清除错误的代理配置(如果不需要代理)\n\n```bash\ngit config --global --unset http.proxy\ngit config --global --unset https.proxy\n```\n\n### 步骤 3:更新 CA 证书\n\n#### 1. Debian / Ubuntu\n\n```bash\nsudo apt update && sudo apt install --reinstall ca-certificates\n```\n\n#### 2. RHEL / CentOS / Fedora\n\n```bash\nsudo update-ca-trust\n```\n\n### 步骤 4:切换", "metrics": { "length": 666, "commands": 8, "command_list": [ "git pull origin main", "git config --global --list | grep proxy", "git config --global http.proxy http://127.0.0.1:7890", "git config --global https.proxy http://127.0.0.1:7890", "git config --global --unset http.proxy" ], "has_command_block": true, "actionable": false, "inline_code_count": 11, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitGuardian 误报 Basic Auth String:教程里凭证占位符必须用尖括号,不写完整 user:pass@host (gitguardian-placeholder-url-credential-safe-form)", "condition": "plain", "status": 200, "content": "The error message is indicating that the placeholder for the Basic Auth credentials in your GitGuardian configuration is not properly formatted. The fix is to replace the placeholder with the correct syntax, which includes the `@` symbol.\n\nHere's a step-by-step guide to resolve the issue:\n\n1. Open your GitGuardian configuration file in a text editor. The file name may vary depending on your setup, but it's usually `gitguardian.yml` or `gitguardian.json`.\n\n2. Locate the section related to Basic Auth credentials. It should look something like this:\n\n```yml\nbasic_auth:\n username: user\n password: pass\n host: host\n```\n\n3. Replace the placeholder with the correct syntax:\n\n```yml\nbasic_auth:\n username: user\n password: pass\n host: user:pass@host\n```\n\nOr, if you prefer to use the credential-safe-form:\n\n```yml\nbasic_auth:\n username: user\n password: pass\n host: gitguardian-placeholder-url-credential-safe-form\n```\n\n4. Save the changes to the configuration file.\n\nAfter making these changes, GitGuardian should be able to properly parse the Basic Auth credentials from your configuration file.\n\nIf you", "metrics": { "length": 1111, "commands": 2, "command_list": [ "3. Replace the placeholder with the correct syntax:", "Or, if you prefer to use the credential-safe-form:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitGuardian 误报 Basic Auth String:教程里凭证占位符必须用尖括号,不写完整 user:pass@host (gitguardian-placeholder-url-credential-safe-form)", "condition": "with_lesson", "status": 200, "content": "To fix this issue, you'll need to update your GitGuardian configuration and lessons.json files. Here are the steps:\n\n**Step 1: Update lessons.json**\n\nOpen your lessons.json file and search for the `preview` field. Replace any occurrences of the following pattern:\n\n```json\n\"preview\": \"git push https://username:TOKEN@github.com/owner/repo.git\"\n```\n\nwith the following pattern:\n\n```json\n\"preview\": \"git push https://\npassword: bin/downloads/large-file\n\n# 生成 .version 标记文件\necho $(date +%Y-%m-%d-%H-%M-%S) > .version\n\n# 分段下载\nfor i in {0..5}; do\n start=$((i * 10485760))\n end=$(( (i + 1) * 10485760 - 1 ))\n curl -C - -R -o \"segment_$i\" \\\n \"https://ghproxy.net/https://github.com/owner/repo/releases/download/v1.0/large-file\" \\\n -H \"Range: bytes=$start-$end\" \\\n --retry 3 --retry-delay 5 &\ndone\n\n# 等待所有下载完成\nwait\n\n# 合并分段\ncat bin/downloads/segment_*. > bin/downloads/large-file\n\n# 校验\nsha256sum -c", "metrics": { "length": 668, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Release 大文件下载在 CN 网络超时:分段并行下载方案 (github-release-large-asset-download-cn)", "condition": "plain", "status": 200, "content": "The error message you're encountering is due to the GitHub release large asset download being timed out when downloading on Chinese networks. Here's a concrete, actionable fix:\n\n**Solution:**\n\n1. **Use a VPN:** Install a VPN (Virtual Private Network) on your device. A VPN will mask your IP address and make it appear as if you're accessing the internet from a different location. This can help bypass the network restrictions imposed by your ISP (Internet Service Provider) on Chinese networks.\n\n * For Windows: Download and install TunnelBear VPN. Create an account, then install the app and set it to connect automatically when you start your computer.\n * For macOS: Download and install ExpressVPN. Create an account, then install the app and set it to connect automatically when you start your computer.\n * For Linux: Download and install NordVPN. Create an account, then install the app and set it to connect automatically when you start your computer.\n\n2. **Use a proxy server:** Another alternative is to use a proxy server to bypass the network restrictions imposed by your ISP on Chinese networks.\n\n * For Windows: Download and install the \"Free Proxy\" software. Create an account, then install the software and set it to connect automatically", "metrics": { "length": 1275, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub sudo email OTP fails when the wrong input is filled (github-sudo-email-otp-wrong-input-field)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to the incorrect input in the GitHub sudo email OTP field. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Clear the OTP field**\n\nRun the following command in your terminal:\n```bash\necho -e \"\\033[2J\\033[H\" # Clear the terminal screen\n```\nThis will clear the OTP field.\n\n**Step 2: Re-enter the OTP**\n\nEnter the correct OTP code when prompted.\n\n**Step 3: Verify the OTP**\n\nIf you're still having trouble, you can try re-entering the OTP manually:\n```bash\ngit config --global user.password \n```\nReplace `` with your actual GitHub username.\n\n**Step 4: Add the OTP to the Git config**\n\nRun the following command to add the OTP to the Git config:\n```bash\ngit config --global user.password \"\"\n```\nReplace `` with the correct OTP code.\n\n**Step 5: Update the Git config**\n\nRun the following command to update the Git config:\n```bash\ngit config --global --list\n```\nThis will display the updated Git config.\n\n**Troubleshooting**\n\nIf you", "metrics": { "length": 1043, "commands": 4, "command_list": [ "echo -e \"\\033[2J\\033[H\" # Clear the terminal screen", "git config --global user.password ", "git config --global user.password \"\"", "git config --global --list" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub sudo email OTP fails when the wrong input is filled (github-sudo-email-otp-wrong-input-field)", "condition": "with_lesson", "status": 200, "content": "The issue you're facing is due to the hidden input fields on the GitHub sudo email verification page. To fix this, you need to target the hidden input fields specifically. Here's a concrete, actionable fix with exact commands using Playwright:\n\n```javascript\nconst playwright = require('playwright');\n\n(async () => {\n const browser = await playwright.chromium.launch();\n const page = await browser.newPage();\n\n // Navigate to the GitHub sudo email verification page\n await page.goto('https://github.com/login');\n\n // Click Verify via email\n await page.click('text=Verify via email');\n\n // Wait for the OTP code to be displayed\n await page.waitForSelector('#email-otp');\n\n // Get the OTP code from Gmail\n const otpCode = await page.$eval('#email-otp', (el) => el.textContent());\n\n // Fill the hidden input fields for CSRF and credential type\n await page.fill('#sudo-credential-options-github-mobile-csrf', '');\n await page.fill('#sudo-credential-options-totp-email-csrf', '');\n await page.fill('#authenticity_token', '');\n await page.fill('#sudo_return_to', '');\n await page.fill('#credential_type', '');\n\n // Fill the visible OTP", "metrics": { "length": 1146, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Glama MCP Server Deployment — 10 Build Failures and Fixes (glama-mcp-server-deploy-lessons)", "condition": "with_lesson", "status": 200, "content": "To fix the 10 build failures and fixes, you can follow these concrete, actionable steps:\n\n**Step 1: Use uv pip install instead of pip install**\n\n Replace `pip install` with `uv pip install` in your `setup.py` file.\n\n```python\n# Before\npip install -r requirements.txt\n\n# After\nuv pip install -r requirements.txt\n```\n\n**Step 2: Create a virtual environment using uv venv**\n\n Run the following command before installing dependencies:\n\n```bash\nuv venv myenv\n```\n\nThen, activate the virtual environment:\n\n```bash\nuv venv myenv/bin/activate\n```\n\n**Step 3: Don't use --system flag**\n\n Replace `pip install --system` with `pip install` in your `setup.py` file.\n\n```python\n# Before\npip install --system -r requirements.txt\n\n# After\npip install -r requirements.txt\n```\n\n**Step 4: Install the package using uv pip install -e .**\n\n Run the following command in your project directory:\n\n```bash\nuv pip install -e .\n```\n\nThis will install the package and its dependencies.\n\n**Additional Steps**\n\nAfter making these changes, you can re-deploy your Python MCP server to Gl", "metrics": { "length": 1056, "commands": 7, "command_list": [ "**Step 2: Create a virtual environment using uv venv**", "Run the following command before installing dependencies:", "Then, activate the virtual environment:", "**Step 3: Don't use --system flag**", "Replace `pip install --system` with `pip install` in your `setup.py` file." ], "has_command_block": true, "actionable": true, "inline_code_count": 15, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Go Scheduler Deadlock — Nested Lock Acquisition in gocron v1 (go-scheduler-deadlock-lock-order)", "condition": "with_lesson", "status": 200, "content": "To fix the deadlock issue, we need to ensure that the locks are released in the correct order. Here's the corrected code:\n\n```go\n// Original (fixed) code:\nfunc (s Scheduler) RemoveByID(job Job) error {\n // Release RLock before acquiring LLock\n s.jobsMutex.RUnlock()\n s.jobsMutex.Lock()\n defer s.jobsMutex.Unlock() // Lock held through entire function\n if _, ok := s.jobs[job.id]; ok {\n s.stopJob(job) // no longer holding jobsMutex.Lock!\n delete(s.jobs, job.id)\n return nil\n }\n return ErrJobNotFound\n}\n\nfunc (s Scheduler) runJobs() {\n // Release LLock before acquiring RLock\n s.jobsMutex.Unlock()\n s.jobsMutex.RLock()\n defer s.jobsMutex.RUnlock()\n for _, job := range s.jobs {\n // send job to executor...\n s.runContinuous(job)\n }\n}\n```\n\nIn the `RemoveByID` method, we first release the `RLock` using `s.jobsMutex.RUnlock()` before acquiring the `LLock` using `s.jobsMutex.Lock()`. This ensures that the `RLock` is released before the `LLock", "metrics": { "length": 1024, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Glama MCP Server Deployment — 10 Build Failures and Fixes (glama-mcp-server-deploy-lessons)", "condition": "plain", "status": 200, "content": "The error \"Glama MCP Server Deployment — 10 Build Failures and Fixes\" typically occurs when the deployment of the Glama MCP server fails due to various reasons such as configuration issues, missing dependencies, or incorrect settings. Here's a step-by-step guide to fix this issue:\n\n**Prerequisites:**\n\n* Ensure you have a clean and updated environment.\n* Make sure you have the latest version of the Glama MCP server and its dependencies.\n\n**Step 1: Check the Glama MCP Server Logs**\n\nTo identify the root cause of the issue, check the Glama MCP server logs for any errors or warnings:\n```bash\n# Navigate to the Glama MCP server logs directory\ncd /path/to/glama-mcp-server-logs\n\n# Check the latest log file for errors\ntail -f log.txt\n```\nThis will show you the latest log entries, which can help you identify the issue.\n\n**Step 2: Update the Glama MCP Server**\n\nEnsure you have the latest version of the Glama MCP server installed:\n```bash\n# Update the Glama MCP server package\nsudo apt-get update\nsudo apt-get upgrade -y glama-mcp-server\n```\n**Step 3: Check for Missing Dependencies**\n\nVerify that all required", "metrics": { "length": 1112, "commands": 4, "command_list": [ "cd /path/to/glama-mcp-server-logs", "tail -f log.txt", "sudo apt-get update", "sudo apt-get upgrade -y glama-mcp-server" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Go Scheduler Deadlock — Nested Lock Acquisition in gocron v1 (go-scheduler-deadlock-lock-order)", "condition": "plain", "status": 200, "content": "The \"Go Scheduler Deadlock — Nested Lock Acquisition\" error is typically caused by a deadlock situation in the Go scheduler. This error is usually a result of the way the scheduler handles goroutines and locks.\n\nHere's a concrete, actionable fix with exact commands to resolve the issue:\n\n**Step 1: Update gocron to the latest version**\n\nFirst, update gocron to the latest version using the following command:\n\n```bash\ngo get -u github.com/jroimartin/gocron\n```\n\n**Step 2: Update gocron to use the new lock order**\n\nThe new lock order in gocron v1 is designed to prevent deadlocks. To update gocron to use the new lock order, you need to update the `gocron.conf` file. Here's an example of how to do it:\n\n```bash\n# Create a new file called gocron.conf\necho \"schedule: 0 0 * * *\" > gocron.conf\n```\n\nThen, update the `gocron.conf` file to use the new lock order by adding the following lines:\n\n```bash\nlock:\n - main\n - job\n```\n\n**Step 3: Update the cron job to use the", "metrics": { "length": 968, "commands": 5, "command_list": [ "go get -u github.com/jroimartin/gocron", "echo \"schedule: 0 0 * * *\" > gocron.conf", "lock:", "- main", "- job" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Contribution Heartbeat Scan (heartbeat-scan-improvement)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to modify your GitHub Heartbeat Scan script to include the three required scans: opened PRs, claimed issues, and closed PRs. Here's an example of how you can modify your script:\n\n```bash\n#!/bin/bash\n\n# Set your GitHub username and token\nUSER=\"your-username\"\nTOKEN=\"your-github-token\"\n\n# Set the date for the closed PR scan (YYYY-MM-DD)\nCLOSED_PR_DATE=\"2023-03-01\"\n\n# Run the three scans\ngh search prs --author=$USER --state=open --limit=30\ngh search issues --involves=$USER --state=open --updated=$CLOSED_PR_DATE --limit=20\ngh search prs --author=$USER --state=closed --sort=updated --limit=10\n```\n\nMake sure to replace `your-username` and `your-github-token` with your actual GitHub username and token.\n\nIf you're using a script, you can also add some error handling to ensure that all three scans are successful:\n\n```bash\n#!/bin/bash\n\n# Set your GitHub username and token\nUSER=\"your-username\"\nTOKEN=\"your-github-token\"\n\n# Set the date for the closed PR scan (YYYY-MM", "metrics": { "length": 995, "commands": 6, "command_list": [ "USER=\"your-username\"", "TOKEN=\"your-github-token\"", "CLOSED_PR_DATE=\"2023-03-01\"", "gh search prs --author=$USER --state=open --limit=30", "gh search issues --involves=$USER --state=open --updated=$CLOSED_PR_DATE --limit=20" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Contribution Heartbeat Scan (heartbeat-scan-improvement)", "condition": "plain", "status": 200, "content": "To fix the GitHub Contribution Heartbeat Scan error, you'll need to update your `package.json` file to include the required `github-contribution-heartbeat` version. Here's a step-by-step solution:\n\n**Step 1: Install the required package**\n\nOpen your terminal and navigate to your project directory. Run the following command to install the required package:\n\n```bash\nnpm install github-contribution-heartbeat@latest\n```\n\nor if you're using yarn:\n\n```bash\nyarn add github-contribution-heartbeat@latest\n```\n\n**Step 2: Update the `package.json` file**\n\nOpen your `package.json` file in a text editor. Look for the `dependencies` or `devDependencies` section, which should contain the `github-contribution-heartbeat` package. Update the version number to `@latest`, which will install the latest version of the package.\n\nHere's an example of what the updated `package.json` file might look like:\n\n```json\n{\n \"name\": \"your-project-name\",\n \"version\": \"1.0.0\",\n \"description\": \"Your project description\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"node index.js\"\n },\n \"", "metrics": { "length": 1075, "commands": 2, "command_list": [ "npm install github-contribution-heartbeat@latest", "yarn add github-contribution-heartbeat@latest" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Hub Hermes 凭证体系 — Gateway vs Hub 各自读哪里 (hub-credential-gateway-vs-hub)", "condition": "plain", "status": 200, "content": "The error message you're encountering is likely due to a configuration issue with the Hub Hermes credential system. The error is suggesting that there's a difference between the gateway and hub credential systems.\n\nTo resolve this issue, you can try the following steps:\n\n1. Check the Hub Hermes configuration:\n - Open a terminal and navigate to the directory where your Hub Hermes configuration file is located.\n - Run the following command to check the configuration:\n ```bash\nhub config\n```\n This will display the current configuration of your Hub Hermes system.\n\n2. Check the credential system configuration:\n - Run the following command to check the credential system configuration:\n ```bash\nhub credential config\n```\n This will display the current configuration of your credential system.\n\n3. Check the gateway and hub configurations:\n - Run the following command to check the gateway configuration:\n ```bash\nhub gateway config\n```\n - Run the following command to check the hub configuration:\n ```bash\nhub hub config\n```\n These commands will display the current configuration of your gateway and hub systems.\n\n4. Update the configuration:\n - If you find any discrepancies between the gateway and hub configurations, you can update the configuration using the following command:\n ```bash\nhub config", "metrics": { "length": 1341, "commands": 4, "command_list": [ "hub config", "hub credential config", "hub gateway config", "hub hub config" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Hub Hermes 凭证体系 — Gateway vs Hub 各自读哪里 (hub-credential-gateway-vs-hub)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to set the `FEISHU_APP_SECRET` environment variable in the Hub configuration. Here are the steps:\n\n1. Open your terminal and navigate to the directory where your `config.yaml` file is located.\n2. Run the following command to set the `FEISHU_APP_SECRET` environment variable:\n ```bash\nexport FEISHU_APP_SECRET=\n```\n Replace `` with your actual Feishu App Secret.\n\n3. Update the `config.yaml` file by adding the following lines:\n ```yaml\nfeishu:\n app_id: \"\"\n app_secret: \"\"\n webhook_url: \"\"\nmaster:\n shared_secret: \"\"\n```\n Replace the placeholders with your actual Feishu App ID, App Secret, Webhook URL, and Shared Secret.\n\n4. Run the following command to verify that the configuration is correct:\n ```bash\nfeishu:\necho \"Verification passed: fix command exited 0\"\n```\n This command should complete without error, and then print \"Verification passed: fix command exited 0\".\n\nHere's the complete command sequence:\n\n```bash", "metrics": { "length": 1050, "commands": 5, "command_list": [ "export FEISHU_APP_SECRET=", "Replace the placeholders with your actual Feishu App ID, App Secret, Webhook URL, and Shared Secret.", "4. Run the following command to verify that the configuration is correct:", "This command should complete without error, and then print \"Verification passed: fix command exited 0\".", "Here's the complete command sequence:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "hub feishu wsclient start never called (hub-feishu-wsclient-start-never-called)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"hub feishu wsclient start never called (hub-feishu-wsclient-start-never-called)\", you need to add the following line of code to your `hermes_hub.py` file in the `start()` method:\n\n```python\nawait self.feishu_ws_client.start()\n```\n\nHere's how you can do it:\n\n1. Open your `hermes_hub.py` file in a text editor.\n2. Locate the `start()` method.\n3. Add the following line of code after `await self._register_handlers()`:\n\n```python\nawait self.feishu_ws_client.start()\n```\n\nHere's what the updated `start()` method should look like:\n\n```python\nasync def start(self):\n await self._load_config()\n await self._init_storage()\n await self._init_feishu_client()\n await self._init_vector_store()\n await self.feishu_ws_client.start()\n await self._register_handlers()\n self._start_background_tasks()\n```\n\nAfter making this change, save the file and run your hub again. The error should be resolved, and your hub should now establish a WebSocket connection with Feishu.", "metrics": { "length": 993, "commands": 5, "command_list": [ "Here's how you can do it:", "1. Open your `hermes_hub.py` file in a text editor.", "2. Locate the `start()` method.", "3. Add the following line of code after `await self._register_handlers()`:", "Here's what the updated `start()` method should look like:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "hub feishu wsclient start never called (hub-feishu-wsclient-start-never-called)", "condition": "plain", "status": 200, "content": "The error \"hub-feishu wsclient start never called\" typically indicates that the Feishu Websocket Client is not being started. This can be due to various reasons such as the client not being installed, or the client not being configured correctly.\n\nTo fix this issue, you can try the following steps:\n\n1. **Check if the Feishu Websocket Client is installed:**\n\n Run the following command to check if the Feishu Websocket Client is installed:\n ```bash\npip show hub-feishu-wsclient\n```\n If the client is not installed, run the following command to install it:\n ```bash\npip install hub-feishu-wsclient\n```\n\n2. **Check the configuration file:**\n\n The Feishu Websocket Client uses a configuration file to store its settings. The default configuration file is `~/.feishu/config.json`. Check if the configuration file is present and if it contains the required settings.\n\n If the configuration file is not present, create a new one using the following command:\n ```bash\nhub-feishu config create\n```\n Then, edit the configuration file using the following command:\n ```bash\nhub-feishu config edit\n```\n\n", "metrics": { "length": 1110, "commands": 4, "command_list": [ "pip show hub-feishu-wsclient", "pip install hub-feishu-wsclient", "hub-feishu config create", "hub-feishu config edit" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Auto-Welcome Newcomers via issue_comment Event (issue-comment-newbie-welcome)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to update the GitHub Actions workflow file (e.g., `.yml` file) to use the `github-script` action with the correct script and permissions.\n\nHere's the updated code:\n\n```yml\nname: Newbie Welcome\non:\n issue_comment:\n types: [created]\n\npermissions:\n issues: write\n pull-requests: read\n\njobs:\n welcome:\n if: |\n !github.event.issue.pull_request &&\n contains(github.event.issue.labels..name, 'good first issue') &&\n !contains(fromJSON('[\"MEMBER\", \"OWNER\", \"COLLABORATOR\"]'), github.event.comment.author_association)\n runs-on: ubuntu-latest\n steps:\n - name: Welcome Newcomer\n uses: actions/github-script@v7\n with:\n script: |\n const body = 'Welcome to MisakaNet!';\n\n You're commenting on a Good First Issue.\n\n 1. Read the CONTRIBUTING.md guide\n 2. Claim by commenting \\/claim\\ — 8h exclusive window\n 3. Implement with \\git commit -s\\\n 4. Submit a PR — CI audits automatically;\n\n await github", "metrics": { "length": 1045, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Auto-Welcome Newcomers via issue_comment Event (issue-comment-newbie-welcome)", "condition": "plain", "status": 200, "content": "To fix the error \"Auto-Welcome Newcomers via issue_comment Event (issue-comment-newbie-welcome)\", you'll need to create a new event listener that listens for the `issue_comment` event and sends a welcome message to the new user. Here's a step-by-step guide:\n\n**Step 1: Create a new event listener**\n\nIn your repository's `.gitignore` file, add the following line to ignore the `issue_comment_newbie_welcome` event listener:\n```bash\nissue-comment-newbie-welcome\n```\n**Step 2: Create a new event listener file**\n\nRun the following command to create a new file for the event listener:\n```bash\nmkdir issue-comment-newbie-welcome\ntouch issue-comment-newbie-welcome.js\n```\n**Step 3: Add the event listener code**\n\nIn the `issue-comment-newbie-welcome.js` file, add the following code:\n```javascript\nconst { Octokit } = require('@octokit/octokit');\n\nconst octokit = new Octokit({\n baseUrl: 'https://api.github.com',\n accessToken: 'YOUR_GITHUB_TOKEN',\n});\n\nasync function welcomeNewcomer(comment) {\n const issue = await octokit.issues.getAll({ owner: 'YOUR_RE", "metrics": { "length": 1054, "commands": 3, "command_list": [ "issue-comment-newbie-welcome", "mkdir issue-comment-newbie-welcome", "touch issue-comment-newbie-welcome.js" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "同义词扩展陷阱:jieba.add_word() 改变全局分词行为导致回归 (jieba-synonym-expansion-pitfall)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the fact that `jieba.add_word()` modifies the global tokenizer behavior, which can lead to unexpected results. Here's a concrete, actionable fix:\n\n**Solution:**\n\nInstead of using `jieba.add_word()`, use `jieba.add_symbol()` to add custom symbols to your vocabulary.\n\n```python\nimport jieba\n\n# Create a new tokenizer\ntokenizer = jieba.Jieba()\n\n# Add custom symbols to the tokenizer\ntokenizer.add_symbol('custom_symbol')\n\n# Use the tokenizer to perform tokenization\ntext = \"This is a custom symbol test\"\ntokens = tokenizer.cut(text)\n\nprint(tokens)\n```\n\n**Explanation:**\n\n* We create a new tokenizer instance using `jieba.Jieba()`.\n* We add a custom symbol to the tokenizer using `tokenizer.add_symbol('custom_symbol')`.\n* We use the tokenizer to perform tokenization on a sample text.\n* The resulting tokens are printed to the console.\n\n**Note:** If you want to add multiple custom symbols, you can call `add_symbol()` multiple times.\n\n```python\ntokenizer.add_symbol('custom_symbol1')\ntokenizer.add_symbol('custom_symbol2')\n```\n\nBy using `add_symbol()` instead of `add_word", "metrics": { "length": 1119, "commands": 6, "command_list": [ "**Explanation:**", "* We create a new tokenizer instance using `jieba.Jieba()`.", "* We add a custom symbol to the tokenizer using `tokenizer.add_symbol('custom_symbol')`.", "* We use the tokenizer to perform tokenization on a sample text.", "* The resulting tokens are printed to the console." ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "同义词扩展陷阱:jieba.add_word() 改变全局分词行为导致回归 (jieba-synonym-expansion-pitfall)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you can create a separate JSON file to store the synonyms and use it to expand the queries. Here's how you can do it:\n\nFirst, create a new file called `synonyms.json` in the same directory as your Python script:\n\n```json\n{\n \"手机\": [\"电话\", \"移动设备\", \"智能手机\"],\n \"电脑\": [\"计算机\", \"PC\", \"笔记本\"]\n}\n```\n\nNext, modify your Python script to use the `synonyms.json` file:\n\n```python\nimport json\nfrom jieba import Jieba\n\n# Load synonyms from JSON file\nwith open('synonyms.json', 'r', encoding='utf-8') as f:\n synonyms = json.load(f)\n\n# Initialize Jieba\njieba = Jieba()\n\ndef expand_query_with_synonyms(query, synonyms):\n expanded = [query]\n for word, syns in synonyms.items():\n if word in query:\n expanded.extend(syns)\n return expanded\n\ndef main():\n query = input(\"Enter a query: \")\n expanded_query = expand_query_with_synonyms(query, synonyms)\n print(\"Expanded query:\", expanded_query)\n\nif __name__ == \"__main__\":\n main", "metrics": { "length": 962, "commands": 1, "command_list": [ "Next, modify your Python script to use the `synonyms.json` file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "JSON 解析失败Handling — 截断 / 格式Error (json-parse-failure-handling)", "condition": "with_lesson", "status": 200, "content": "To fix the `JSON 解析失败Handling — 截断 / 格式Error` issue, you can try the following steps:\n\n### Step 1: Update the `model_output` variable\n\nMake sure the `model_output` variable contains the complete and formatted JSON data. If the output is truncated, you can try to get the full output from the model or API.\n\n```bash\n# Get the full output from the model or API\nmodel_output=$(model_output)\n```\n\n### Step 2: Use the `safe_json_parse` function\n\nReplace the original code with the `safe_json_parse` function:\n\n```python\nimport json\nimport re\n\ndef safe_json_parse(text: str) -> dict | None:\n \"\"\"尝试多种策略解析 JSON\"\"\"\n \n try:\n return json.loads(text)\n except json.JSONDecodeError:\n pass\n \n m = re.search(r'(?:json)?\\s\\n?(.?)\\n?', text, re.DOTALL)\n if m:\n try:\n return json.loads(m.group(1))\n except json.JSONDecodeError:\n pass\n \n m = re.search(r'(\\{.\\})', text, re.DOTALL)\n if m:\n ", "metrics": { "length": 955, "commands": 1, "command_list": [ "model_output=$(model_output)" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "JSON 解析失败Handling — 截断 / 格式Error (json-parse-failure-handling)", "condition": "plain", "status": 200, "content": "The error message \"JSON 解析失败Handling — 截断 / 格式Error (json-parse-failure-handling)\" is a translation of \"JSON parsing failed - Handling: Cutting / Format Error\" in English. This error typically occurs when there's an issue with the JSON data being parsed, such as a missing closing bracket or a mismatched quote.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Method 1: Using `jq` command**\n\nIf you're using a Linux or macOS system, you can use the `jq` command to parse and fix the JSON data.\n\n1. Install `jq` if you haven't already: `sudo apt-get install jq` (for Ubuntu-based systems) or `brew install jq` (for macOS).\n2. Use `jq` to parse the JSON data and fix the errors:\n\n```bash\njq '.' your_json_file.json\n```\n\nThis command will print the parsed JSON data with any errors fixed.\n\n**Method 2: Using `jsonlint` command**\n\nAlternatively, you can use the `jsonlint` command to validate and fix the JSON data.\n\n1. Install `jsonlint` if you haven't already: `sudo apt-get install jsonlint` (for Ubuntu-based systems) or `", "metrics": { "length": 1033, "commands": 1, "command_list": [ "jq '.' your_json_file.json" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Knowledge Base 4-Sigma Quality Audit Pipeline (kb-4sigma-quality-audit-pipeline)", "condition": "with_lesson", "status": 200, "content": "To implement the 4σ quality audit pipeline, we'll use Python with the following libraries:\n\n- `pandas` for data manipulation\n- `os` for file system operations\n- `datetime` for timestamping\n- `json` for storing reports\n\nHere's a step-by-step guide to fix the issue:\n\n**Step 1: Install required libraries**\n\n```bash\npip install pandas os datetime json\n```\n\n**Step 2: Create a directory for audit reports**\n\n```bash\nmkdir ~/audit_reports\n```\n\n**Step 3: Create a Python script (daily_audit.py) for the quality audit pipeline**\n\n```python\nimport os\nimport pandas as pd\nimport datetime\nimport json\n\n# Define constants\nAUDIT_DIR = \"~/audit_reports\"\nREPORT_NAME = \"audit_\"\nCSV_FILE = \"daily_audit.csv\"\n\n# Function to clean up non-document content\ndef clean_document(content):\n # Remove garbled text, empty chunks, and numeric-only chunks\n content = content.replace(\"\\n\", \" \")\n content = content.replace(\"\\t\", \" \")\n content = content.replace(\" \", \"\")\n return content\n\n# Function to deduplicate documents by filename and import time\ndef deduplicate_documents(df):\n # Group by filename", "metrics": { "length": 1092, "commands": 2, "command_list": [ "pip install pandas os datetime json", "mkdir ~/audit_reports" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Knowledge Base 4-Sigma Quality Audit Pipeline (kb-4sigma-quality-audit-pipeline)", "condition": "plain", "status": 200, "content": "To fix the error, we'll assume that the error is related to a missing or incorrect configuration file for the Knowledge Base 4-Sigma Quality Audit Pipeline. Here's a step-by-step guide with exact commands to resolve the issue:\n\n**Step 1: Check the Pipeline Configuration**\n\n1. Navigate to the pipeline directory: `cd /path/to/kb-4sigma-quality-audit-pipeline`\n2. Run the following command to check the pipeline configuration: `kubectl get deployments -n -l app=kb-4sigma-quality-audit-pipeline`\n\nReplace `` with the actual namespace where your pipeline is running.\n\n**Step 2: Check for Missing Configuration Files**\n\n1. Run the following command to check for missing configuration files: `kubectl get configmaps -n -l app=kb-4sigma-quality-audit-pipeline`\n\nReplace `` with the actual namespace where your pipeline is running.\n\nIf you find any missing configuration files, you can create them using the following commands:\n\n```bash\nkubectl create configmap kb-4sigma-quality-audit-pipeline-config --from-file=KB4SIGMA Quality Audit Pipeline Configuration=kb-4sigma-quality-audit-pipeline.yaml\nkubectl create configmap kb-", "metrics": { "length": 1166, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "knowledge graph ux patterns from high star projects (knowledge-graph-ux-patterns-from-high-star-projects)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to make sure that your knowledge graph visualization is properly handling the balance between global overview and local details. Here are some concrete, actionable steps with exact commands to help you achieve this:\n\n**Step 1: Implement Progressive Disclosure**\n\nAdd the following code to your JavaScript file to implement progressive disclosure:\n\n```javascript\n// Define a function to get the neighbors of a node\nfunction getNHopNeighbors(nodeId, hops, edges) {\n const visited = new Set([nodeId]);\n let frontier = [nodeId];\n for (let i = 0; i < hops; i++) {\n const next = new Set();\n frontier.forEach(id => {\n edges.forEach(edge => {\n const sid = edge.source?.id || edge.source;\n const tid = edge.target?.id || edge.target;\n if (sid === id && !visited.has(tid)) next.add(tid);\n if (tid === id && !visited.has(sid)) next.add(sid);\n });\n });\n frontier = [...next];\n }\n return visited;\n}\n\n// Define a function to get the category of a node\nfunction getCategory(node) {\n // Implement your logic to get the category of a node\n // For example, you can", "metrics": { "length": 1130, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "knowledge graph ux patterns from high star projects (knowledge-graph-ux-patterns-from-high-star-projects)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing `requirements.txt` file or a version mismatch in your `setup.py` file. Here's a step-by-step guide to fixing the issue:\n\n**Step 1: Create a `requirements.txt` file**\n\nOpen a terminal and navigate to your project directory. Run the following command to generate a `requirements.txt` file:\n```bash\npip freeze > requirements.txt\n```\nThis command will list all the packages installed in your Python environment, including their versions.\n\n**Step 2: Update `setup.py`**\n\nIf your `setup.py` file is not present, create a new one with the following content:\n```python\nfrom setuptools import setup\n\nsetup(\n name='knowledge-graph-ux-patterns-from-high-star-projects',\n version='0.0.1',\n packages=['knowledge_graph_ux_patterns'],\n install_requires=[\n 'numpy',\n 'pandas',\n 'scikit-learn',\n # Add other dependencies here\n ],\n)\n```\nReplace `numpy`, `pandas`, and `scikit-learn` with the actual dependencies required by your project.\n\n**Step 3: Install dependencies**\n\nRun the following command to install the dependencies listed in `requirements.txt`", "metrics": { "length": 1137, "commands": 1, "command_list": [ "pip freeze > requirements.txt" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Tips for Debugging Kubernetes CrashLoopBackOff in a Container (kubernetes-crashloopbackoff-debugging)", "condition": "with_lesson", "status": 200, "content": "To debug a Kubernetes CrashLoopBackOff issue, you need to identify the root cause. Based on the provided lesson, the two common problems when starting a container are:\n\n1. OCI runtime create failed: References a binary or script that doesn't exist on the container (Exit Code 127)\n2. Container \"Completed\" or \"Error\": The code executing on the container failed to run a service and stay running (Exit Code 1)\n\nHere's a concrete, actionable fix with exact commands:\n\n### Step 1: Identify Docker Entrypoint and Cmd\n\nSince you lack the Dockerfile, pull and inspect the image locally:\n\n```bash\n# Pull the Elasticsearch image\ndocker pull docker.elastic.co/elasticsearch/elasticsearch:7.10.2\n\n# Inspect the image and extract the Entrypoint and Cmd\ndocker inspect docker.elastic.co/elasticsearch/elasticsearch:7.10.2 | jq '.[0].ContainerConfig.Entrypoint'\ndocker inspect docker.elastic.co/elasticsearch/elasticsearch:7.10.2 | jq '.[0].ContainerConfig.Cmd'\n```\n\n### Step 2: Override Container Entrypoint for Debugging\n\nUpdate the deployment to replace the container entrypoint with `tail -f /dev/null`", "metrics": { "length": 1093, "commands": 3, "command_list": [ "docker pull docker.elastic.co/elasticsearch/elasticsearch:7.10.2", "docker inspect docker.elastic.co/elasticsearch/elasticsearch:7.10.2 | jq '.[0].ContainerConfig.Entrypoint'", "docker inspect docker.elastic.co/elasticsearch/elasticsearch:7.10.2 | jq '.[0].ContainerConfig.Cmd'" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ubuntu WSL Python venv Missing pip — uv venv --seed Fixes Without sudo (lesson-07-uv-venv-seed-fix-no-pip)", "condition": "with_lesson", "status": 200, "content": "The issue you're facing is due to the stripped Python package on Ubuntu WSL, which doesn't include pip by default. To fix this, you can use the following steps:\n\n**Step 1: Install `python3-pip`**\n\nSince `python3-pip` is not installed, you can install it using the following command:\n\n```bash\nsudo apt install python3-pip\n```\n\n**Step 2: Verify the installation**\n\nAfter installation, verify that pip is installed correctly by running:\n\n```bash\npython3 -m pip --version\n```\n\nYou should see the version of pip installed.\n\n**Step 3: Create a new virtual environment**\n\nNow that pip is installed, you can create a new virtual environment using the following command:\n\n```bash\npython3 -m venv ~/.agent-reach-venv\n```\n\n**Step 4: Activate the virtual environment**\n\nTo activate the virtual environment, run:\n\n```bash\nsource ~/.agent-reach-venv/bin/activate\n```\n\nYou should see the virtual environment name printed in your terminal, indicating that it's active.\n\nThat's it! You should now be able to use pip within your virtual environment.\n\nHere are the exact commands you can use:\n\n```bash\n#", "metrics": { "length": 1084, "commands": 4, "command_list": [ "sudo apt install python3-pip", "python3 -m pip --version", "python3 -m venv ~/.agent-reach-venv", "source ~/.agent-reach-venv/bin/activate" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Tips for Debugging Kubernetes CrashLoopBackOff in a Container (kubernetes-crashloopbackoff-debugging)", "condition": "plain", "status": 200, "content": "The \"CrashLoopBackOff\" error in Kubernetes occurs when a pod is repeatedly restarted due to a container crashing. Here's a concrete, actionable fix to debug and resolve this issue.\n\n**Step 1: Get the pod details**\n\nUse the following command to get the pod details:\n```bash\nkubectl get pod -o yaml\n```\nReplace `` with the actual name of the pod.\n\n**Step 2: Check the container logs**\n\nUse the following command to get the container logs:\n```bash\nkubectl logs -c \n```\nReplace `` with the actual name of the pod and `` with the actual name of the container that's crashing.\n\n**Step 3: Check the container restart policy**\n\nUse the following command to check the container restart policy:\n```bash\nkubectl get pod -o yaml | grep restartPolicy\n```\nThis will show you the restart policy of the pod.\n\n**Step 4: Check the pod's status**\n\nUse the following command to check the pod's status:\n```bash\nkubectl get pod -o yaml\n```\nThis will show you the pod's status, including any error messages", "metrics": { "length": 1079, "commands": 4, "command_list": [ "kubectl get pod -o yaml", "kubectl logs -c ", "kubectl get pod -o yaml | grep restartPolicy", "kubectl get pod -o yaml" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ubuntu WSL Python venv Missing pip — uv venv --seed Fixes Without sudo (lesson-07-uv-venv-seed-fix-no-pip)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the Python version in your WSL (Windows Subsystem for Linux) environment not having a `pip` package. Here's a step-by-step solution to fix the issue:\n\n**Method 1: Update and Install pip using `python` command**\n\n1. Open your WSL terminal.\n2. Update the package list: `sudo apt update`\n3. Install the `python3` package (if not already installed): `sudo apt install python3`\n4. Install `pip` using the `python3` command: `python3 -m ensurepip`\n5. Verify that `pip` has been installed successfully: `pip3 --version`\n\n**Method 2: Install `pip` using `python3 -m venv`**\n\n1. Create a new virtual environment using `python3 -m venv`:\n ```bash\npython3 -m venv myenv\n```\n Replace `myenv` with the name of your choice.\n2. Activate the virtual environment:\n ```bash\nsource myenv/bin/activate\n```\n (On Ubuntu-based WSL, use `source myenv/bin/activate` instead of `myenv\\Scripts\\activate`)\n3. Install `pip", "metrics": { "length": 941, "commands": 2, "command_list": [ "python3 -m venv myenv", "source myenv/bin/activate" ], "has_command_block": true, "actionable": true, "inline_code_count": 20, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "pip install HTTPS Timeout from WSL — Prepend HTTPS_PROXY=http://172.19.128.1:7890 (lesson-08-pip-https-proxy-clash)", "condition": "with_lesson", "status": 200, "content": "The issue you're facing is due to pip not automatically reading the HTTPS proxy settings, unlike curl. To fix this, you can manually specify the HTTPS proxy in the pip configuration file.\n\nHere are the steps:\n\n1. Open the `~/.pip/pip.conf` file in a text editor:\n ```bash\nnano ~/.pip/pip.conf\n```\n2. Add the following line to the end of the file:\n ```\n[global]\nhttps_proxy = http://172.19.128.1:7890\n```\n Replace `http://172.19.128.1:7890` with your actual proxy URL.\n\n3. Save and close the file.\n\n4. Update pip to read the new configuration:\n ```bash\npip install --upgrade pip\n```\n\n5. Verify that pip is now using the proxy by trying to install the package again:\n ```bash\npip install https://github.com/Panniantong/agent-reach/archive/main.zip\n```\n\nThis should resolve the timeout issue and allow pip to install the package successfully.", "metrics": { "length": 849, "commands": 5, "command_list": [ "nano ~/.pip/pip.conf", "[global]", "https_proxy = http://172.19.128.1:7890", "pip install --upgrade pip", "pip install https://github.com/Panniantong/agent-reach/archive/main.zip" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "pip install HTTPS Timeout from WSL — Prepend HTTPS_PROXY=http://172.19.128.1:7890 (lesson-08-pip-https-proxy-clash)", "condition": "plain", "status": 200, "content": "To resolve the HTTPS timeout issue when installing packages using pip with an HTTPS proxy, you can use the following command:\n\n```bash\npip install --proxy http://172.19.128.1:7890 package_name\n```\n\nHowever, if you're using a virtual environment, make sure to activate it before running the command. \n\nHere's an example with a virtual environment:\n\n```bash\n# Activate the virtual environment\nsource myenv/bin/activate\n\n# Install the package with the HTTPS proxy\npip install --proxy http://172.19.128.1:7890 package_name\n```\n\nIf you're using a Windows Subsystem for Linux (WSL), you might need to use the following command instead:\n\n```bash\n# Activate the virtual environment\nsource myenv/bin/activate\n\n# Install the package with the HTTPS proxy\npip install --proxy http://172.19.128.1:7890 package_name\n```\n\nMake sure to replace `myenv` with the name of your virtual environment and `package_name` with the name of the package you're trying to install.\n\nAlso, note that you should use `http://` instead of `https://` in the proxy URL, as HTTPS is not supported in WSL.\n\n", "metrics": { "length": 1069, "commands": 5, "command_list": [ "pip install --proxy http://172.19.128.1:7890 package_name", "source myenv/bin/activate", "pip install --proxy http://172.19.128.1:7890 package_name", "source myenv/bin/activate", "pip install --proxy http://172.19.128.1:7890 package_name" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "V2EX API /api/topics/show.json Unstable — Use r.jina.ai Instead (lesson-09-v2ex-api-show-endpoint-unstable)", "condition": "with_lesson", "status": 200, "content": "The error message is indicating that the `/api/topics/show.json` endpoint is unstable and should be replaced with `r.jina.ai`. However, it seems like you're trying to scrape V2EX topic details programmatically. Here's a concrete, actionable fix with exact commands to scrape topic details using `r.jina.ai`:\n\n**Step 1: Install required libraries**\n\n```bash\npip install jina\n```\n\n**Step 2: Create a new Python script**\n\nCreate a new Python file (e.g., `v2ex_scrape.py`) and add the following code:\n\n```python\nimport requests\nfrom jina import Client\n\n# Set API endpoint and credentials\nurl = \"https://r.jina.ai\"\nusername = \"your_username\"\npassword = \"your_password\"\n\n# Create a Jina client\nclient = Client()\n\n# Set the topic ID\ntopic_id = \"1224558\"\n\n# Get the session cookie\nsession = requests.Session()\nresponse = session.get(url, auth=(username, password))\nsession_cookie = response.cookies.get('JSESSIONID')\n\n# Set the headers\nheaders = {\n 'Cookie': f'JSESSIONID={session_cookie}',\n 'Accept': 'application/json'\n}\n\n# Get the topic details\n", "metrics": { "length": 1046, "commands": 1, "command_list": [ "pip install jina" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Commit Signing — GPG 防止提交伪造 (lesson-11-github-commit-signing)", "condition": "with_lesson", "status": 200, "content": "To fix the GitHub Commit Signing issue, you need to set up GPG signing for your Git commits. Here's a step-by-step guide with exact commands:\n\n**Step 1: Generate a new GPG key pair**\n\nOpen a terminal and run the following command to generate a new GPG key pair:\n```bash\ngpg --full-generate-key\n```\nThis will create a new GPG key pair in the default location (`~/.gnupg/`).\n\n**Step 2: Get your GPG key ID**\n\nRun the following command to get your GPG key ID:\n```bash\ngpg --list-secret-keys --keyid-format=long\n```\nThis will display your GPG key ID, which should be in the format `ed25519/XXXXXXXXXXXXXXXX`.\n\n**Step 3: Export your GPG public key**\n\nRun the following command to export your GPG public key:\n```bash\ngpg --armor --export XXXXXXXXXXXXXXXX\n```\nReplace `XXXXXXXXXXXXXXXX` with your actual GPG public key ID.\n\n**Step 4: Add your GPG public key to GitHub**\n\nLog in to your GitHub account and go to **Settings** > **SSH and GPG keys**. Click **New SSH key", "metrics": { "length": 960, "commands": 3, "command_list": [ "gpg --full-generate-key", "gpg --list-secret-keys --keyid-format=long", "gpg --armor --export XXXXXXXXXXXXXXXX" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "V2EX API /api/topics/show.json Unstable — Use r.jina.ai Instead (lesson-09-v2ex-api-show-endpoint-unstable)", "condition": "plain", "status": 200, "content": "The error message is indicating that the `/api/topics/show.json` endpoint in the V2EX API is unstable and should be replaced with `r.jina.ai`. This is likely due to changes in the V2EX API.\n\nHere's a concrete and actionable fix:\n\n**Step 1: Update your code**\n\nReplace the line of code that makes the GET request to the `/api/topics/show.json` endpoint with the following:\n```python\nimport requests\n\nresponse = requests.get('https://r.jina.ai/api/topics/show.json')\n```\nOr, if you're using a library like `aiohttp`:\n```python\nimport aiohttp\n\nasync def get_topic():\n async with aiohttp.ClientSession() as session:\n async with session.get('https://r.jina.ai/api/topics/show.json') as response:\n return await response.json()\n```\n\n**Step 2: Update your API client (if applicable)**\n\nIf you're using a library like `requests` or `aiohttp` to interact with the V2EX API, you may need to update the API client to point to the new endpoint.\n\nFor example, with `requests`, you can update the `url` parameter in the `requests.get()` method:\n```python\n", "metrics": { "length": 1061, "commands": 4, "command_list": [ "Or, if you're using a library like `aiohttp`:", "**Step 2: Update your API client (if applicable)**", "If you're using a library like `requests` or `aiohttp` to interact with the V2EX API, you may need to update the API client to point to the new endpoint.", "For example, with `requests`, you can update the `url` parameter in the `requests.get()` method:" ], "has_command_block": true, "actionable": false, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub Commit Signing — GPG 防止提交伪造 (lesson-11-github-commit-signing)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or invalid GPG key. To fix this, follow these steps:\n\n**Step 1: Generate a new GPG key**\n\nIf you haven't already, generate a new GPG key pair using the following command:\n\n```bash\ngpg --full-generate-key\n```\n\nFollow the prompts to create a new key pair. You'll be asked to choose a key type (e.g., RSA or elliptic curve). Choose one of the options, and then confirm your decision.\n\n**Step 2: Add the new GPG key to your GitHub settings**\n\nOnce you have your new GPG key pair, add it to your GitHub settings. To do this, follow these steps:\n\n1. Log in to your GitHub account and navigate to your profile page.\n2. Click on the \"Settings\" icon (gear icon) and select \"GitHub Settings\" from the dropdown menu.\n3. Scroll down to the \"Account\" section and click on \"SSH and GPG keys\".\n4. Click on the \"New SSH key\" button.\n5. Give your new key a name (e.g., \"My GPG Key\") and paste the contents of your public GPG key (you can find this in the", "metrics": { "length": 994, "commands": 1, "command_list": [ "gpg --full-generate-key" ], "has_command_block": true, "actionable": false, "inline_code_count": 1, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 分页设计 — Cursor vs Offset vs Keyset (lesson-14-api-pagination-design)", "condition": "plain", "status": 200, "content": "I don't see any error in your prompt. However, I'll provide a general solution for API pagination design using cursor, offset, and keyset.\n\nLet's assume you're using Node.js and Express.js to create an API. We'll create a simple example of a user endpoint with pagination using cursor, offset, and keyset.\n\n**Database Setup**\n\nWe'll use a simple in-memory database to store our users. In a real-world scenario, you'd use a database like MongoDB or PostgreSQL.\n\n```javascript\n// users.js\nconst users = [\n { id: 1, name: 'John Doe' },\n { id: 2, name: 'Jane Doe' },\n { id: 3, name: 'Bob Smith' },\n { id: 4, name: 'Alice Johnson' },\n { id: 5, name: 'Mike Brown' },\n];\n\nmodule.exports = users;\n```\n\n**API Endpoint with Cursor**\n\nTo implement cursor-based pagination, we need to store the cursor (or token) in our database.\n\n```javascript\n// users.controller.js\nconst express = require('express');\nconst router = express.Router();\nconst users = require('./users');\n\nrouter.get('/users', async (req, res) =>", "metrics": { "length": 1005, "commands": 2, "command_list": [ "**API Endpoint with Cursor**", "To implement cursor-based pagination, we need to store the cursor (or token) in our database." ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 分页设计 — Cursor vs Offset vs Keyset (lesson-14-api-pagination-design)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with the API pagination design, we need to use the Cursor approach. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the database schema**\n\nAdd a new column `cursor_id` to the `posts` table:\n```sql\nALTER TABLE posts ADD COLUMN cursor_id VARCHAR(255) DEFAULT '';\n```\n**Step 2: Update the API endpoint**\n\nUpdate the API endpoint to accept a `cursor` parameter:\n```bash\nGET /api/posts?cursor=\n```\n**Step 3: Update the database query**\n\nUpdate the database query to use the `cursor_id` column:\n```sql\nSELECT FROM posts \nWHERE (created_at, id) < (%s, %s)\nORDER BY created_at DESC, id DESC\nLIMIT %s\n```\n**Step 4: Update the API function**\n\nUpdate the API function to use the `cursor_id` column:\n```python\ndef get_posts(cursor=None, limit=20):\n if cursor:\n query = \"\"\"\n SELECT FROM posts \n WHERE (created_at, id) < (%s, %s)\n ORDER BY created_at DESC, id DESC\n LIMIT %s\n \"\"\"\n results = db.execute(query, [", "metrics": { "length": 1008, "commands": 6, "command_list": [ "**Step 2: Update the API endpoint**", "Update the API endpoint to accept a `cursor` parameter:", "**Step 3: Update the database query**", "Update the database query to use the `cursor_id` column:", "**Step 4: Update the API function**" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Workflows — 持久化多步骤执行 (lesson-15-cloudflare-workflows-durable)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is likely due to the missing import statement for the `step` object in your Cloudflare Workflow code. Here's a concrete, actionable fix:\n\n**Step 1: Install required dependencies**\n\nRun the following command in your terminal:\n```bash\nnpm install @cloudflare/workflows\n```\nThis will install the `@cloudflare/workflows` package, which provides the `step` object and other necessary functionality for Cloudflare Workflows.\n\n**Step 2: Update your code**\n\nReplace the contents of your `run.js` file with the following code:\n```javascript\nconst { Step } = require('@cloudflare/workflows');\n\n// Define the persistent workflow\nexport default {\n async run(event, step) {\n // Step 1: Persistent execution (auto-retry, state persistence)\n const userData = await step.do(\"fetch-user\", async () => {\n return await fetch(`https://api.example.com/users/${event.userId}`);\n });\n\n // Step 2: Process data\n const processed = await step.do(\"process-data\", async () => {\n return await processData(userData);\n });\n\n // Step 3: Save result\n await step.do(\"save-result\", async () => {\n await saveToDatabase", "metrics": { "length": 1152, "commands": 1, "command_list": [ "npm install @cloudflare/workflows" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Workflows — 持久化多步骤执行 (lesson-15-cloudflare-workflows-durable)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or invalid `id` property in your Cloudflare Workflow. Here's a step-by-step solution to fix the issue:\n\n**Step 1: Check your Workflow configuration**\n\nOpen your Cloudflare Workflow in the Cloudflare dashboard. Make sure that you have a valid `id` property in the `workflow` object.\n\n```json\n{\n \"id\": \"your-workflow-id\",\n \"name\": \"your-workflow-name\",\n \"type\": \"durable\",\n \"steps\": [\n // your steps here\n ]\n}\n```\n\n**Step 2: Update your Workflow configuration**\n\nIf you don't have an `id` property, add it to your Workflow configuration. Here's an example:\n```json\n{\n \"id\": \"your-workflow-id\",\n \"name\": \"your-workflow-name\",\n \"type\": \"durable\",\n \"steps\": [\n {\n \"id\": \"step-1\",\n \"name\": \"step-1\",\n \"type\": \"http\",\n \"method\": \"GET\",\n \"url\": \"https://example.com\"\n },\n {\n \"id\": \"step-2\",\n \"name\": \"step-", "metrics": { "length": 911, "commands": 2, "command_list": [ "**Step 2: Update your Workflow configuration**", "If you don't have an `id` property, add it to your Workflow configuration. Here's an example:" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AWS ECS 高分辨率指标 — 更快的自动扩缩容 (lesson-16-aws-ecs-high-resolution-metrics)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to update your ECS service to enable high-resolution metrics and configure Auto Scaling with a 10-second response time. Here are the exact commands to fix the issue:\n\n**Step 1: Enable high-resolution metrics**\n\n```bash\naws ecs update-service \\\n --cluster my-cluster \\\n --service my-service \\\n --enable-execute-command \\\n --network-configuration \"awsvpcConfiguration={...}\"\n```\n\nReplace `my-cluster` and `my-service` with your actual cluster and service names.\n\n**Step 2: Configure Auto Scaling with a 10-second response time**\n\n```bash\naws application-autoscaling put-scaling-policy \\\n --service-namespace ecs \\\n --scalable-dimension ecs:service:DesiredCount \\\n --resource-id service/my-cluster/my-service \\\n --policy-name high-res-scaling \\\n --policy-type TargetTrackingScaling \\\n --target-tracking-scaling-policy-configuration '{\n \"TargetValue\": 70.0,\n \"PredefinedMetricSpecification\": {\n \"PredefinedMetricType\": \"ECSServiceAverageCPUUtilization\"\n },\n \"ScaleInCooldown\": 60,\n \"ScaleOutCooldown\": 10\n }'\n```\n\n", "metrics": { "length": 1068, "commands": 19, "command_list": [ "aws ecs update-service \\", "--cluster my-cluster \\", "--service my-service \\", "--enable-execute-command \\", "--network-configuration \"awsvpcConfiguration={...}\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AWS ECS 高分辨率指标 — 更快的自动扩缩容 (lesson-16-aws-ecs-high-resolution-metrics)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the ECS task definition not being able to create high-resolution metrics. To resolve this issue, you need to update your ECS task definition to include the necessary metrics.\n\nHere's a step-by-step guide to fix the error:\n\n1. **Update your ECS task definition**:\n\n * First, update your ECS task definition to include the necessary metrics. You can do this by running the following command:\n\n ```bash\naws ecs update-task-definition --task-definition --family --container-definitions \n```\n\n Replace `` and `` with the actual names of your task definition and family, respectively.\n\n * For example, if your task definition is named `my-task-definition` and your family is named `my-family`, you would run the following command:\n\n ```bash\naws ecs update-task-definition --task-definition my-task-definition --family my-family --container-definitions '[{\"Name\": \"my-container\", \"Image\": \"my-image\", \"PortMappings\": [{\"ContainerPort\": 80}]}]'\n```\n\n2. **Enable high-resolution metrics**:\n\n * Next, enable high-resolution metrics for your", "metrics": { "length": 1210, "commands": 2, "command_list": [ "aws ecs update-task-definition --task-definition --family --container-definitions ", "aws ecs update-task-definition --task-definition my-task-definition --family my-family --container-definitions '[{\"Name\": \"my-container\", \"Image\": \"my-image\", \"PortMappings\": [{\"ContainerPort\": 80}]}]'" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP — AI Agent 工具调用标准化协议 (lesson-17-segmentfault-mcp-standardization)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the MCP (Message Communication Protocol) standardization issue in your AI Agent tool. Here's a step-by-step guide to fix the issue:\n\n**Fixing MCP Standardization Issue**\n\n**Step 1: Install Required Packages**\n\nYou need to install the following packages to fix the MCP standardization issue:\n\n* `mcp-standardization`: This package provides the MCP standardization library.\n* `mcp-protocol`: This package provides the MCP protocol implementation.\n\nYou can install these packages using pip:\n\n```bash\npip install mcp-standardization mcp-protocol\n```\n\n**Step 2: Update MCP Configuration**\n\nYou need to update your MCP configuration file to use the standardization library. The configuration file is usually named `mcp_config.json`.\n\nOpen the `mcp_config.json` file in a text editor and update the following lines:\n\n```json\n{\n \"mcp_version\": \"1.0\",\n \"standardization\": {\n \"enabled\": true,\n \"library\": \"mcp-standardization\"\n }\n}\n```\n\n**Step 3: Restart Your AI Agent Tool**\n\nRestart your AI agent tool to apply the changes.\n\n**Step 4: Verify MCP Standardization**\n\nAfter restarting your", "metrics": { "length": 1149, "commands": 1, "command_list": [ "pip install mcp-standardization mcp-protocol" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP — AI Agent 工具调用标准化协议 (lesson-17-segmentfault-mcp-standardization)", "condition": "with_lesson", "status": 200, "content": "The error message you're seeing is related to the MCP (MCP — AI Agent 工具调用标准化协议) protocol, which is designed to standardize the way AI agents interact with external tools. The issue seems to be with the way the MCP protocol is being used in your code.\n\nHere's a step-by-step guide to fixing the issue:\n\n**Step 1: Install the required libraries**\n\nYou'll need to install the `mcp` library, which provides the MCP protocol implementation. Run the following command:\n```bash\npip install mcp\n```\n**Step 2: Create a new MCP server**\n\nCreate a new file called `mcp_server.py` and add the following code:\n```python\nfrom mcp import Server, Tool\n\nserver = Server(\"my-tool\")\n\n@server.tool(\"query_database\")\nasync def query_database(sql: str) -> list:\n \"\"\"Execute a SQL query.\"\"\"\n # Your database logic here\n return []\n\n@server.tool(\"get_schema\")\nasync def get_schema(table: str) -> dict:\n \"\"\"Get table schema.\"\"\"\n # Your schema logic here\n return {}\n```\nThis code defines a new MCP server with two tools: `query_database` and `get_schema`. You'll need to", "metrics": { "length": 1062, "commands": 1, "command_list": [ "pip install mcp" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Redis → PostgreSQL 替换 — 缓存/PubSub/队列统一 (lesson-9-redis-postgresql-replacement)", "condition": "with_lesson", "status": 200, "content": "**解决方案**\n\n为了实现 Redis 的所有功能,包括缓存、PubSub 和 队列,我们将使用 PostgreSQL 的特性进行替换。下面是具体的命令:\n\n**缓存实现**\n\n```sql\n-- 创建非日志表(无 WAL,更快)\nCREATE UNLOGGED TABLE cache (\n key TEXT PRIMARY KEY,\n value JSONB,\n expires_at TIMESTAMPTZ\n);\n\n-- 写入缓存\nINSERT INTO cache (key, value, expires_at)\nVALUES ('user:123', '{\"name\":\"Alice\"}', NOW() + INTERVAL '1 hour')\nON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, expires_at = EXCLUDED.expires_at;\n\n-- 读取缓存\nSELECT value FROM cache WHERE key = 'user:123' AND expires_at NOW();\n\n-- 清理过期(pg_cron 定时执行)\nCREATE OR REPLACE FUNCTION clean_cache()\nRETURNS TRIGGER AS $$\nBEGIN\n IF NEW.expires_at < NOW() THEN\n DELETE FROM cache WHERE expires_at < NOW();\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;\n\nCREATE TRIGGER clean_cache_trigger\nBEFORE DELETE ON cache\nFOR EACH ROW\nEXECUTE", "metrics": { "length": 820, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Redis → PostgreSQL 替换 — 缓存/PubSub/队列统一 (lesson-9-redis-postgresql-replacement)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the fact that the `pg_cron` extension is not installed in your PostgreSQL database. This extension is required for the Pub/Sub and queue features.\n\nHere's a step-by-step solution to fix the issue:\n\n**Step 1: Install the `pg_cron` extension**\n\nYou can install the `pg_cron` extension using the following command in your PostgreSQL shell:\n\n```sql\nCREATE EXTENSION IF NOT EXISTS pg_cron;\n```\n\n**Step 2: Create a cron table**\n\nTo use the Pub/Sub and queue features, you need to create a cron table. You can do this using the following command:\n\n```sql\nCREATE TABLE IF NOT EXISTS mycron (\n id SERIAL PRIMARY KEY,\n name VARCHAR(255) NOT NULL,\n command VARCHAR(255) NOT NULL,\n interval TIME,\n enabled BOOLEAN DEFAULT TRUE\n);\n```\n\n**Step 3: Add a cron job**\n\nTo add a cron job, you can use the following command:\n\n```sql\nINSERT INTO mycron (name, command, interval)\nVALUES ('my_job', 'SELECT * FROM my_table', '*/5 * * * *');\n```\n\nThis will create a cron job that runs every 5 minutes and selects", "metrics": { "length": 1050, "commands": 4, "command_list": [ "**Step 2: Create a cron table**", "To use the Pub/Sub and queue features, you need to create a cron table. You can do this using the following command:", "**Step 3: Add a cron job**", "To add a cron job, you can use the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Before — inspect raw first line (lesson-file-line-number-corruption)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you can use the following command:\n\n```bash\nsed -i 's/^ [0-9]|//g' corrupted-file.ext\n```\n\nThis command uses `sed` to replace any leading spaces and digits (including pipes) at the start of each line with nothing, effectively removing them. The `g` flag at the end of the command ensures that all occurrences are replaced, not just the first one.\n\nHere's how you can verify the fix:\n\n1. Before: Inspect the raw first line of the corrupted file using `head -1 corrupted-file.ext | od -c | head -3`. This will show you the corrupted line.\n\n2. After: Confirm the first line is clean by simply inspecting it with `head -1 corrupted-file.ext`.\n\nTo prevent this issue from happening in the future, you should avoid using commands that prefix lines with line numbers when saving the file content, such as `cat -n`, `sed -n '...p'`, or `less -N`. Instead, use commands like `cat`, `less`, or `more` for viewing, and use a text editor or a programming language's built-in file handling mechanisms to save the file content.", "metrics": { "length": 1031, "commands": 1, "command_list": [ "sed -i 's/^ [0-9]|//g' corrupted-file.ext" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Management Standardization — Naming, Content Sanitization, and Automated (lesson-management-standardization)", "condition": "with_lesson", "status": 200, "content": "To address the issues mentioned in the problem, we'll perform the following steps:\n\n1. Generalize filenames and sanitize content.\n2. Update non-portable tags to standardize metadata.\n3. Implement automated submission standards.\n4. Remove plaintext secrets from documentation.\n\n**Phase 1: Bulk Cleanup**\n\nFirst, we'll rename files with project-specific prefixes and sanitize their content.\n\n1. Run the following script to rename files and sanitize content:\n```bash\npython scripts/generalize_lessons.py --pass 1\n```\nThis script will rename files with project-specific prefixes and remove hardcoded sensitive content.\n\n2. After the first pass, manually review the renamed files to ensure they are accurate and do not contain sensitive information.\n\n3. Run the following script to update Chinese filenames to English:\n```bash\npython scripts/generalize_lessons.py --pass 2\n```\nThis script will update the filenames to use English characters only.\n\n**Phase 2: Standardize Metadata**\n\nNext, we'll update non-portable tags to standardize metadata.\n\n1. Create a new file `metadata.yml` with the following content:\n```yml\nproject: misakanet\nnode: node-1\nseverity: info\n```\nThis file will serve as a template for standardized metadata", "metrics": { "length": 1223, "commands": 2, "command_list": [ "python scripts/generalize_lessons.py --pass 1", "python scripts/generalize_lessons.py --pass 2" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Before — inspect raw first line (lesson-file-line-number-corruption)", "condition": "plain", "status": 200, "content": "The error \"Before — inspect raw first line (lesson-file-line-number-corruption)\" typically occurs when there are issues with the line numbers in a file, which can be caused by various factors such as:\n\n- Unsaved changes to the file\n- Incorrect line numbers in the file\n- Issues with the file's encoding\n\nHere's a step-by-step guide to fix this error:\n\n**Method 1: Save and Reload the File**\n\n1. Save the file with any unsaved changes.\n2. Reload the file by clicking on \"Reload\" or pressing `Ctrl+R` (Windows/Linux) or `Cmd+R` (Mac).\n\n**Method 2: Check and Correct Line Numbers**\n\n1. Open the file in a text editor, such as Notepad (Windows) or TextEdit (Mac).\n2. Check the line numbers in the file and correct any errors.\n3. Save the file with the correct line numbers.\n\n**Method 3: Use a File Repair Tool**\n\n1. Download and install a file repair tool, such as:\n\t* Recuva (Windows)\n\t* Disk Utility (Mac)\n\t* File Repair (Windows, Mac, Linux)\n2. Run the file repair tool and select the file that contains the error.\n3", "metrics": { "length": 1015, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Management Standardization — Naming, Content Sanitization, and Automated (lesson-management-standardization)", "condition": "plain", "status": 200, "content": "I don't see any error provided. However, I'll provide a general solution for the Lesson Management Standardization issue. If you provide the actual error message, I can give you a more precise fix.\n\nAssuming the issue is related to the Lesson Management Standardization, here's a general solution:\n\n**Solution:**\n\n1. Make sure that the lesson management standardization is properly configured in your application.\n2. Check that the naming convention for lessons is consistent and follows the standardization guidelines.\n3. Ensure that the content sanitization is enabled and properly configured to prevent any security vulnerabilities.\n\n**Example Commands:**\n\nIf you're using a Linux-based system, here are some example commands to help you troubleshoot and fix the issue:\n\n```bash\n# Check the lesson management standardization configuration\nsudo grep -i \"lesson-management-standardization\" /etc/config.yaml\n\n# Verify the naming convention for lessons\nsudo grep -i \"lesson-name\" /etc/config.yaml\n\n# Check the content sanitization configuration\nsudo grep -i \"content-sanitization\" /etc/config.yaml\n```\n\nIf you're using a Windows system, you can use the following commands:\n\n```bash\n# Check the lesson management standardization configuration\nGet-Content -Path C:\\config.yaml", "metrics": { "length": 1273, "commands": 3, "command_list": [ "sudo grep -i \"lesson-management-standardization\" /etc/config.yaml", "sudo grep -i \"lesson-name\" /etc/config.yaml", "sudo grep -i \"content-sanitization\" /etc/config.yaml" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Quality Requirements: failure-memory protocol Format (lesson-quality-requirements)", "condition": "with_lesson", "status": 200, "content": "The error message indicates that the verification script is expecting a specific output format, but the actual output does not match this format. Specifically, the verification script is expecting a line count for the number of lines in the `lesson-quality-requirements.md` file, but the actual output only contains a string.\n\nTo fix this issue, you can modify the verification script to extract the line count from the output. Here's an updated version of the verification script:\n\n```bash\n#!/bin/bash\n\n# Run the lesson quality check\ncheck_lesson_quality.py lessons/contrib/lesson-quality-requirements.md\n\n# Check the score\nscore=$(score_lessons.py lessons/contrib/lesson-quality-requirements.md)\n\n# Check if the lesson appears in search results\nif grep -q \"lesson-quality-requirements\" search_index.txt; then\n search_result=\"Lesson appears in search results\"\nelse\n search_result=\"Lesson does not appear in search results\"\nfi\n\n# Check the structure\nif [[ $(check_lesson_structure.py lessons/contrib/lesson-quality-requirements.md) =~ \"Problem\" && $(check_lesson_structure.py lessons/contrib/lesson-quality-requirements.md) =~ \"Root Cause\" && $(check_lesson_structure.py lessons/contrib/lesson-quality-requirements", "metrics": { "length": 1216, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Quality Requirements: failure-memory protocol Format (lesson-quality-requirements)", "condition": "plain", "status": 200, "content": "It seems like you're experiencing an issue with a YAML file, specifically the `lesson-quality-requirements` section. The error message \"failure-memory protocol Format\" is not a standard error message, but I'll assume it's related to a YAML validation error.\n\nTo fix this issue, you can try the following steps:\n\n1. Check the YAML file for any invalid characters or syntax errors:\n```bash\nyamllint lesson-quality-requirements.yaml\n```\nThis command will highlight any errors or warnings in the YAML file.\n\n2. If the above command doesn't find any issues, try to validate the YAML file using a YAML validator tool:\n```bash\nyaml validate lesson-quality-requirements.yaml\n```\nThis command will check the YAML file for any syntax errors and report them.\n\n3. If the above steps don't resolve the issue, try to recreate the `lesson-quality-requirements` section with a simple format:\n```yaml\nlesson-quality-requirements:\n - name: Test Requirement\n description: This is a test requirement.\n status: passed\n```\nThis should resolve the issue if the original YAML file had a more complex format.\n\nIf none of the above steps work, please provide the exact error message or the contents of the `lesson-quality-", "metrics": { "length": 1203, "commands": 2, "command_list": [ "yamllint lesson-quality-requirements.yaml", "yaml validate lesson-quality-requirements.yaml" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Provenance Tracking: author, PR, source, merge history (lesson-provenance-tracking)", "condition": "with_lesson", "status": 200, "content": "**Fix: Extend lesson schema with provenance fields and populate from git history**\n\n**Step 1: Update lesson schema**\n\nUpdate the `lesson` schema to include the provenance fields:\n```yaml\n---\n{\n \"title\": \"Lesson Provenance Tracking: author, PR, source, merge history\",\n \"domain\": \"devops\",\n \"tags\": [\"provenance\", \"metadata\", \"audit\", \"tracking\"],\n \"status\": \"published\",\n \"evidence_level\": \"E2\",\n \"source\": \"closed-pr-1031\",\n \"created\": \"2026-08-22\",\n \"provenance\": {\n \"author\": \"\",\n \"pr\": 0,\n \"merged_by\": \"\",\n \"edited_at\": \"\",\n \"edit_history\": []\n }\n}\n```\n**Step 2: Run the backfill script**\n\nRun the `backfill_provenance.py` script to populate the provenance fields from git history:\n```bash\npython scripts/backfill_provenance.py --lessons lessons\n```\nThis will populate the provenance fields with the corresponding values from the git history.\n\n**Step 3: Verify the results**\n\nVerify that the provenance fields are populated correctly:\n```", "metrics": { "length": 967, "commands": 5, "command_list": [ "**Step 2: Run the backfill script**", "Run the `backfill_provenance.py` script to populate the provenance fields from git history:", "This will populate the provenance fields with the corresponding values from the git history.", "**Step 3: Verify the results**", "Verify that the provenance fields are populated correctly:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lesson Provenance Tracking: author, PR, source, merge history (lesson-provenance-tracking)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a missing index on the `source` column in your `lesson_provenance_tracking` table. Here's a concrete, actionable fix with exact commands:\n\n**Assumptions:**\n\n* You're using MySQL or PostgreSQL.\n* You have the necessary permissions to create indexes.\n\n**Fix:**\n\n1. **MySQL:**\n\n```sql\nCREATE INDEX idx_source ON lesson_provenance_tracking (source);\n```\n\n2. **PostgreSQL:**\n\n```sql\nCREATE INDEX idx_source ON lesson_provenance_tracking USING btree (source);\n```\n\n**Explanation:**\n\n* The `CREATE INDEX` command creates a new index on the specified column(s).\n* The `idx_source` name is arbitrary, but it's a good practice to use descriptive names for indexes.\n* The `ON lesson_provenance_tracking` clause specifies the table to create the index on.\n* The `(source)` clause specifies the column(s) to index.\n* In PostgreSQL, the `USING btree` clause specifies the indexing method, which is a B-tree index.\n\n**After creating the index:**\n\n* Run the following command to verify the index has been created:\n\n```sql\nSHOW INDEX FROM lesson_provenance_tracking;\n```\n\n", "metrics": { "length": 1102, "commands": 9, "command_list": [ "2. **PostgreSQL:**", "**Explanation:**", "* The `CREATE INDEX` command creates a new index on the specified column(s).", "* The `idx_source` name is arbitrary, but it's a good practice to use descriptive names for indexes.", "* The `ON lesson_provenance_tracking` clause specifies the table to create the index on." ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP 协议 + Bedrock 实战 — Agent 外部工具调用标准化 (lesson-review-4-mcp-bedrock-integration)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing is likely due to the MCP Server not being properly configured or the Agent not being able to connect to it. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Install the required dependencies**\n\nYou'll need to install the `mcp` and `boto3` libraries. Run the following commands:\n```bash\npip install mcp boto3\n```\n**Step 2: Define the MCP Server**\n\nCreate a new file called `mcp_server.py` and add the following code:\n```python\nfrom mcp import Server, Tool\nimport boto3\n\nserver = Server(\"my-tools\")\n\n@server.tool(\"read_s3_file\")\nasync def read_s3_file(bucket: str, key: str) -> str:\n \"\"\"Read a file from S3.\"\"\"\n s3 = boto3.client('s3')\n obj = s3.get_object(Bucket=bucket, Key=key)\n return obj['Body'].read().decode()\n\n@server.tool(\"query_dynamodb\")\nasync def query_dynamodb(table: str, key: str) -> dict:\n \"\"\"Query DynamoDB by partition key.\"\"\"\n dynamodb = boto3.resource('dynamodb')\n table = dynamodb.Table(table)\n", "metrics": { "length": 972, "commands": 1, "command_list": [ "pip install mcp boto3" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "EKS Kubernetes 版本回滚 — 安全升级集群 (lesson-review-5-eks-version-rollback)", "condition": "plain", "status": 200, "content": "The error you're encountering typically occurs when you're trying to roll back a version of your Kubernetes cluster in an Amazon EKS (Elastic Kubernetes Service) cluster. Here's a step-by-step guide to fix the issue:\n\n**Prerequisites:**\n\n* Make sure you have the AWS CLI installed and configured on your machine.\n* Ensure you have the necessary permissions to manage your EKS cluster.\n* Take a snapshot of your cluster before attempting to roll back.\n\n**Roll back to a previous version of your EKS cluster:**\n\n1. **List available versions:** Use the following command to list all available versions of your EKS cluster:\n\n```bash\naws eks describe-cluster --cluster-name --query 'cluster.versionHistoryList[]|{version, reason}'\n```\n\nReplace `` with your actual cluster name.\n\n2. **Choose the desired version:** Select the version you want to roll back to by looking at the `version` and `reason` columns in the output. For example, let's say you want to roll back to version `1.22.0`.\n\n3. **Update the cluster version:** Use the following command to update the cluster version:\n\n```bash\naws eks update-kubeconfig --name --", "metrics": { "length": 1164, "commands": 1, "command_list": [ "aws eks describe-cluster --cluster-name --query 'cluster.versionHistoryList[]|{version, reason}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Monetization Gateway — x402 API 支付协议 (lesson-review-6-cloudflare-x402-monetization)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing is due to the Cloudflare Monetization Gateway not being properly configured to accept payments from your AI Agent. To fix this, you'll need to follow these steps:\n\n1. Create a new file named `x402.json` in the root of your project with the following content:\n```json\n{\n \"name\": \"my-agent\",\n \"description\": \"My AI Agent\",\n \"inputSchema\": {},\n \"pricing\": {\n \"x402\": {\n \"amount\": \"0.01\",\n \"currency\": \"USDC\"\n }\n }\n}\n```\nThis file defines the pricing structure for your AI Agent using the x402 protocol.\n\n2. Run the following command to generate a payment proof:\n```bash\ncurl -X GET \\\n https://api.cloudflare.com/client/v1/x402/payments \\\n -H 'X-Auth-Token: YOUR_CLOUDFLARE_TOKEN' \\\n -H 'Content-Type: application/json' \\\n -d '{\"name\": \"my-agent\", \"description\": \"My AI Agent\", \"inputSchema\": {}, \"pricing\": {\"x402\": {\"amount\": \"0.01\", \"currency\": \"USDC\"}}}'\n```\nReplace `YOUR_CLOUDFL", "metrics": { "length": 935, "commands": 2, "command_list": [ "This file defines the pricing structure for your AI Agent using the x402 protocol.", "2. Run the following command to generate a payment proof:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP 协议 + Bedrock 实战 — Agent 外部工具调用标准化 (lesson-review-4-mcp-bedrock-integration)", "condition": "plain", "status": 200, "content": "I can guide you through the process of fixing the error, but I need more information about the error message you're encountering. The provided error message seems to be in Chinese, so I'll need you to translate it or provide more context.\n\nHowever, based on the topic \"MCP 协议 + Bedrock 实战 — Agent 外部工具调用标准化 (lesson-review-4-mcp-bedrock-integration)\", I'm assuming the error is related to integrating MCP (Microsoft Cloud Platform) with Bedrock, possibly involving an external tool.\n\nHere's a general approach to troubleshooting and fixing common errors related to MCP and Bedrock integration:\n\n1. Check the MCP and Bedrock documentation for any known issues or updates.\n2. Verify that all required dependencies and tools are installed and up-to-date.\n3. Review the code and configuration files for any syntax errors or inconsistencies.\n\nSince I don't have the exact error message, I'll provide a generic example of how to troubleshoot and fix a common issue:\n\n**Example:**\n\nLet's say the error message is:\n```\nError: MCP Agent not found\n```\nTo fix this issue, you can try the following steps:\n\n1. Check the MCP Agent installation:\n```bash\nmcp-agent --version\n```\n", "metrics": { "length": 1163, "commands": 2, "command_list": [ "Error: MCP Agent not found", "mcp-agent --version" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "EKS Kubernetes 版本回滚 — 安全升级集群 (lesson-review-5-eks-version-rollback)", "condition": "with_lesson", "status": 200, "content": "根据问题描述,EKS控制平面升级不可逆,这是开源K8s不支持的。为避免这种情况,AWS EKS支持控制平面版本回滚。以下是具体的修复步骤:\n\n1. **创建回滚点**(自动备份 etcd)\n ```bash\n aws eks update-cluster-config \\\n --name my-cluster \\\n --kubernetes-version 1.31\n ```\n\n2. **升级控制平面**\n ```bash\n aws eks update-cluster-version \\\n --name my-cluster \\\n --kubernetes-version 1.32\n ```\n\n3. **运行 smoke tests**\n ```bash\n kubectl --context=my-cluster get nodes\n ```\n\n4. **如果失败 → 回滚**\n ```bash\n aws eks rollback-cluster-version \\\n --name my-cluster \\\n --kubernetes-version 1.31\n ```\n\n5. **如果成功 → 升级节点组**\n ```bash\n for cluster in $(aws eks list-clusters --query 'clusters[]' --output text); do\n echo \"Upgrading $cluster...\"\n aws eks update-cluster-version --name \"$cluster", "metrics": { "length": 742, "commands": 10, "command_list": [ "aws eks update-cluster-config \\", "--name my-cluster \\", "--kubernetes-version 1.31", "aws eks update-cluster-version \\", "--name my-cluster \\" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Monetization Gateway — x402 API 支付协议 (lesson-review-6-cloudflare-x402-monetization)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect configuration in your Cloudflare Monetization Gateway settings. To resolve this issue, follow these steps:\n\n**Step 1: Check your API key**\n\nMake sure you have the correct API key for your Cloudflare account. You can find it in the Cloudflare dashboard under \"Monetization\" > \"API keys\".\n\n**Step 2: Verify your x402 API settings**\n\nIn the Cloudflare dashboard, navigate to \"Monetization\" > \"Monetization Gateway\" > \"x402 API\". Ensure that:\n\n* The \"API endpoint\" is set to `https://api.cloudflare.com/client/v0/monetization/gateway/x402`\n* The \"API key\" is selected and the correct API key is entered\n* The \"PayPal\" or \"Stripe\" integration is enabled (depending on your payment gateway)\n* The \"Test mode\" is set to `false` (if you're deploying to production)\n\n**Step 3: Update your API settings (if necessary)**\n\nIf you've made changes to your API settings, you may need to update your code to reflect these changes. Check your API documentation for the latest information on x402 API settings.\n\n**Step 4:", "metrics": { "length": 1073, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Network Domain Lesson Template (lesson-template-network)", "condition": "with_lesson", "status": 200, "content": "The error message \"Network Domain Lesson Template\" is not a specific error, but rather a title of a lesson template. However, based on the provided verified lesson, it seems that the issue is related to SSL certificate verification failure behind a corporate proxy.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Problem:** Agent fails to connect to external APIs behind corporate proxy with SSL inspection.\n\n**Symptoms:**\n\n* SSL: CERTIFICATE_VERIFY_FAILED\n\n**Root Cause:** Corporate proxy performs SSL inspection (man-in-the-middle), replacing original certificates with its own. Python's certifi bundle doesn't include the corporate CA.\n\n**Solution:**\n\n### Step 1: Identify the issue\n\nRun the following diagnostic commands to identify the issue:\n\n```bash\ncurl -v https://example.com\nnslookup example.com\nopenssl s_client -connect example.com:443\n```\n\nThese commands will help you understand the issue and verify the expected behavior.\n\n### Step 2: Apply the fix\n\nTo resolve the issue, follow these steps:\n\n1. **Export corporate CA certificate:**\n\n ```bash\nsecurity find-certificate -a -p /Library/Keychains/System.keychain corporate-ca.pem\n```\n\n This command will export the corporate CA certificate from the System", "metrics": { "length": 1234, "commands": 4, "command_list": [ "curl -v https://example.com", "nslookup example.com", "openssl s_client -connect example.com:443", "security find-certificate -a -p /Library/Keychains/System.keychain corporate-ca.pem" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Workflows Saga Rollback — Durable Multi-Step Compensation (lesson-review-7-cloudflare-saga-rollbacks)", "condition": "with_lesson", "status": 200, "content": "To fix the Cloudflare Workflows Saga Rollback issue, you need to ensure that the compensating operations for each step are properly implemented. Here's an updated version of the code with the necessary fixes:\n\n```javascript\n// Cloudflare Workflows saga rollback example\nexport default {\n async run(event, step) {\n // Step 1: Debit with rollback\n const debitResult = await step.do(\"debit-account-a\", {\n // rollback: compensating action if this step succeeds but later steps fail\n rollback: async () => {\n await step.do(\"credit-account-a-reversal\", {\n amount: debitResult.amount,\n accountId: \"A\"\n });\n }\n }, async () => {\n try {\n await debitFromAccount(\"A\", 100);\n return debitResult;\n } catch (error) {\n // If debit fails, revert to a previous state\n await step.do(\"credit-account-a-reversal\", {\n amount: 0,\n accountId: \"A\"\n });\n throw error;\n }\n });\n\n // Step 2: Credit (may fail)\n const creditResult = await step.do(\"credit-account-b\", {\n rollback: async () => {\n // If", "metrics": { "length": 1123, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Network Domain Lesson Template (lesson-template-network)", "condition": "plain", "status": 200, "content": "The error \"Network Domain Lesson Template (lesson-template-network)\" is not a standard error message and seems to be related to a custom error or exception. However, I'll provide a general solution that might help resolve the issue.\n\nAssuming the error is related to a Django project, here are some steps you can try:\n\n1. Check your Django project's settings:\n\nOpen your `settings.py` file and look for any sections related to network domains or DNS settings. Make sure that the `ALLOWED_HOSTS` variable is properly configured.\n\n```python\nALLOWED_HOSTS = ['example.com', 'localhost', '127.0.0.1']\n```\n\n2. Check your virtual environment:\n\nMake sure your virtual environment is properly activated. If you're using a virtual environment, try activating it and then running your Django project.\n\n```bash\n# Activate the virtual environment\nsource myenv/bin/activate\n\n# Run your Django project\npython manage.py runserver\n```\n\n3. Check your DNS settings:\n\nIf you're using a custom domain, make sure that your DNS settings are correctly configured. You can check your DNS settings by contacting your DNS provider or hosting company.\n\n4. Clear cache and run migrations:\n\nClear your cache and run migrations to ensure that your", "metrics": { "length": 1217, "commands": 2, "command_list": [ "2. Check your virtual environment:", "Make sure your virtual environment is properly activated. If you're using a virtual environment, try activating it and then running your Django project." ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare Workflows Saga Rollback — Durable Multi-Step Compensation (lesson-review-7-cloudflare-saga-rollbacks)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to a Cloudflare Workflows Saga Rollback issue, specifically with Durable Multi-Step Compensation. Here's a step-by-step fix to resolve the problem:\n\n**Step 1: Delete the workflow**\n\n1. Log in to your Cloudflare account.\n2. Go to the Workflows tab.\n3. Find the workflow that's causing the error and click on the three dots next to it.\n4. Select \"Delete workflow\".\n\n**Step 2: Verify the deletion**\n\n1. After deleting the workflow, go back to the Workflows tab.\n2. Check if the deleted workflow is no longer listed.\n\n**Step 3: Create a new workflow**\n\n1. Click on the \"Create workflow\" button.\n2. Fill in the required information, such as the workflow name and description.\n3. Select \"Durable Multi-Step\" as the workflow type.\n\n**Step 4: Configure the workflow**\n\n1. In the workflow settings, make sure the \"Saga\" option is enabled.\n2. In the \"Saga\" section, ensure that the \"Rollback\" option is set to \"Enabled\".\n3. In the \"Compensation\" section, make sure that the \"Durable Multi-Step\" option is selected.\n\n", "metrics": { "length": 1047, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Maintainer Feedback Iteration — Address Blockers, Not Just Comments (maintainer-feedback-iteration)", "condition": "with_lesson", "status": 200, "content": "To address the \"Maintainer Feedback Iteration — Address Blockers, Not Just Comments\" issue, we'll create a script that parses the maintainer's feedback, extracts the blockers, and fixes them. Here's a concrete, actionable fix with exact commands:\n\n**Fixing Maintainer Feedback Iteration**\n\nFirst, install the required GitHub CLI tools:\n```bash\ngh install\n```\n**Script: `fix_maintainer_feedback.sh`**\n```bash\n#!/bin/bash\n\n# Set the PR number\nPR_NUMBER=123456\n\n# Set the GitHub token (optional, but recommended for security)\nGITHUB_TOKEN=\"your_github_token_here\"\n\n# Function to extract blockers from a comment\nextract_blockers() {\n blockers=()\n while IFS= read -r line; do\n if [[ $line =~ \"remove\" || $line =~ \"not acceptable\" || $line =~ \"can be merged as\" ]]; then\n blockers+=(\"$line\")\n fi\n done <<< \"$1\"\n echo \"${blockers[@]}\"\n}\n\n# Function to fix blockers\nfix_blockers() {\n blockers=($(extract_blockers \"$1\"))\n for blocker in \"${blockers[@]}\"; do\n echo \"Fixing blocker: $", "metrics": { "length": 993, "commands": 1, "command_list": [ "gh install" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Context Mode — 98% Context Window Reduction for Claude Code (mcp-context-mode-98-reduction)", "condition": "plain", "status": 200, "content": "The error message you're experiencing, `MCP Context Mode — 98% Context Window Reduction for Claude Code (mcp-context-mode-98-reduction)`, typically indicates that the context window size is too small for the current buffer size. To fix this issue, you can try increasing the context window size. Here's a concrete, actionable fix with exact commands:\n\n**For Visual Studio Code:**\n\n1. Open the Command Palette in Visual Studio Code by pressing `Ctrl + Shift + P` (Windows/Linux) or `Cmd + Shift + P` (Mac).\n2. Type \"MCP Context Mode: Increase Context Window Size\" in the Command Palette and select the option.\n3. Alternatively, you can also use the following command in the Terminal:\n\n ```bash\ncode --extensions.path=/path/to/your/extension --mcp-context-mode 100\n```\n\n Replace `/path/to/your/extension` with the actual path to the extension that's causing the issue.\n\n**For IntelliJ IDEA:**\n\n1. Open the Settings (or Preferences) dialog in IntelliJ IDEA by pressing `Ctrl + Shift + Alt + S` (Windows/Linux) or `Cmd + Shift + Alt + S` (Mac).\n2. In the Settings dialog, navigate", "metrics": { "length": 1080, "commands": 1, "command_list": [ "code --extensions.path=/path/to/your/extension --mcp-context-mode 100" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Maintainer Feedback Iteration — Address Blockers, Not Just Comments (maintainer-feedback-iteration)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a conflict between the `maintainer-feedback-iteration` rule and another rule in your `.gitignore` file. The `maintainer-feedback-iteration` rule suggests that you should ignore files with names that contain the word \"blocker\" but not \"comment\". \n\nTo fix this issue, you can add the following lines to your `.gitignore` file:\n\n```bash\n# Ignore files that contain \"blocker\" but not \"comment\"\n*.blocker\n*.blocker-\n```\n\nHowever, the most effective solution is to modify your `.gitignore` file to include the exact file name that is causing the conflict. The exact command to do this depends on your operating system and how you're managing your Git repository. Here are a few examples:\n\n**Using Git Bash on Linux or macOS:**\n\n```bash\necho \"# Ignore file containing 'blocker' but not 'comment'\" >> .gitignore\necho \"file_with_blocker_but_no_comment.txt\" >> .gitignore\n```\n\n**Using PowerShell on Windows:**\n\n```bash\n$ignoreFile = \"C:\\Path\\To\\Your\\Gitignore\"\n$ignoreContent = \"# Ignore file containing 'blocker' but not 'comment'\"\n$", "metrics": { "length": 1071, "commands": 4, "command_list": [ "*.blocker", "*.blocker-", "echo \"# Ignore file containing 'blocker' but not 'comment'\" >> .gitignore", "echo \"file_with_blocker_but_no_comment.txt\" >> .gitignore" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Endpoint 404: Zone Route Points to Worker Without MCP Implementation (mcp-endpoint-404-zone-route-misconfig)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fixing the error:\n\n**Step 1: Update MCP endpoint routes**\n\nUse the following command to update the MCP endpoint routes:\n\n```bash\naws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://mcp-endpoint-404-zone-route-misconfig-updated.yaml\n```\n\n**Step 2: Deploy the updated worker**\n\nUse the following command to deploy the updated worker:\n\n```bash\naws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://updated-worker.yaml\n```\n\n**Step 3: Consolidate architecture**\n\nUpdate the misakanet-register-proxy worker to use the new MCP implementation:\n\n```bash\naws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://consolidated-worker.yaml\n```\n\n**Step 4: Verify MCP endpoint**\n\nTest the MCP endpoint using the following command:\n\n```bash\ncurl -X POST https://misakanet.org/mcp \\\n -H \"Content-Type: application/json\" \\\n -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\"\n```\n\nIf you encounter any issues, ensure that the MCP endpoint routes have been updated correctly and the worker", "metrics": { "length": 1117, "commands": 6, "command_list": [ "aws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://mcp-endpoint-404-zone-route-misconfig-updated.yaml", "aws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://updated-worker.yaml", "aws cloudformation update-stack --stack-name misakanet-register-proxy --template-body file://consolidated-worker.yaml", "curl -X POST https://misakanet.org/mcp \\", "-H \"Content-Type: application/json\" \\" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.4 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Context Mode — 98% Context Window Reduction for Claude Code (mcp-context-mode-98-reduction)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to implement a context mode architecture that compresses tool outputs. Here's a step-by-step guide to achieve this:\n\n**Step 1: Install required packages**\n\nRun the following command to install the required packages:\n```bash\nnpm install compress-archiver json-streamer\n```\n**Step 2: Create a context mode server**\n\nCreate a new file `context-mode-server.js` with the following code:\n```javascript\nconst express = require('express');\nconst { gzip, gunzip } = require('compress-archiver');\nconst { TransformStream } = require('stream');\nconst { Transform } = require('stream/Transform');\n\nconst app = express();\n\napp.use(express.json());\n\nconst compressionStrategies = {\n summarize: (data) => JSON.stringify({ summary: data.slice(0, 10) }),\n filter: (data) => JSON.stringify({ filtered: data.slice(0, 10) }),\n truncate: (data) => JSON.stringify({ truncated: data.slice(0, 10) }),\n structure: (data) => JSON.stringify({ structured: data.slice(0, 10) }),\n};\n\napp.post('/compress', (req, res) => {\n const { strategy } = req", "metrics": { "length": 1049, "commands": 1, "command_list": [ "npm install compress-archiver json-streamer" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Endpoint 404: Zone Route Points to Worker Without MCP Implementation (mcp-endpoint-404-zone-route-misconfig)", "condition": "plain", "status": 200, "content": "The error message \"MCP Endpoint 404: Zone Route Points to Worker Without MCP Implementation (mcp-endpoint-404-zone-route-misconfig)\" typically occurs when the Azure Kubernetes Service (AKS) cluster is not properly configured to handle zone-aware routing.\n\nTo fix this issue, you need to enable zone-aware routing on your AKS cluster. Here are the steps:\n\n**Step 1: Update the Azure CLI**\n\nFirst, make sure you have the latest version of the Azure CLI installed. You can check by running:\n\n```bash\naz --version\n```\n\nIf you're using an older version, update it by running:\n\n```bash\naz upgrade\n```\n\n**Step 2: Enable Zone-Aware Routing**\n\nRun the following command to enable zone-aware routing on your AKS cluster:\n\n```bash\naz aks update --resource-group --name --enable-zone-aware-routing true\n```\n\nReplace `` and `` with the actual names of your resource group and AKS cluster.\n\n**Step 3: Update the Network Policies**\n\nZone-aware routing requires network policies to be updated to allow communication between pods in different zones. You can update the network policies using the following command:\n\n```", "metrics": { "length": 1174, "commands": 3, "command_list": [ "az --version", "az upgrade", "az aks update --resource-group --name --enable-zone-aware-routing true" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.2 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Registry Readiness Requires QA Before Promotion (mcp-registry-readiness-requires-qa-before-promotion)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the Microsoft Compute Platform (MCP) registry readiness. Here's a step-by-step guide to resolve the issue:\n\n**Prerequisites:**\n\n1. Ensure you have the Azure CLI installed on your machine. You can install it by running the following command:\n\n```bash\naz login\n```\n\n2. Verify that you have the necessary permissions to perform registry-related operations.\n\n**Step 1: Update the Azure Resource Manager (ARM) template**\n\nThe error might be caused by an outdated ARM template. Update the template to the latest version. Run the following command:\n\n```bash\naz group template update --name --resource-group --template-version '2022-05-01'\n```\n\nReplace `` and `` with the actual names of your template and resource group.\n\n**Step 2: Update the registry settings**\n\nUpdate the registry settings to ensure they are set to 'Ready' before promotion. Run the following command:\n\n```bash\naz vm registry update --resource-group --name --settings \"readyBeforePromotion=true\"\n```\n\nReplace `` and `` with the actual names of", "metrics": { "length": 1198, "commands": 3, "command_list": [ "az login", "az group template update --name --resource-group --template-version '2022-05-01'", "az vm registry update --resource-group --name --settings \"readyBeforePromotion=true\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Registry Readiness Requires QA Before Promotion (mcp-registry-readiness-requires-qa-before-promotion)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"MCP Registry Readiness Requires QA Before Promotion (mcp-registry-readiness-requires-qa-before-promotion)\", you need to follow the steps provided in the verified lesson. Here's a step-by-step guide:\n\n**Step 1: Define a registry readiness gate**\n\nBefore promoting a server, verify the following:\n\n* MCP smoke test passes\n* Windows/macOS/Linux instructions are clear\n* README uses real install commands only\n* Experimental tools are labeled experimental\n* Registry metadata has the right category and positioning\n\nYou can automate this process using a script or a tool like `mcp-registry-readiness-check`.\n\n**Step 2: Run chat-style QA**\n\nUse a matrix like the one provided in the lesson to test whether models actually use the MCP tool in realistic workflows. The matrix should have the following columns:\n\n| Query | Tool called? | Correct lesson? | Helpful answer? | No hallucination? |\n|---|---|---|---|---|\n| DCO failed on GitHub | | | | |\n| pip install times out | | | | |\n| secret scan blocked PR | | | | |\n| irrelevant negative query | | | | |\n\nYou can fill in the matrix with real data and scenarios to test the", "metrics": { "length": 1134, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP intake: agents submit failures without GitHub account (mcp-intake-no-account-submission)", "condition": "plain", "status": 200, "content": "The error \"MCP intake: agents submit failures without GitHub account (mcp-intake-no-account-submission)\" typically occurs when an agent is submitting a failure report without a valid GitHub account associated with it.\n\nTo fix this issue, you'll need to update the agent's configuration to include a valid GitHub account. Here's a step-by-step guide to resolve the issue:\n\n**Prerequisites:**\n\n1. Ensure you have a GitHub account and have created a personal access token with the necessary permissions.\n2. Familiarize yourself with the agent's configuration file (usually `agent.yml` or `agent.json`).\n\n**Step 1: Update the agent configuration**\n\nOpen the agent configuration file in a text editor and locate the `github` section. If it doesn't exist, add it:\n\n```yml\n# agent.yml (example)\ngithub:\n token: \"your-personal-access-token\"\n username: \"your-github-username\"\n```\n\nReplace `\"your-personal-access-token\"`, `\"your-github-username\"`, and other placeholders with your actual GitHub credentials.\n\n**Step 2: Save the changes**\n\nSave the updated configuration file.\n\n**Step 3: Restart the agent**\n\nRestart the agent process to apply the changes:\n\n```bash\n", "metrics": { "length": 1157, "commands": 5, "command_list": [ "Replace `\"your-personal-access-token\"`, `\"your-github-username\"`, and other placeholders with your actual GitHub credentials.", "**Step 2: Save the changes**", "Save the updated configuration file.", "**Step 3: Restart the agent**", "Restart the agent process to apply the changes:" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP intake: agents submit failures without GitHub account (mcp-intake-no-account-submission)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to add the `mcp-intake` tool to your environment. Here's a step-by-step guide:\n\n**Step 1: Install the `mcp-intake` tool**\n\nYou can install the `mcp-intake` tool using pip:\n```bash\npip install mcp-intake\n```\n**Step 2: Add the `mcp-intake` tool to your environment**\n\nAdd the following line to your `~/.bashrc` or `~/.zshrc` file to make the `mcp-intake` tool available in your shell:\n```bash\nexport PATH=$PATH:$(pwd)/mcp-intake\n```\nReplace `(pwd)` with the actual path to the `mcp-intake` tool.\n\n**Step 3: Configure the `mcp-intake` tool**\n\nCreate a configuration file for the `mcp-intake` tool:\n```bash\nmkdir -p ~/.mcp-intake\n```\nEdit the configuration file with the following contents:\n```yml\n---\nsubmit:\n type: json\n fields:\n - name: description\n type: string\n required: true\n - name: failure\n type: object\n ", "metrics": { "length": 867, "commands": 3, "command_list": [ "pip install mcp-intake", "export PATH=$PATH:$(pwd)/mcp-intake", "mkdir -p ~/.mcp-intake" ], "has_command_block": true, "actionable": true, "inline_code_count": 17, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Server 测试 — 直接调用 handler 跳过 stdio 传输 (mcp-server-direct-handler-testing)", "condition": "plain", "status": 200, "content": "The error message you're encountering, \"MCP Server 测试 — 直接调用 handler 跳过 stdio 传输 (mcp-server-direct-handler-testing)\", is not specific to a programming language, but rather a command-line interface (CLI) error related to the MCP Server.\n\nHere's a step-by-step guide to fix the issue:\n\n**Prerequisites:**\n\n* Make sure you have the latest version of MCP Server installed on your system.\n* Familiarize yourself with the MCP Server command-line interface (CLI).\n\n**Fix:**\n\n1. **Check the MCP Server version:**\n\n * Open a command prompt or terminal and navigate to the directory where MCP Server is installed.\n * Run the following command to check the current version of MCP Server: `mcp-server --version`\n\n * Take note of the version number. If you're using an older version, consider updating to the latest version.\n\n2. **Disable stdio transmission:**\n\n * Run the following command to disable stdio transmission for the MCP Server: `mcp-server --disable-stdio-transmission`\n\n * If you want to enable stdio transmission again, run the following command: `mcp-server --enable-stdio-trans", "metrics": { "length": 1113, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP Server 测试 — 直接调用 handler 跳过 stdio 传输 (mcp-server-direct-handler-testing)", "condition": "with_lesson", "status": 200, "content": "The error message \"MCP Server 测试 — 直接调用 handler 跳过 stdio 传输 (mcp-server-direct-handler-testing)\" indicates that the MCP Server is skipping the stdio transmission when directly calling the handler. This is a known issue in the MCP Server, and the solution is to directly call the JSON-RPC handler without starting a subprocess.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the MCP Server code**\n\nUpdate the `handle_request` function in the `scripts.mcp_server` module to return the result directly without writing to stdout:\n```python\n# scripts/mcp_server.py\n\ndef handle_request(request):\n # Your existing logic here\n return {\"result\": result}\n```\n**Step 2: Update the test code**\n\nUpdate the test code to use the `rpc` function directly without calling `handle_request` with `stdio=True`:\n```python\n# test_mcp_server.py\n\nfrom scripts.mcp_server import rpc\n\ndef test_search():\n resp = rpc(\"tools/call\", {\n \"name\": \"misakanet_search\",\n \"arguments\": {\"query\": \"test\"},\n })\n result = json.loads(resp[\"result\"][\"content\"][0][\"text\"])\n", "metrics": { "length": 1087, "commands": 2, "command_list": [ "**Step 2: Update the test code**", "Update the test code to use the `rpc` function directly without calling `handle_request` with `stdio=True`:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Context Mode: Reducing Claude Code Context Consumption by 98% (mcp-server-that-reduces-claude-code-context-consumption-by-9)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the amount of Claude code context being consumed by the MCP server. This is typically a result of excessive logging or high system load. Here are some concrete, actionable steps to resolve this issue:\n\n**Step 1: Check the logging level**\n\nClaude code context is often consumed due to excessive logging. Check the logging level of the MCP server by running the following command:\n\n```bash\nmcp-server logs level\n```\n\nThis will display the current logging level. If it's set to DEBUG, try reducing it to INFO or WARNING.\n\n**Step 2: Increase the logging threshold**\n\nIf reducing the logging level doesn't solve the issue, you can increase the logging threshold to filter out unnecessary logs. Run the following command:\n\n```bash\nmcp-server logs level info\n```\n\nThis will set the logging level to INFO, which should reduce the amount of Claude code context consumed.\n\n**Step 3: Check for resource-intensive processes**\n\nHigh system load can also consume Claude code context. Check for resource-intensive processes running on the server:\n\n```bash\ntop -u $USER\n```\n\nLook for processes consuming excessive CPU or memory. You can also use `htop` or `sysdig` to monitor system activity.\n\n**", "metrics": { "length": 1224, "commands": 3, "command_list": [ "mcp-server logs level", "mcp-server logs level info", "top -u $USER" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.2 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Context Mode: Reducing Claude Code Context Consumption by 98% (mcp-server-that-reduces-claude-code-context-consumption-by-9)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to implement the Context Mode solution provided. Here are the concrete, actionable steps with exact commands:\n\n**Step 1: Create a PreToolUse hook**\n\nThis hook will intercept tool outputs and process them in an isolated sandbox.\n\nCreate a new file `pre_tool_use.py` in the `mcp-server` directory:\n```python\nimport os\nimport subprocess\nimport json\n\ndef pre_tool_use(event):\n # Get the tool name and output\n tool_name = event['tool_name']\n output = event['output']\n\n # Process the output in an isolated sandbox\n process = subprocess.Popen(['python', '-c', f'import io; print(io.StringIO(output))'], stdout=subprocess.PIPE)\n stdout, _ = process.communicate()\n\n # Return the processed output\n return json.loads(stdout.decode('utf-8'))\n\nevent = {'tool_name': 'your_tool_name', 'output': 'your_tool_output'}\nresult = pre_tool_use(event)\nprint(result)\n```\nReplace `your_tool_name` and `your_tool_output` with the actual values.\n\n**Step 2: Register the PreToolUse hook**\n\nIn the `mcp-server` directory, create a new file `config.py`:\n", "metrics": { "length": 1076, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 0.4 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP tool ERROR convention — inconsistency between failure paths causes silent (mcp-tool-error-convention-inconsistency)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to update the `_claude()` function in the `generate_commit_message` module to include the `ERROR:` prefix in the timeout return string. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the `_claude()` function**\n\nOpen the `generate_commit_message.py` file and update the `_claude()` function as follows:\n```python\ndef _claude():\n # ... (rest of the function remains the same)\n\n except subprocess.TimeoutExpired:\n return \"ERROR: claude -p timed out after 20s\"\n```\n**Step 2: Run the fix**\n\nRun the following commands to verify the fix:\n```bash\ngit status --short | head -5\ngit log --oneline -3\n```\nThese commands will check if the fix has been applied correctly.\n\n**Expected Output:**\n\nThe output should be:\n```\n(status)\n(recent)\n```\nThis indicates that the fix has been successful.\n\n**Verification**\n\nTo further verify the fix, you can run the following command:\n```bash\nmcp-tool --version\n```\nThis will check if the `ERROR:` prefix has been added to the timeout return string.\n\nIf everything is correct, you should", "metrics": { "length": 1078, "commands": 8, "command_list": [ "**Step 2: Run the fix**", "Run the following commands to verify the fix:", "These commands will check if the fix has been applied correctly.", "**Expected Output:**", "The output should be:" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "mcporter OAuth Authorization Must Be Serial: Concurrent Auth Causes client_id/state (mcporter-oauth-must-be-serial)", "condition": "with_lesson", "status": 200, "content": "To fix the \"mcporter OAuth Authorization Must Be Serial\" error, follow these steps:\n\n**Step 1: Run mcporter auth commands one at a time**\n\nTo avoid concurrent auth processes, run each `mcporter auth` command individually, completing the entire authorization flow (browser authorization + callback + token save) before starting the next one.\n\n```bash\n# Run the first auth command\nmcporter auth --client-id --redirect-uri --scope --code-verifier \n\n# Run the second auth command\nmcporter auth --client-id --redirect-uri --scope --code-verifier \n```\n\n**Step 2: Delete corrupted vault entries and clean token cache directory (if necessary)**\n\nIf you've already run multiple auth commands concurrently, delete the corrupted vault entries and clean the token cache directory.\n\n```bash\n# Delete vault entries for affected servers\nrm ~/.mcporter/credentials.json\n\n# Clean token cache directory\nrm -rf state.txt code_verifier.txt tokens.json\n```\n\n**Step 3: Give each server independent tokenCacheDir**\n\nTo reduce shared file conflicts, add the `--token-cache-dir", "metrics": { "length": 1152, "commands": 4, "command_list": [ "mcporter auth --client-id --redirect-uri --scope --code-verifier ", "mcporter auth --client-id --redirect-uri --scope --code-verifier ", "rm ~/.mcporter/credentials.json", "rm -rf state.txt code_verifier.txt tokens.json" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MCP tool ERROR convention — inconsistency between failure paths causes silent (mcp-tool-error-convention-inconsistency)", "condition": "plain", "status": 200, "content": "The error message \"MCP tool ERROR convention — inconsistency between failure paths causes silent (mcp-tool-error-convention-inconsistency)\" typically occurs when there's a mismatch in the error handling conventions used in different parts of the code. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Identify the inconsistent error handling**\n\nTo identify the inconsistent error handling, you'll need to check the error handling conventions used in different parts of the code. You can do this by looking at the `try-catch` blocks and error handling code in your project.\n\n**Step 2: Update error handling conventions**\n\nTo fix the error, you'll need to update the error handling conventions to be consistent throughout the code. Here are some steps to follow:\n\n**Step 3: Update the `try-catch` block**\n\nOpen the `try-catch` block where the error is occurring and update the error handling to match the convention used elsewhere in the code. For example, if you're using `try-catch` blocks with `catch` clauses, update the `catch` clause to match the convention used elsewhere in the code.\n\n```bash\n# Before\ntry {\n // code that may throw an error\n} catch (Exception e) {\n //", "metrics": { "length": 1197, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "mcporter OAuth Authorization Must Be Serial: Concurrent Auth Causes client_id/state (mcporter-oauth-must-be-serial)", "condition": "plain", "status": 200, "content": "The error \"OAuth Authorization Must Be Serial: Concurrent Auth Causes client_id/state (mcporter-oauth-must-be-serial)\" typically occurs when you're trying to authenticate with the mcporter OAuth API in a concurrent or parallel environment, such as a multi-threaded or multi-process application.\n\nHere's a concrete, actionable fix with exact commands to resolve this issue:\n\n**Step 1: Understand the issue**\n\nThe mcporter OAuth API requires that the client ID and state be sent in a serial, non-concurrent manner. This means that you should not try to authenticate with the API from multiple threads or processes simultaneously.\n\n**Step 2: Use a serial authentication mechanism**\n\nTo resolve this issue, you can use a serial authentication mechanism, such as using a lock or a semaphore to ensure that only one thread or process can authenticate with the API at a time.\n\nHere's an example using Python and the `threading` module:\n\n```python\nimport threading\n\nclass McporterOAuth:\n def __init__(self, client_id, client_secret, redirect_uri):\n self.client_id = client_id\n self.client_secret = client_secret\n self.redirect_uri = redirect_uri\n self.lock = threading.Lock()\n\n def authenticate(self):\n with self.lock:\n ", "metrics": { "length": 1263, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag (misakanet-heal-ux-gap-queue-lesson-flag-mismatch)", "condition": "with_lesson", "status": 200, "content": "To fix the CLI flag mismatch issue, you need to update the suggested commands in `search_knowledge.py` to match the actual flags used in `queue_lesson.py`. Here are the corrected commands:\n\n1. Update the `-f` flag to `--file`:\n\n Original suggested command: `MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag -f tests/fixtures/openclaw/unmatched_.log`\n\n Corrected command: `MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag --file tests/fixtures/openclaw/unmatched_.log`\n\n2. Update the `-d` flag to `--domain`:\n\n Original suggested command: `MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag -d openclaw`\n\n Corrected command: `MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag --domain openclaw`\n\n3. Update the domain placeholder:\n\n Original suggested command: `MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag `\n\n Corrected command: `MisakaNet --heal UX", "metrics": { "length": 1026, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MisakaNet --heal UX Gap — Suggested queue_lesson.py Command Uses Wrong Flag (misakanet-heal-ux-gap-queue-lesson-flag-mismatch)", "condition": "plain", "status": 200, "content": "The error message indicates that there is a mismatch between the flag used in the `MisakaNet` command and the flag used in the `queue_lesson.py` script.\n\nHere's a step-by-step fix:\n\n**Step 1: Check the flags used in the `MisakaNet` command**\n\nRun the following command to see the flags used in the `MisakaNet` command:\n```bash\nMisakaNet --help\n```\nThis will display the available flags for the `MisakaNet` command.\n\n**Step 2: Check the flags used in the `queue_lesson.py` script**\n\nOpen the `queue_lesson.py` script in a text editor or IDE. Look for the flags used in the script. You can use the following command to see the flags used in the script:\n```bash\npython queue_lesson.py --help\n```\nThis will display the available flags for the `queue_lesson.py` script.\n\n**Step 3: Identify the mismatch**\n\nCompare the flags used in the `MisakaNet` command and the `queue_lesson.py` script. Identify the flag that is used differently in each script.\n\n**Step 4: Correct the mismatch**\n\nOnce you have identified the mismatch, correct it by updating the", "metrics": { "length": 1044, "commands": 2, "command_list": [ "MisakaNet --help", "python queue_lesson.py --help" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "模型输出截断 / JSON 解析失败Handling (model-output-fix)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"模型输出截断 / JSON 解析失败Handling (model-output-fix)\", you can follow these steps:\n\n**Step 1: Increase the `max_tokens` limit**\n\nIn your code, increase the `max_tokens` limit to a higher value, such as 8192 or more. You can do this by adding the following line of code:\n```python\nmax_tokens=8192\n```\nAdd this line of code to your `client.messages.create()` function.\n\n**Step 2: Add a prompt to request complete JSON output**\n\nModify your prompt to request complete JSON output, like this:\n```python\nprompt=\"输出完整的 JSON,不要省略任何字段\"\n```\nAdd this line of code to your `client.messages.create()` function.\n\n**Step 3: Implement a function to detect truncated responses**\n\nCreate a function to detect truncated responses, like this:\n```python\ndef is_truncated(response_text: str) -> bool:\n \"\"\"检查是否被截断\"\"\"\n truncated_markers = [\n '...', 省略号结尾\n '...\"', 字符串未闭合\n '{...}', 对象被省略\n '\"', 字符串未闭合\n ]\n", "metrics": { "length": 971, "commands": 6, "command_list": [ "Add this line of code to your `client.messages.create()` function.", "**Step 2: Add a prompt to request complete JSON output**", "Modify your prompt to request complete JSON output, like this:", "Add this line of code to your `client.messages.create()` function.", "**Step 3: Implement a function to detect truncated responses**" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "模型输出截断 / JSON 解析失败Handling (model-output-fix)", "condition": "plain", "status": 200, "content": "The error \"模型输出截断 / JSON 解析失败\" (which translates to \"Model output truncation / JSON parsing failed\" in English) is often encountered when there's a problem with the model output or the JSON parsing process.\n\nHere's a concrete and actionable fix with exact commands:\n\n**Fix 1: Check the Model Output**\n\n1. Check the model's output to ensure it's not truncated or corrupted. You can do this by printing the model's output:\n```bash\npython -c \"import your_model; print(your_model.predict(input_data))\"\n```\nReplace `your_model` with the actual name of your model and `input_data` with the input data that generated the output.\n\n**Fix 2: Verify the JSON Parsing**\n\n1. Check the JSON parsing process to ensure it's working correctly. You can do this by printing the JSON output:\n```bash\npython -c \"import your_model; import json; print(json.dumps(your_model.predict(input_data)))\"\n```\nReplace `your_model` with the actual name of your model and `input_data` with the input data that generated the output.\n\n**Fix 3: Check for Encoding Issues**\n\n1. Check if there are any encoding issues with the model output or JSON parsing", "metrics": { "length": 1116, "commands": 2, "command_list": [ "python -c \"import your_model; print(your_model.predict(input_data))\"", "python -c \"import your_model; import json; print(json.dumps(your_model.predict(input_data)))\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Multi-Forum Scraping Architecture — API vs Playwright (multi-forum-scraping-architecture)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing seems to be related to the usage of Playwright in your code. Playwright is a browser automation library, and it requires a browser instance to be launched before you can use it. However, in your example, you're trying to import Playwright without specifying the browser type or launching the browser.\n\nHere's a concrete, actionable fix for your code:\n\n**Step 1: Install Playwright**\n\nYou need to install Playwright using npm or yarn. Run the following command in your terminal:\n\n```bash\nnpm install playwright\n```\n\nor\n\n```bash\nyarn add playwright\n```\n\n**Step 2: Import Playwright and specify the browser type**\n\nIn your JavaScript file, import Playwright and specify the browser type. Here's an example:\n\n```javascript\nconst { chromium } = require('playwright');\n\n(async () => {\n const browser = await chromium.launch();\n const context = await browser.newContext();\n const page = await context.newPage();\n\n // Your code here\n await page.goto('https://example.com');\n await page.waitForSelector('your-selector');\n await page.screenshot({ path: 'screenshot.png' });\n\n await browser.close();\n})();\n```\n\nReplace `'https://example.com'`", "metrics": { "length": 1169, "commands": 2, "command_list": [ "npm install playwright", "yarn add playwright" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Multi-Forum Scraping Architecture — API vs Playwright (multi-forum-scraping-architecture)", "condition": "plain", "status": 200, "content": "I don't see any error in your prompt. However, I'll provide a general solution for the multi-forum scraping architecture using API vs Playwright.\n\n**API Approach:**\n\nIf you're using APIs for scraping, ensure that you're respecting the terms of service of each forum. Here's a general approach:\n\n1. Inspect the API endpoint for each forum to understand the request parameters and response format.\n2. Use a programming language like Python or JavaScript to make HTTP requests to the API endpoints.\n3. Parse the JSON responses and extract the required data.\n\nHere's a simple example using Python and the `requests` library:\n\n```bash\npip install requests\n```\n\n```python\nimport requests\n\n# Define the API endpoints and parameters\nforums = {\n 'Reddit': {'url': 'https://www.reddit.com/r/{name}/.json', 'params': {'limit': 100}},\n 'Stack Overflow': {'url': 'https://api.stackexchange.com/2.3/questions?order=desc&sort=activity&site=stackoverflow', 'params': {'limit': 100}}\n}\n\n# Loop through each forum and extract data\nfor name, api in forums.items():\n response = requests.get(api['url'], params=api['params", "metrics": { "length": 1110, "commands": 1, "command_list": [ "pip install requests" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fix Node.js ECONNRESET Connection Reset Error in n8n Webhook HTTP Requests (n8n-nodejs-econnreset-connection-reset-fix)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fix the ECONNRESET connection reset error in n8n Webhook HTTP Requests:\n\n**Step 1: Increase Keep-Alive Socket Expiration**\n\nUpdate the `keepaliveTimeout` setting in the `n8n.json` file to a higher value.\n\n```bash\nsudo nano /usr/local/etc/n8n/n8n.json\n```\n\nAdd the following line to the file:\n\n```json\n\"keepaliveTimeout\": 300\n```\n\nThis sets the keep-alive socket expiration to 5 minutes.\n\n**Step 2: Configure Reverse Proxy & Firewall Timeouts**\n\nCheck the reverse proxy and firewall settings to ensure they are not dropping long-polling connections.\n\nFor Nginx:\n\n```bash\nsudo nano /etc/nginx/nginx.conf\n```\n\nAdd the following lines to the file:\n\n```nginx\nhttp {\n ...\n keepalive_timeout 300; # 5 minutes\n proxy_read_timeout 300; # 5 minutes\n ...\n}\n```\n\nFor Traefik:\n\n```bash\nsudo traefik configuration save\n```\n\nAdd the following lines to the `traefik.yml` file:\n\n```yml\nlog:\n level: DEBUG\n\nproviders:\n docker:\n", "metrics": { "length": 956, "commands": 8, "command_list": [ "sudo nano /usr/local/etc/n8n/n8n.json", "This sets the keep-alive socket expiration to 5 minutes.", "**Step 2: Configure Reverse Proxy & Firewall Timeouts**", "Check the reverse proxy and firewall settings to ensure they are not dropping long-polling connections.", "For Nginx:" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fix Node.js ECONNRESET Connection Reset Error in n8n Webhook HTTP Requests (n8n-nodejs-econnreset-connection-reset-fix)", "condition": "plain", "status": 200, "content": "The ECONNRESET error in Node.js is usually caused by a temporary network issue or a misconfigured connection. Here's a concrete, actionable fix for the n8n Webhook HTTP requests:\n\n**Step 1: Update n8n to the latest version**\n\nFirst, make sure you're running the latest version of n8n. You can update n8n using the following command:\n\n```bash\nn8n upgrade\n```\n\n**Step 2: Update the HTTP client**\n\nThe `econnreset` error can be caused by an outdated HTTP client. You can update the HTTP client using the following command:\n\n```bash\nnpm install --save @n8n/workflow-engine@latest @n8n/core@latest\n```\n\n**Step 3: Configure the HTTP client**\n\nCreate a new file named `http-client-config.js` in the `config` directory of your n8n installation (usually `~/.n8n/config/http-client-config.js`):\n\n```javascript\nmodule.exports = {\n maxRedirects: 5,\n maxRetries: 3,\n retryDelay: 500,\n timeout: 10000,\n};\n```\n\nThis configuration sets the maximum redirects, retries, and retry delay for the HTTP client", "metrics": { "length": 991, "commands": 2, "command_list": [ "n8n upgrade", "npm install --save @n8n/workflow-engine@latest @n8n/core@latest" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "npm install EACCES permission error on Linux and macOS (npm-eacces-permission-error-linux)", "condition": "with_lesson", "status": 200, "content": "To fix the EACCES permission error when installing packages globally with npm, follow these steps:\n\n**Step 1: Configure npm to use a user-owned global directory**\n\nOpen a terminal and run the following commands:\n\n```bash\n# Create a new directory for the global npm installation\nmkdir -p ~/.npm-global\n\n# Set the prefix for npm to use the new global directory\nnpm config set prefix ~/.npm-global\n\n# Add the new prefix to the PATH environment variable\nexport PATH=~/.npm-global/bin:$PATH\n```\n\n**Step 2: Add the PATH line to your shell configuration file**\n\nYou need to add the PATH line to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`, or `~/.profile`) to make the changes persistent. Run one of the following commands to add the line:\n\n```bash\n# For Bash shell\necho \"export PATH=~/.npm/global/bin:\\$PATH\" >> ~/.bashrc\n\n# For Zsh shell\necho \"export PATH=~/.npm/global/bin:\\$PATH\" >> ~/.zshrc\n```\n\n**Step 3: Verify the new configuration**\n\nRun the following commands to verify the changes:\n\n```bash\n# Print the updated PATH variable", "metrics": { "length": 1045, "commands": 5, "command_list": [ "mkdir -p ~/.npm-global", "npm config set prefix ~/.npm-global", "export PATH=~/.npm-global/bin:$PATH", "echo \"export PATH=~/.npm/global/bin:\\$PATH\" >> ~/.bashrc", "echo \"export PATH=~/.npm/global/bin:\\$PATH\" >> ~/.zshrc" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Node.js missing require inside try/catch silently kills win32 code path (nodejs-missing-require-inside-try-catch)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you need to move the `require` statements outside the `try/catch` block. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Move require statements to top level**\n\nOpen your JavaScript file and move the `require` statements for `os` and `path` to the top level, outside the `try/catch` block:\n\n```javascript\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\n\ntry {\n const tmpDir = os.tmpdir();\n const marker = path.join(tmpDir, \"marker.txt\");\n // spawn handler...\n} catch (_) {\n // Swallows ALL errors, including ReferenceError from missing require\n}\n```\n\n**Step 2: Verify the fix**\n\nAfter making the change, run your tests again to verify that the issue is resolved. You should no longer see the \"marker: not found\" error.\n\n**Additional suggestion**\n\nTo further improve the code, you can consider adding a `console.error` statement inside the `catch` block to log the error and provide more insight into what's happening:\n\n```javascript\ntry {\n const tmpDir = os.tmpdir();\n const marker = path.join(tmpDir, \"marker.txt\");\n ", "metrics": { "length": 1078, "commands": 4, "command_list": [ "**Step 2: Verify the fix**", "After making the change, run your tests again to verify that the issue is resolved. You should no longer see the \"marker: not found\" error.", "**Additional suggestion**", "To further improve the code, you can consider adding a `console.error` statement inside the `catch` block to log the error and provide more insight into what's happening:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "npm install EACCES permission error on Linux and macOS (npm-eacces-permission-error-linux)", "condition": "plain", "status": 200, "content": "**Fixing EACCES Permission Error with npm on Linux and macOS**\n\nThe EACCES permission error occurs when npm is unable to access a file or directory due to insufficient permissions. Here's a step-by-step solution to resolve this issue:\n\n**Method 1: Change the ownership of the npm installation directory**\n\n1. **Find the npm installation directory**: Run the following command to find the path where npm is installed:\n ```bash\nnpm config get prefix\n```\n This will give you the path where npm is installed.\n\n2. **Change the ownership of the npm installation directory**:\n ```bash\nsudo chown -R $USER:$USER /path/to/npm/installation/directory\n```\n Replace `/path/to/npm/installation/directory` with the actual path returned by `npm config get prefix`.\n\n3. **Verify the ownership**:\n ```bash\nls -ld /path/to/npm/installation/directory\n```\n This should display the ownership of the directory as `rwxr-xr-x` (owner has read, write, and execute permissions, group has read and execute permissions, others have read and execute permissions).\n\n**Method 2: Use `sudo` with `npm install`**\n\n1. **Run", "metrics": { "length": 1100, "commands": 3, "command_list": [ "npm config get prefix", "sudo chown -R $USER:$USER /path/to/npm/installation/directory", "ls -ld /path/to/npm/installation/directory" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Node.js missing require inside try/catch silently kills win32 code path (nodejs-missing-require-inside-try-catch)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to a known issue in Node.js where it silently kills the child process when it encounters a `require` statement inside a `try/catch` block. This can happen when running Windows-specific code inside a Node.js script.\n\nTo fix this issue, you can use the following approach:\n\n**Method 1: Using `process.on('exit')`**\n\nCreate a new file named `child_process.js` and add the following code:\n```javascript\nconst fs = require('fs');\nconst childProcess = require('child_process');\n\n// Run the Windows-specific code\nconst child = childProcess.spawn('your-win32-code-path.exe');\n\n// Catch the exit event\nprocess.on('exit', (code) => {\n if (code === 0) {\n console.log('Windows-specific code executed successfully');\n } else {\n console.log('Error executing Windows-specific code');\n }\n});\n```\nReplace `'your-win32-code-path.exe'` with the actual path to your Windows-specific code.\n\n**Method 2: Using `child_process.execFileSync`**\n\nCreate a new file named `child_process.js` and add the following code:\n```javascript\nconst fs = require('fs');\nconst childProcess = require('child_process');\n\n", "metrics": { "length": 1125, "commands": 3, "command_list": [ "Replace `'your-win32-code-path.exe'` with the actual path to your Windows-specific code.", "**Method 2: Using `child_process.execFileSync`**", "Create a new file named `child_process.js` and add the following code:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OpenAI 兼容 API 的通用调用格式 (openai-compatible-api-call)", "condition": "with_lesson", "status": 200, "content": "The error message you're encountering is related to the OpenAI compatible API call format. To fix this, you need to modify your API call to match the format of the service you're using.\n\nAssuming you're using the Ollama service, here's the corrected code:\n\n```bash\npython\nimport requests\nimport json\n\nurl = \"http://localhost:11434/v1/chat/completions\"\nheaders = {\"Content-Type\": \"application/json\"}\n\npayload = {\n \"model_id\": \"qwen2.5:7b\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"你是专业助手\"},\n {\"role\": \"user\", \"content\": \"你好\"}\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 1024,\n \"stream\": False\n}\n\nresp = requests.post(url, headers=headers, json=payload)\ndata = resp.json()\nprint(data[\"choices\"][0][\"message\"][\"content\"])\n```\n\nHere's a brief explanation of the changes:\n\n- `model` is replaced with `model_id` as per the Ollama service's API documentation.\n- The `model` parameter should be set to the ID of the model you want to use,", "metrics": { "length": 964, "commands": 18, "command_list": [ "python", "import requests", "import json", "url = \"http://localhost:11434/v1/chat/completions\"", "headers = {\"Content-Type\": \"application/json\"}" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OpenAI 兼容 API 的通用调用格式 (openai-compatible-api-call)", "condition": "plain", "status": 200, "content": "The error message you're encountering is due to the OpenAI API requiring a specific format for API calls. Here's how to fix it:\n\n**Error Message:**\n\n```\nOpenAI 兼容 API 的通用调用格式 (openai-compatible-api-call)\n```\n\n**Fix:**\n\nThe error message indicates that the API call is not in the correct format. To fix this, you'll need to modify your API call to use the OpenAI compatible API format.\n\n**API Call Format:**\n\nThe OpenAI API expects the following format for API calls:\n\n```bash\ncurl -X POST \\\n https://api.openai.com/v1/models/{model_id}/predictions \\\n -H 'Content-Type: application/json' \\\n -d '{\"input_text\": \"Your input text here\"}'\n```\n\nReplace `{model_id}` with the actual ID of the OpenAI model you're using.\n\n**Example:**\n\nLet's say you're using the `text-api` model. You can make a prediction like this:\n\n```bash\ncurl -X POST \\\n https://api.openai.com/v1/models/text-api/predictions \\\n -H 'Content-Type: application/json' \\\n -d '{\"input_text\": \"Your text here\"}'\n``", "metrics": { "length": 977, "commands": 5, "command_list": [ "OpenAI 兼容 API 的通用调用格式 (openai-compatible-api-call)", "curl -X POST \\", "https://api.openai.com/v1/models/{model_id}/predictions \\", "-H 'Content-Type: application/json' \\", "-d '{\"input_text\": \"Your input text here\"}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OPENCLAW_ERROR_HANDLER — Standard protocol for CLI fatal error external hooks (openclaw-fatal-error-hook-protocol)", "condition": "with_lesson", "status": 200, "content": "To address the issues with `OPENCLAW_ERROR_HANDLER`, you can create a custom handler that follows a secure protocol. Here's an example of how to implement it:\n\n**Create a custom handler**\n\nCreate a new file named `openclaw-fatal-error-handler.js` with the following content:\n```javascript\nconst fs = require('fs');\nconst path = require('path');\nconst { spawn } = require('child_process');\nconst { stdin, stdout, stderr } = require('process');\n\nconst handler = async (error, stdout, stderr) => {\n // Create a secure log file\n const logFilePath = '/var/log/openclaw-errors.log';\n fs.writeFileSync(logFilePath, `Error: ${error.message}\\n`);\n\n // Send the error message to a secure webhook\n const webhookUrl = 'https://your-webhook-url.com/openclaw-error';\n const headers = { 'Content-Type': 'application/json' };\n const body = JSON.stringify({ error: error.message });\n const options = { method: 'POST', headers, body };\n const response = await fetch(webhookUrl, options);\n if (!response.ok) {\n console.error(`Failed to send error to webhook: ${response.status}`);\n }\n\n ", "metrics": { "length": 1081, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "openclaw gateway dynamic module missing (openclaw-gateway-dynamic-module-missing)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"openclaw gateway dynamic module missing (openclaw-gateway-dynamic-module-missing)\", you need to restart the OpenClaw Gateway service and update the credentials file.\n\nHere are the steps:\n\n1. Restart the OpenClaw Gateway service:\n```bash\nsystemctl --user restart openclaw-gateway\n```\nThis will restart the service and regenerate the dynamic modules.\n\n2. Update the credentials file:\n```json\n{\n \"version\": 1,\n \"allowFrom\": [\n \"ou_3dc2416c9a7a4c297a19d87fd8edbccc\",\n \"oc_51cd445c9162f2d622f1a984e8bc3f4f\"\n ]\n}\n```\nYou can add the group ID to the `allowFrom` list in the `~/.openclaw/credentials/feishu-default-allowFrom.json` file.\n\n3. Restart the OpenClaw Gateway service again:\n```bash\nsystemctl --user restart openclaw-gateway\n```\nThis will apply the changes to the credentials file and restart the service.\n\nTo verify the fix, you can check the following:\n\n* Run the following command to check", "metrics": { "length": 921, "commands": 3, "command_list": [ "systemctl --user restart openclaw-gateway", "You can add the group ID to the `allowFrom` list in the `~/.openclaw/credentials/feishu-default-allowFrom.json` file.", "3. Restart the OpenClaw Gateway service again:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OPENCLAW_ERROR_HANDLER — Standard protocol for CLI fatal error external hooks (openclaw-fatal-error-hook-protocol)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the OpenCLAW framework, which is used for testing and validating OpenCL kernels. The error `OPENCLAW_ERROR_HANDLER` is typically raised when there's an issue with the fatal error handler.\n\nTo fix this error, you'll need to create or modify the fatal error handler function. Here's a step-by-step guide to create a custom fatal error handler:\n\n**Step 1: Create a new file for the fatal error handler**\n\nCreate a new file named `fatal_error_handler.claw` in the OpenCLAW installation directory (usually `~/.openclaw/fatal_error_handler.claw` or `C:\\Users\\YourUsername\\.openclaw\\fatal_error_handler.claw`).\n\n**Step 2: Define the fatal error handler function**\n\nIn the `fatal_error_handler.claw` file, define a function that takes two arguments: `error_code` and `error_message`. This function will be called when an error occurs.\n\nHere's an example implementation:\n```claw\nvoid fatal_error_handler(int error_code, const char* error_message) {\n printf(\"FATAL ERROR: %d - %s\\n\", error_code, error_message);\n // Add additional error handling or logging as needed\n", "metrics": { "length": 1107, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "openclaw prefer cli and policy over direct edit (openclaw-prefer-cli-and-policy-over-direct-edit)", "condition": "with_lesson", "status": 200, "content": "To fix the error `openclaw prefer cli and policy over direct edit (openclaw-prefer-cli-and-policy-over-direct-edit)`, you can follow these steps:\n\n**Step 1: Remove direct file editing from your configuration**\n\nOpen your `~/.openclaw/config.yaml` file in a text editor and remove any direct file editing lines, such as:\n\n```yaml\nmodel:\n default: gpt-4o-mini\n # TEMP HACK - remove after 2026-07-20, tracked in ISSUE-4321\n```\n\n**Step 2: Use the official CLI to configure your model**\n\nUse the following commands to configure your model using the official CLI:\n\n```bash\nopenclaw config set model.default gpt-4o\nopenclaw config set gateway.timeout 30\n```\n\n**Step 3: Verify your configuration**\n\nUse the following command to verify that your configuration has been set correctly:\n\n```bash\nopenclaw config get model.default\n```\n\nThis should output `gpt-4o`.\n\n**Step 4: Remove temporary hack comments**\n\nIf you have any temporary hack comments in your configuration file, remove them now. For example:\n\n```yaml\nTEMP HACK - remove after 2026-", "metrics": { "length": 1036, "commands": 7, "command_list": [ "**Step 2: Use the official CLI to configure your model**", "Use the following commands to configure your model using the official CLI:", "**Step 3: Verify your configuration**", "Use the following command to verify that your configuration has been set correctly:", "This should output `gpt-4o`." ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "openclaw gateway dynamic module missing (openclaw-gateway-dynamic-module-missing)", "condition": "plain", "status": 200, "content": "The error \"openclaw gateway dynamic module missing\" typically occurs when the OpenCLAW gateway dynamic module is not properly installed or configured. Here's a step-by-step guide to resolve this issue:\n\n**Prerequisites:**\n\n* OpenCLAW installed on your system\n* Familiarity with Linux command-line interface (CLI)\n\n**Fix:**\n\n1. **Update OpenCLAW package:**\n ```bash\nsudo apt update\nsudo apt upgrade openclaw\n```\n This command updates the OpenCLAW package to the latest version, which may include the necessary dynamic module.\n\n2. **Reinstall OpenCLAW gateway dynamic module:**\n ```bash\nsudo apt install --reinstall openclaw-gateway-dynamic-module\n```\n This command reinstalls the OpenCLAW gateway dynamic module, which may resolve the missing issue.\n\n3. **Check for dependencies:**\n ```bash\nsudo apt install -f\n```\n This command checks for any missing dependencies and installs them.\n\n4. **Verify OpenCLAW installation:**\n ```bash\nopenclaw --version\n```\n This command checks the version of OpenCLAW installed on your system.\n\n5. **Restart OpenCLAW service (if necessary):**\n", "metrics": { "length": 1089, "commands": 5, "command_list": [ "sudo apt update", "sudo apt upgrade openclaw", "sudo apt install --reinstall openclaw-gateway-dynamic-module", "sudo apt install -f", "openclaw --version" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OpenClaw 重装教训 — 删除前先停服务清残留 (openclaw-reinstall-lesson)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the OpenClaw reinstall lesson:\n\n**Step 1: Stop and remove existing services**\n\n```bash\n# Stop the existing service\nsystemctl --user stop openclaw-gateway.service\n\n# Remove any remaining OpenClaw processes\npkill -f openclaw || true\n```\n\n**Step 2: Check for remaining processes**\n\n```bash\n# Check for any remaining OpenClaw processes\nps aux | grep openclaw\n# Expected output: Nothing\n\n# Check for any remaining OpenClaw connections\nss -tlnp | grep -E '18790|3456'\n# Expected output: Nothing\n```\n\n**Step 3: Uninstall global package**\n\n```bash\n# Uninstall the global OpenClaw package\nnpm uninstall -g openclaw\n```\n\n**Step 4: Clean up remaining directories**\n\n```bash\n# Remove any remaining OpenClaw directories\nrm -rf ~/.npm-global/lib/node_modules/openclaw\nrm -rf ~/.config/openclaw\n```\n\n**Step 5: Reinstall OpenClaw**\n\n```bash\n# Reinstall OpenClaw with the global package manager\nnpm install -g openclaw --prefix ~/.npm-global", "metrics": { "length": 962, "commands": 7, "command_list": [ "systemctl --user stop openclaw-gateway.service", "pkill -f openclaw || true", "ps aux | grep openclaw", "ss -tlnp | grep -E '18790|3456'", "npm uninstall -g openclaw" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "OpenClaw 重装教训 — 删除前先停服务清残留 (openclaw-reinstall-lesson)", "condition": "plain", "status": 200, "content": "The error \"OpenClaw 重装教训 — 删除前先停服务清残留 (openclaw-reinstall-lesson)\" typically occurs when OpenClaw is unable to remove residual services before reinstalling. Here's a step-by-step guide to resolve this issue:\n\n**Step 1: Stop OpenClaw services**\n\n1. Open the Command Prompt as an administrator:\n - Windows: Press the Windows key + X and select Command Prompt (Admin).\n - macOS: Open Terminal.\n\n2. Stop OpenClaw services:\n ```bash\nsudo service openclaw stop\n```\n\n**Step 2: Remove OpenClaw configuration files**\n\n1. Open the Terminal.\n2. Navigate to the OpenClaw configuration directory:\n ```bash\ncd /usr/local/openclaw/etc\n```\n (Adjust the path according to your OpenClaw installation location.)\n\n3. Remove the configuration files:\n ```bash\nsudo rm -rf *\n```\n\n**Step 3: Remove OpenClaw database files**\n\n1. Navigate to the OpenClaw database directory:\n ```bash\ncd /usr/local/openclaw/var\n```\n (Adjust the path according to your OpenClaw installation location.)\n\n2. Remove the database files", "metrics": { "length": 1003, "commands": 4, "command_list": [ "sudo service openclaw stop", "cd /usr/local/openclaw/etc", "sudo rm -rf *", "cd /usr/local/openclaw/var" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "openclaw prefer cli and policy over direct edit (openclaw-prefer-cli-and-policy-over-direct-edit)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the OpenCLAW configuration. The error message indicates that OpenCLAW is set to prefer CLI and policy over direct edit. To resolve this issue, you'll need to modify the OpenCLAW configuration to allow direct edit.\n\nHere's a step-by-step guide to fix the issue:\n\n**For Windows users:**\n\n1. Open the Command Prompt as an administrator.\n2. Navigate to the OpenCLAW installation directory using the following command:\n ```bash\ncd C:\\Program Files\\OpenCLAW\n```\n Replace `C:\\Program Files\\OpenCLAW` with the actual path to the OpenCLAW installation directory on your system.\n\n3. Run the following command to edit the OpenCLAW configuration file:\n ```bash\nnotepad C:\\Program Files\\OpenCLAW\\config.xml\n```\n This will open the `config.xml` file in Notepad.\n\n4. Locate the following line in the `config.xml` file:\n ```xml\n\n```\n If this line exists, delete it. If it doesn't exist, add it with the following content:\n ```xml\n<", "metrics": { "length": 1054, "commands": 3, "command_list": [ "cd C:\\Program Files\\OpenCLAW", "notepad C:\\Program Files\\OpenCLAW\\config.xml", "If this line exists, delete it. If it doesn't exist, add it with the following content:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Permission Denied / WSL NTFS 跨文件系统PermissionFix (permission-denied-fix)", "condition": "plain", "status": 200, "content": "The \"Permission Denied\" error in WSL (Windows Subsystem for Linux) when trying to access an NTFS file system is often caused by the lack of permission to read or write files on the NTFS partition. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Enable WSL File System Access**\n\n1. Open a PowerShell or Command Prompt window on your Windows 10 or Windows 11 machine.\n2. Run the following command to enable WSL file system access:\n ```powershell\nwsl --set-default-version 2\n```\n or\n ```bash\nwsl --set-default-version 2\n```\n This will enable WSL 2, which supports file system access.\n\n**Step 2: Update the WSL File System**\n\n1. Run the following command to update the WSL file system:\n ```powershell\nwsl --update\n```\n or\n ```bash\nwsl --update\n```\n This will update the WSL file system to support file system access.\n\n**Step 3: Mount the NTFS Partition**\n\n1. Identify the NTFS partition you want to access. You can do this by running the following command:\n ```powershell\nw", "metrics": { "length": 1005, "commands": 8, "command_list": [ "or", "This will enable WSL 2, which supports file system access.", "**Step 2: Update the WSL File System**", "1. Run the following command to update the WSL file system:", "or" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Permission Denied / WSL NTFS 跨文件系统PermissionFix (permission-denied-fix)", "condition": "with_lesson", "status": 200, "content": "解决 WSL NTFS 跨文件系统 Permission Denied 错误的步骤如下:\n\n**步骤 1: 在 WSL 内部执行 permission_denied_fix 命令**\n\n```bash\nsudo cat /etc/wsl.conf << 'EOF'\n[automount]\nenabled = true\noptions = \"metadata,umask=22\"\nEOF\n```\n\n**步骤 2: 重启 WSL**\n\n```bash\nwsl --shutdown\n```\n\n**步骤 3: 改变所有权**\n\n```bash\nsudo chown -R $(id -u):$(id -g) ~/.hermes/\n```\n\n或者,增加所有用户的写入权限:\n\n```bash\nchmod -R u+w ~/.hermes/\n```\n\n如果是单个文件,则可以使用:\n\n```bash\nchmod u+w ~/.hermes/some_file\n```\n\n**步骤 4: 检查当前用户权限**\n\n```bash\nid\nls -la ~/.hermes/\nstat ~/.hermes/some_file\n```\n\n**步骤 5: 验证 fix 命令**\n\n```bash\nsudo cat /etc/wsl.conf << 'EOF'\necho \"Verification passed:", "metrics": { "length": 599, "commands": 12, "command_list": [ "sudo cat /etc/wsl.conf << 'EOF'", "[automount]", "enabled = true", "options = \"metadata,umask=22\"", "EOF" ], "has_command_block": true, "actionable": false, "inline_code_count": 12, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "pip install Network Timeout / SSL ErrorFix (pip-install-timeout-ssl)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to the fact that `pip-install-timeout-ssl` is not a valid package. \n\nInstead, you can use `pip install --upgrade pip` and then `pip install requests` and `pip install urllib3` to install the required packages.\n\nHere are the exact commands:\n\n```bash\n# Update pip\npython -m pip install --upgrade pip\n\n# Install requests and urllib3\npython -m pip install requests\npython -m pip install urllib3\n```\n\nIf you still encounter issues with SSL certificates, you can try the following:\n\n```bash\n# Install the certifi package\npython -m pip install certifi\n\n# Install the ca-certificate package\npython -m pip install ca-certificate\n```\n\nAfter installing these packages, try running your original command:\n\n```bash\npip install Network Timeout / SSL ErrorFix\n```\n\nIf you're still experiencing issues, it's possible that the package you're trying to install doesn't exist or is not compatible with your Python version.", "metrics": { "length": 947, "commands": 6, "command_list": [ "python -m pip install --upgrade pip", "python -m pip install requests", "python -m pip install urllib3", "python -m pip install certifi", "python -m pip install ca-certificate" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "pip install Network Timeout / SSL ErrorFix (pip-install-timeout-ssl)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the pip install error:\n\n**Step 1: Update pip and install the latest version of certifi**\n\nOpen a terminal or command prompt and run the following commands:\n\n```bash\npython -m pip install --upgrade pip\npython -m pip install certifi\n```\n\n**Step 2: Set the global index URL to a fast and reliable mirror**\n\nSet the global index URL to a fast and reliable mirror, such as the one provided by Tsinghua University:\n\n```bash\npip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple\n```\n\n**Step 3: Verify the current configuration**\n\nRun the following command to verify the current configuration:\n\n```bash\npip config list\n```\n\nThis should output something like:\n\n```\nglobal.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'\n```\n\n**Step 4: Install the package**\n\nNow you can install the package using pip:\n\n```bash\npip install \n```\n\nReplace `` with the name of the package you want to install.\n\nIf you encounter any issues during installation, you can try specifying a temporary index URL and increasing the timeout:\n\n```bash\npip install --default", "metrics": { "length": 1123, "commands": 6, "command_list": [ "python -m pip install --upgrade pip", "python -m pip install certifi", "pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple", "pip config list", "global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 4, "lesson_hit_rate": 0.8 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright 在受限容器/sandbox 启动 snap chromium:用 chrome-headless-shell + LD_LIBRARY_PATH 绕开 snap-confine (playwright-snap-chromium-libnss3-sandbox-launch)", "condition": "with_lesson", "status": 200, "content": "为了解决这个问题,我们需要使用 Playwright 缓存里的 `chrome-headless-shell`二进制,指定 `executablePath`,并注入 `LD_LIBRARY_PATH`。下面是具体的命令和步骤:\n\n1. 通过 Playwright 缓存里的 `chrome-headless-shell`二进制找到路径:\n ```javascript\nconst fs = require('node:fs');\nconst path = require('node:path');\n\nconst cacheRoot = path.join(\n process.env.HOME || '/root',\n '.cache/ms-playwright'\n);\nconst dirs = fs.readdirSync(cacheRoot)\n .filter(d => d.startsWith('chromium_headless_shell-'));\nconst shellPath = path.join(\n cacheRoot,\n dirs[0],\n 'chrome-linux/headless_shell'\n);\n```\n2. 使用 `executablePath` 指定 `chrome-headless-shell`二进制的路径:\n ```javascript\nconst browser = await playwright.chromium.launch({\n executablePath: shellPath,\n headless: true,\n args: [\n '--no-sandbox',\n '--disable-setuid-sandbox',\n '--disable-dev-shm-usage',\n '--disable-features=libnss3',\n '--disable-", "metrics": { "length": 846, "commands": 1, "command_list": [ "2. 使用 `executablePath` 指定 `chrome-headless-shell`二进制的路径:" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Genius issue evaluator: batch review intake issues (pr-genius-issue-evaluator-for-intake)", "condition": "with_lesson", "status": 200, "content": "To resolve the PR Genius issue evaluator: batch review intake issues, you can follow these steps:\n\n1. First, update your GitHub repository to use the latest version of PR Genius. You can do this by running the following command in your terminal:\n\n ```bash\nprgenius update --repo Ikalus1988/MisakaNet\n```\n\n2. Next, evaluate all intake issues in batch mode using the following command:\n\n ```bash\nprgenius issue-batch --repo Ikalus1988/MisakaNet --label intake --limit 20\n```\n\n This command will evaluate the intake issues in batches of 20, providing you with a score (0-100), tier (low_risk / medium_risk / high_risk), quality_grade (A-F), is_spam, is_crawler_friendly, signals (positive/negative), and checklist (actionable items) for each issue.\n\n3. After running the `prgenius issue-batch` command, you can verify that the output is correct by checking the lessons file. Run the following command in your terminal:\n\n ```bash\ngrep -i mcp lessons/contrib/mcp-.md 2/dev/null | head -3\necho MCP verified\n``", "metrics": { "length": 1011, "commands": 2, "command_list": [ "prgenius update --repo Ikalus1988/MisakaNet", "prgenius issue-batch --repo Ikalus1988/MisakaNet --label intake --limit 20" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright 在受限容器/sandbox 启动 snap chromium:用 chrome-headless-shell + LD_LIBRARY_PATH 绕开 snap-confine (playwright-snap-chromium-libnss3-sandbox-launch)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to a limitation in the Playwright snap package for Chromium. To resolve this issue, you can try the following steps:\n\n**Method 1: Using `--no-sandbox` flag**\n\nYou can try running Playwright with the `--no-sandbox` flag, which will disable the sandboxing feature:\n\n```bash\nplaywright --no-sandbox launch --headless --chromium\n```\n\n**Method 2: Setting `LD_LIBRARY_PATH` environment variable**\n\nYou can also try setting the `LD_LIBRARY_PATH` environment variable to bypass the `snap-confine` issue:\n\n```bash\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libnss3.so\nplaywright launch --headless --chromium\n```\n\n**Method 3: Using `--disable-sandbox` flag (for Chromium 96 and later)**\n\nIf you're using Chromium 96 or later, you can try using the `--disable-sandbox` flag:\n\n```bash\nplaywright --disable-sandbox launch --headless --chromium\n```\n\n**Method 4: Using `--no-sandbox` and `--disable-extensions` flags (for Chromium 96 and later)**\n\n", "metrics": { "length": 993, "commands": 4, "command_list": [ "playwright --no-sandbox launch --headless --chromium", "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libnss3.so", "playwright launch --headless --chromium", "playwright --disable-sandbox launch --headless --chromium" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python GBK Encoding Error — Windows/WSL 跨平台 (python-gbk-encoding-error)", "condition": "with_lesson", "status": 200, "content": "Here are the steps to fix the Python GBK Encoding Error in WSL:\n\n### Step 1: Specify encoding when reading and writing files\n\nUpdate your Python script to specify the encoding when reading and writing files:\n```python\n# Read file with UTF-8 encoding\nwith open(\"file.txt\", \"r\", encoding=\"utf-8\") as f:\n content = f.read()\n\n# Write file with UTF-8 encoding\nwith open(\"file.txt\", \"w\", encoding=\"utf-8\") as f:\n f.write(content)\n```\n### Step 2: Set environment variables (recommended for permanent solution)\n\nAdd the following lines to your `~/.bashrc` file to set the environment variables permanently:\n```bash\nexport PYTHONIOENCODING=utf-8\nexport LANG=C.UTF-8\n```\nThen, run the following command to apply the changes:\n```bash\nsource ~/.bashrc\n```\n### Step 3: Update system locale (optional)\n\nIf you want to update the system locale, run the following command:\n```bash\nsudo locale-gen zh_CN.UTF-8\n```\nThis will update the locale to Chinese (Simplified) using the UTF-8 encoding.\n\n### Step 4: Verify the changes\n\n", "metrics": { "length": 1014, "commands": 3, "command_list": [ "Add the following lines to your `~/.bashrc` file to set the environment variables permanently:", "Then, run the following command to apply the changes:", "If you want to update the system locale, run the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Genius issue evaluator: batch review intake issues (pr-genius-issue-evaluator-for-intake)", "condition": "plain", "status": 200, "content": "I can guide you through the process of fixing the PR Genius issue evaluator. \n\nThe error you're experiencing is likely due to missing dependencies or incorrect configuration. Here's a step-by-step solution:\n\n**Step 1: Update the dependencies**\n\nRun the following command to update the dependencies:\n\n```bash\npip install --upgrade -r requirements.txt\n```\n\n**Step 2: Install the required packages**\n\nIf the above command doesn't resolve the issue, you might need to install additional packages. You can try the following:\n\n```bash\npip install pandas\npip install numpy\npip install scikit-learn\n```\n\n**Step 3: Check the configuration**\n\nPR Genius issue evaluator uses a configuration file named `pr_genius_config.py`. Make sure this file is in the correct location and contains the necessary settings.\n\n```python\n# pr_genius_config.py\n# Define your configuration here\nPR_GENIUS_API_KEY = 'YOUR_API_KEY'\nPR_GENIUS_BASE_URL = 'https://api.pr-genius.com'\n```\n\nReplace `'YOUR_API_KEY'` with your actual PR Genius API key.\n\n**Step 4: Check the environment variables**\n\nPR Genius issue evaluator also uses environment variables. Make sure the following variables are set:\n\n```bash\n", "metrics": { "length": 1171, "commands": 7, "command_list": [ "pip install --upgrade -r requirements.txt", "pip install pandas", "pip install numpy", "pip install scikit-learn", "Replace `'YOUR_API_KEY'` with your actual PR Genius API key." ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python GBK Encoding Error — Windows/WSL 跨平台 (python-gbk-encoding-error)", "condition": "plain", "status": 200, "content": "The GBK encoding error in Python typically occurs when you're trying to read or write files using the GBK encoding on a system that doesn't support it. Here's a concrete, actionable fix:\n\n**Method 1: Install the `gbk` encoding package**\n\nYou can install the `gbk` encoding package using pip, which is Python's package manager. Open a terminal or command prompt and run the following command:\n\n```bash\nsudo apt-get update\nsudo apt-get install python3-gbk\n```\n\n**Method 2: Use the `chardet` library to detect the encoding**\n\nIf the above method doesn't work, you can try using the `chardet` library to detect the encoding of your files. First, install the `chardet` library using pip:\n\n```bash\npip3 install chardet\n```\n\nThen, use the following code to detect the encoding of a file:\n\n```python\nimport chardet\n\nwith open('your_file.txt', 'rb') as f:\n result = chardet.detect(f.read())\n print(result)\n```\n\nReplace `'your_file.txt'` with the path to your file.\n\n**Method 3: Use the `codecs` module to specify the encoding", "metrics": { "length": 1022, "commands": 3, "command_list": [ "sudo apt-get update", "sudo apt-get install python3-gbk", "pip3 install chardet" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python 沙箱/受限环境 — PATH 和 sys.path 隔离 (python-sandbox-path-isolation)", "condition": "with_lesson", "status": 200, "content": "为了解决 Python 沙箱/受限环境 — PATH 和 sys.path 隔离问题,我们需要遵循以下步骤:\n\n1. 确认是否在正确的 venv 中\n2. 强制指定解释器(在 shell 中)\n3. 在沙箱中临时添加路径\n4. 检查 PATH(子进程会继承)\n5. 验证 import 来源\n\n下面是具体的命令和示例:\n\n**步骤 1: 确认是否在正确的 venv 中**\n\n```bash\n# 切换到正确的 venv\ncd /path/to/your/venv\n\n# 确认是否在正确的 venv 中\npython3 --version\npython3 -c 'import sys; print(sys.version)'\n```\n\n**步骤 2: 强制指定解释器(在 shell 中)**\n\n```bash\n# 指定解释器\n/path/to/venv/bin/python script.py\n```\n\n**步骤 3: 在沙箱中临时添加路径**\n\n```python\n# 在 Python 中临时添加路径\nimport sys\nimport os\n\nsys.path.insert(0, \"/path", "metrics": { "length": 502, "commands": 4, "command_list": [ "cd /path/to/your/venv", "python3 --version", "python3 -c 'import sys; print(sys.version)'", "/path/to/venv/bin/python script.py" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python 代码修改不生效 — stale .pyc Cache (python-pycache-stale)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to a stale `.pyc` cache file. Here's a step-by-step solution to resolve this issue:\n\n**Method 1: Delete the stale `.pyc` cache manually**\n\n1. Locate the directory where your Python scripts are located. This is usually `C:\\Users\\YourUsername\\AppData\\Local\\Python\\Python3.x\\site-packages` (Windows) or `~/.local/lib/pythonX.X/site-packages/` (Linux/Mac).\n2. Open a command prompt or terminal.\n3. Navigate to the directory where you found in step 1 using the `cd` command. For example:\n - Windows: `cd C:\\Users\\YourUsername\\AppData\\Local\\Python\\Python3.x\\site-packages`\n - Linux/Mac: `cd ~/.local/lib/pythonX.X/site-packages/`\n4. Delete all the `.pyc` files in the directory using the `rm` command. For example:\n - Windows: `rm *.pyc`\n - Linux/Mac: `rm *.pyc`\n\n**Method 2: Use pip to delete the stale cache**\n\n1. Open a command prompt or terminal.\n2. Navigate to the directory where your Python scripts are located.\n3", "metrics": { "length": 959, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python 代码修改不生效 — stale .pyc Cache (python-pycache-stale)", "condition": "with_lesson", "status": 200, "content": "以下是具体的步骤来解决这个问题:\n\n**步骤 1:删除当前项目下所有 __pycache__ 目录**\n\n```bash\nfind . -type d -name __pycache__ -exec rm -rf {} +\n```\n\n**步骤 2: 同时删除散落的 .pyc 文件**\n\n```bash\nfind . -name \".pyc\" -delete\n```\n\n**步骤 3:针对单个模块清理**\n\n```bash\nrm -rf path/to/module/__pycache__\n```\n\n**步骤 4: 使用环境变量禁止 Python 写入字节码缓存**\n\n```bash\nexport PYTHONDONTWRITEBYTECODE=1\npython your_script.py\n```\n\n**步骤 5: 强制 Python 重新编译所有模块**\n\n```bash\npython -m compileall .\n```\n\n**步骤 6: 查看某个模块实际加载的是源码还是缓存**\n\n```bash\npython -c \"import your_module; import inspect; print(inspect.getfile(your_module))\"\n```\n\n**快速验证改动是否生效**\n\n在脚本顶部临时添加:\n\n", "metrics": { "length": 575, "commands": 7, "command_list": [ "find . -type d -name __pycache__ -exec rm -rf {} +", "find . -name \".pyc\" -delete", "rm -rf path/to/module/__pycache__", "export PYTHONDONTWRITEBYTECODE=1", "python your_script.py" ], "has_command_block": true, "actionable": false, "inline_code_count": 11, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fix Python Smtplib SSL Certificate Verify Failed Error When Sending Emails (python-smtplib-ssl-certificate-verify-failed-fix)", "condition": "with_lesson", "status": 200, "content": "Fix Python Smtplib SSL Certificate Verify Failed Error When Sending Emails\n\n**Решение:**\n\nЧтобы решить проблему SSL Certificate Verify Failed при отправке электронных писем через SMTP-сервер Gmail, вы можете использовать следующее решение:\n\n### 1. Добавление локальных корневых сертификатов (CA Certificates)\n\nЕсли вы используете чистый Python на Windows или macOS, вы можете добавить локальные корневые сертификаты (CA Certificates) к Python.\n\n**Для Windows:**\n\n1. Скачайте и установите OpenSSL:\n ```bash\nwinget install --exact-match python\n```\n2. Добавьте локальные корневые сертификаты (CA Certificates) к Python:\n ```bash\npython -m ssl.match_hostname -k\n```\n\n**Для macOS/Linux:**\n\n1. Установите OpenSSL:\n ```bash\nsudo apt-get install openssl\n```\n2. Добавьте локальные корневые сертификаты (CA Certificates) к Python:\n ```bash\nsudo python -m ssl.match_hostname -k\n```\n\n### 2. Использование ssl.create_default_context() с параметром verify=False\n\nЕсли", "metrics": { "length": 961, "commands": 4, "command_list": [ "winget install --exact-match python", "python -m ssl.match_hostname -k", "sudo apt-get install openssl", "sudo python -m ssl.match_hostname -k" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python 沙箱/受限环境 — PATH 和 sys.path 隔离 (python-sandbox-path-isolation)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to Python's sandboxing and path isolation. This issue can be resolved by modifying the `sys.path` and `PATH` environment variables in your Python environment.\n\nHere's a step-by-step solution:\n\n**For Linux and macOS:**\n\n1. Create a new file named `~/.pythonprofile` (for Linux and macOS) or `~/.python` (for macOS) with the following content:\n\n```python\nimport sys\nsys.path.insert(0, '/path/to/your/project')\n```\n\nReplace `/path/to/your/project` with the actual path to your project.\n\n2. Run the following command to apply the changes:\n\n```bash\npython -m site --user-site ~/.pythonprofile\n```\n\nor\n\n```bash\npython -m site --user-site ~/.python\n```\n\n**For Windows:**\n\n1. Create a new file named `C:\\Users\\YourUsername\\.python` (replace `YourUsername` with your actual username) with the following content:\n\n```python\nimport sys\nsys.path.insert(0, 'C:\\\\path\\\\to\\\\your\\\\project')\n```\n\nReplace `C:\\path\\to\\your\\project` with the actual path to your project.\n\n2. Run the", "metrics": { "length": 1004, "commands": 5, "command_list": [ "Replace `/path/to/your/project` with the actual path to your project.", "2. Run the following command to apply the changes:", "or", "**For Windows:**", "1. Create a new file named `C:\\Users\\YourUsername\\.python` (replace `YourUsername` with your actual username) with the following content:" ], "has_command_block": true, "actionable": true, "inline_code_count": 15, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python venv 中 tiktoken 安装后仍报 ModuleNotFoundError (python-venv-tiktoken-module-not-found)", "condition": "with_lesson", "status": 200, "content": "解决 Python venv 中 tiktoken 安装后仍报 ModuleNotFoundError 的问题:\n\n1. first,确保pip可用:\n ```bash\n python -m ensurepip\n ```\n\n2. 重新安装setuptools:\n ```bash\n pip install setuptools\n ```\n\n3. 重新安装tiktoken:\n ```bash\n pip install tiktoken\n ```\n\n4. 如果问题 persists,尝试重建venv:\n ```bash\n python -m venv venv --include-pip\n pip install tiktoken\n ```\n\n5. 验证tiktoken的安装:\n ```bash\n python -c \"import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print(enc.encode('hello'))\"\n ```\n\n6. 在Windows + WSL2混合环境中,建议使用python -m ensurepip初始化venv,以避免这种情况。", "metrics": { "length": 574, "commands": 6, "command_list": [ "python -m ensurepip", "pip install setuptools", "pip install tiktoken", "python -m venv venv --include-pip", "pip install tiktoken" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 5, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fix Python Smtplib SSL Certificate Verify Failed Error When Sending Emails (python-smtplib-ssl-certificate-verify-failed-fix)", "condition": "plain", "status": 200, "content": "**Fixing Python Smtplib SSL Certificate Verify Failed Error**\n\nThe \"SSL Certificate Verify Failed\" error occurs when the Python `smtplib` library is unable to verify the SSL certificate of the SMTP server you're trying to connect to. This can be due to various reasons such as:\n\n* The SMTP server's SSL certificate is not trusted by the system.\n* The system's clock is not synchronized with the SMTP server's clock.\n* The system's SSL/TLS configuration is not properly set up.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Method 1: Update the system's SSL/TLS configuration**\n\nThis method updates the system's SSL/TLS configuration to trust the SMTP server's certificate.\n\n```bash\n# Update the system's SSL/TLS configuration\nsudo apt-get update && sudo apt-get install ca-certificates\n```\n\n**Method 2: Add the SMTP server's certificate to the system's trusted certificates**\n\nThis method adds the SMTP server's certificate to the system's trusted certificates.\n\n```bash\n# Get the SMTP server's certificate\ncurl -s -o /etc/ssl/certs/smtp_server.crt https://smtp.example.com/certificates.crt\n\n# Add the certificate to the system's trusted certificates\nsudo update-ca", "metrics": { "length": 1178, "commands": 1, "command_list": [ "sudo apt-get update && sudo apt-get install ca-certificates" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python venv 中 tiktoken 安装后仍报 ModuleNotFoundError (python-venv-tiktoken-module-not-found)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a version incompatibility between the `python-venv` package and the `tiktoken` library. Here's a step-by-step solution to resolve the issue:\n\n**Step 1: Update your Python version**\n\nBefore proceeding, ensure you're using the latest version of Python. You can check your current Python version by running:\n```bash\npython --version\n```\nIf you're using an older version, consider updating to the latest version using your package manager or by downloading the latest version from the official Python website.\n\n**Step 2: Install `python-venv` and `pytorch`**\n\nMake sure you have `python-venv` and `pytorch` installed. If not, you can install them using pip:\n```bash\npip install --upgrade python-venv\npip install torch torchvision\n```\n**Step 3: Install `transformers` and `tokall`**\n\nThe `tiktoken` library is part of the `transformers` package. To install `transformers` and its dependencies, run:\n```bash\npip install transformers\n```\nHowever, the `transformers` package has a dependency on `tokall`, which is not available on PyPI.", "metrics": { "length": 1075, "commands": 4, "command_list": [ "python --version", "pip install --upgrade python-venv", "pip install torch torchvision", "pip install transformers" ], "has_command_block": true, "actionable": true, "inline_code_count": 18, "lesson_hits": 5, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python venv 激活失败或路径不匹配 (python-venv-troubleshoot)", "condition": "plain", "status": 200, "content": "The error \"激活失败或路径不匹配\" which translates to \"activation failed or path not matched\" in English, is a common issue when trying to activate a Python virtual environment (venv) in Windows.\n\nHere's a step-by-step solution:\n\n**Method 1: Reinstall Python**\n\n1. Uninstall Python from your system (if you haven't already).\n2. Download the latest version of Python from the official Python website: https://www.python.org/downloads/\n3. Run the installer and follow the prompts to install Python.\n4. Once installed, open a new Command Prompt or PowerShell as an administrator.\n5. Navigate to the directory where you installed Python (e.g., `C:\\Python39`).\n6. Run the following command to activate the venv:\n ```bash\npython -m venv --upgrade\n```\n7. Activate the venv:\n ```bash\n.\\Scripts\\activate\n```\n (on Windows)\n\n**Method 2: Fix the PATH Environment Variable**\n\n1. Open the System Properties window:\n - Right-click on \"Computer\" or \"This PC\" and select \"Properties\".\n - Click on \"Advanced system settings\" on the left side.\n - Click on \"Environment Variables\".\n", "metrics": { "length": 1063, "commands": 2, "command_list": [ "python -m venv --upgrade", ".\\Scripts\\activate" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Python venv 激活失败或路径不匹配 (python-venv-troubleshoot)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fixing the \"Python venv 激活失败或路径不匹配\" error:\n\n**Step 1: Determine your shell type**\n\nRun the following command to determine your shell type:\n```bash\necho $SHELL\n```\nThis will output `bash` or `zsh`.\n\n**Step 2: Verify the `venv` directory**\n\nRun the following command to verify the `venv` directory:\n```bash\nwhich python\npython -c \"import sys; print(sys.prefix)\"\n```\nIf the output is not `venv`, run `source venv/bin/activate` or `source .venv/bin/activate` to activate the `venv` directory.\n\n**Step 3: Remove the `venv` directory (if it exists)**\n\nIf you created multiple `venv` directories, remove the existing one:\n```bash\nrm -rf venv\n```\n**Step 4: Re-create the `venv` directory**\n\nRe-create the `venv` directory:\n```bash\npython3 -m venv venv\n```\n**Step 5: Activate the `venv` directory**\n\nActivate the `venv` directory:\n```bash\nsource v", "metrics": { "length": 869, "commands": 5, "command_list": [ "echo $SHELL", "which python", "python -c \"import sys; print(sys.prefix)\"", "rm -rf venv", "python3 -m venv venv" ], "has_command_block": true, "actionable": true, "inline_code_count": 22, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Alarm Code Retrieval Needs Mandatory Keyword Recall (rag-alarm-code-mandatory-recall)", "condition": "with_lesson", "status": 200, "content": "To fix the RAG Alarm Code Retrieval Needs Mandatory Keyword Recall error, you'll need to modify the `retrieve()` function in `rag_core.py`. Here's a step-by-step guide:\n\n**Step 1: Identify the problematic code**\n\nOpen the `rag_core.py` file and search for the `retrieve()` function. Look for the lines that handle the alarm code pattern and robot model matching.\n\n**Step 2: Modify the `retrieve()` function**\n\nAdd the following code to the `retrieve()` function to implement keyword mandatory recall:\n```python\ndef retrieve(self, query, context):\n # ... (existing code)\n \n # Alarm code pattern: when /[A-Z]+-\\d+/ matches, forcibly recall documents whose titles/tags contain that code\n alarm_code_pattern = r\"[A-Z]+-\\d+\"\n if re.search(alarm_code_pattern, query):\n # Recall documents whose titles/tags contain the alarm code\n alarm_code = query[query.index(alarm_code_pattern) + len(alarm_code_pattern):]\n self._recall_documents(context, alarm_code, force=True)\n \n # Robot model matching: match model names as strings and merge them into the retrieval results\n robot_model_pattern = r\"M-\\d+|", "metrics": { "length": 1134, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 6, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Alarm Code Retrieval Needs Mandatory Keyword Recall (rag-alarm-code-mandatory-recall)", "condition": "plain", "status": 200, "content": "The error you're encountering is a known issue with the RAG (Risk and Alert Group) system. Here's a step-by-step guide to resolve the issue:\n\n**Prerequisites:**\n\n1. Ensure you have administrative privileges on the system.\n2. Familiarize yourself with the RAG system configuration and settings.\n\n**Fix:**\n\n1. **Check the RAG system configuration:**\n - Log in to the RAG system as an administrator.\n - Navigate to the \"System Settings\" or \"Configuration\" section.\n - Look for the \"Alarm Code Retrieval\" or \"RAG Alarm Code Retrieval\" setting.\n - Verify that the \"Mandatory Keyword Recall\" option is enabled.\n\n2. **Verify the keyword list:**\n - If the \"Mandatory Keyword Recall\" option is enabled, check if the keyword list is complete and up-to-date.\n - Ensure that all required keywords are included in the list.\n\n3. **Update the keyword list:**\n - If the keyword list is incomplete or outdated, update it by adding or removing keywords as necessary.\n - Save the changes to the keyword list.\n\n4. **Disable the \"Mandatory Keyword Recall\" option (if applicable):**\n - If the issue persists,", "metrics": { "length": 1104, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG 知识库品牌污染Detection与治理 (rag-brand-contamination-detection-and-fix)", "condition": "with_lesson", "status": 200, "content": "以下是解决 RAG 知识库品牌污染的具体操作:\n\n**步骤 1: 全量元数据打标**\n\n```bash\n# 确保 ChromaDB 的数据库连接\npython\nimport chromadb\nfrom chromadb import collection\n\n# 连接到 ChromaDB\ndb = chromadb.connect('your_database_name')\n\n# 获取 chunk IDs 和 元数据\nids = db.collection('your_collection_name').chunk_ids()\nmetadatas = db.collection('your_collection_name').chunk_metadata()\n\n# 分批打标\nbatch_size = 100\nfor i in range(0, len(ids), batch_size):\n chunk_ids = ids[i:i+batch_size]\n chunk_metadatas = metadatas[i:i+batch_size]\n \n # 打标\n for doc_id, meta in zip(chunk_ids, chunk_metadatas):\n fn = meta.get(\"filename\", \"\")\n if kuka_pat.search(fn): brand = \"kuka\"\n elif abb_pat.search(fn): brand = \"abb\"\n elif fanuc_pat.search(fn): brand = \"fanuc\"\n else: brand = \"unknown\"\n collection.update(ids=[doc_id], metadatas=[", "metrics": { "length": 855, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG 知识库品牌污染Detection与治理 (rag-brand-contamination-detection-and-fix)", "condition": "plain", "status": 200, "content": "The error message \"RAG 知识库品牌污染Detection与治理\" is not a standard error message and seems to be a Chinese error message. However, I'll assume that it's related to a Rust or Go programming language issue.\n\nSince I don't have more information about the error, I'll provide a general solution for a common error in Rust and Go programming languages.\n\n**Rust Error Fix:**\n\nIf you're experiencing issues with a Rust project, here's a general fix:\n\n1. Update the Rust version:\n ```bash\nrustup update\n```\n2. Clean the project:\n ```bash\ncargo clean\n```\n3. Rebuild the project:\n ```bash\ncargo build\n```\n4. Check for dependencies:\n ```bash\ncargo check\n```\n\n**Go Error Fix:**\n\nIf you're experiencing issues with a Go project, here's a general fix:\n\n1. Update the Go version:\n ```bash\ngo get golang.org/x/tools/cmd/goimports\ngo mod tidy\ngo mod clean\ngo mod vendor\ngo get golang.org/x/tools/cmd/goimports\n```\n Or \n ```bash\ngo mod tidy\ngo mod clean\ngo mod vendor\ngo get golang", "metrics": { "length": 972, "commands": 9, "command_list": [ "rustup update", "cargo clean", "cargo build", "cargo check", "go get golang.org/x/tools/cmd/goimports" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Chinese Encoding with PyMuPDF (rag-chinese-encoding-pymupdf)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to PyMuPDF not supporting the RAG Chinese encoding. Here's a concrete, actionable fix with exact commands:\n\n**Method 1: Install a custom encoding**\n\nYou can install a custom encoding using pip:\n\n```bash\npip install pymupdf[rag-chinese-encoding]\n```\n\n**Method 2: Use a different library**\n\nIf the above method doesn't work, you can try using a different library that supports RAG Chinese encoding. One alternative is `pdfquery`:\n\n```bash\npip install pdfquery\n```\n\nThen, you can use the following code to extract text from a PDF file with RAG Chinese encoding:\n\n```python\nimport pdfquery\n\nwith open('example.pdf', 'rb') as f:\n pdf = pdfquery.PDFQuery(f)\n text = pdf.text()\n print(text)\n```\n\n**Method 3: Convert the PDF to a different encoding**\n\nIf the above methods don't work, you can try converting the PDF to a different encoding. You can use the following code to convert the PDF to UTF-8:\n\n```python\nimport fitz\n\ndoc = fitz.open('example.pdf')\nfor page in doc:\n page.text = page.text.decode('utf-", "metrics": { "length": 1049, "commands": 4, "command_list": [ "pip install pymupdf[rag-chinese-encoding]", "pip install pdfquery", "**Method 3: Convert the PDF to a different encoding**", "If the above methods don't work, you can try converting the PDF to a different encoding. You can use the following code to convert the PDF to UTF-8:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.2 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Chinese Encoding with PyMuPDF (rag-chinese-encoding-pymupdf)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with pymupdf4llm extracting PDFs with Chinese special characters being truncated due to the default encoding, you can explicitly specify the encoding to UTF-8 in the extract() call.\n\nHere's the corrected Python code:\n\n```python\nimport pymupdf4llm\n\n# Load the PDF document\ndoc = pymupdf4llm.load(\"path_to_your_pdf_file.pdf\")\n\n# Extract the text from the PDF document with UTF-8 encoding\ntext = pymupdf4llm.extract(doc, encoding=\"utf-8\")\n\n# Print the extracted text\nprint(text)\n```\n\nReplace `\"path_to_your_pdf_file.pdf\"` with the actual path to the PDF file you want to extract text from.\n\nIf you're using a Python script to automate this process, make sure to add the encoding specification in the extract() call.\n\nExample:\n\n```python\nimport pymupdf4llm\n\n# Load the PDF document\ndoc = pymupdf4llm.load(\"path_to_your_pdf_file.pdf\")\n\n# Extract the text from the PDF document with UTF-8 encoding\ntext = pymupdf4llm.extract(doc, encoding=\"utf-8\")\n\n# Save the extracted text to a file\nwith open(\"", "metrics": { "length": 1007, "commands": 3, "command_list": [ "Replace `\"path_to_your_pdf_file.pdf\"` with the actual path to the PDF file you want to extract text from.", "If you're using a Python script to automate this process, make sure to add the encoding specification in the extract() call.", "Example:" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 0.8 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Chunk Parameters 800 Characters and 100 Overlap (rag-chunk-params-800-100)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to adjust the chunking strategy in your RAG configuration. Here's a step-by-step guide with exact commands:\n\n1. **Update the RAG configuration**:\n\n First, update the RAG configuration to use the new chunking parameters.\n\n ```python\nfrom rag import RAG\nfrom rag.utils import RecursiveCharacterTextSplitter\n\n# Initialize RAG with the updated configuration\nrag = RAG(\n config={\n \"chunking\": {\n \"chunk_size\": 800, # About 800 characters per chunk\n \"chunk_overlap\": 100, # 100-character overlap between chunks\n \"length_function\": len,\n \"separators\": [\"\\n\\n\", \"\\n\", \"。\", \"!\", \"?\", \" \", \"\"]\n },\n # Other configurations...\n }\n)\n```\n\n2. **Verify the configuration**:\n\n To verify that the configuration has been updated correctly, you can check the ingestion log.\n\n ```bash\n# Get the ingestion log\ningestion_log = rag.ingestion_log\n\n# Check if the chunking parameters have been updated\nprint(ingestion_log.get(\"chunking\"))\n```\n\n The output should match the new chunking", "metrics": { "length": 1069, "commands": 2, "command_list": [ "2. **Verify the configuration**:", "To verify that the configuration has been updated correctly, you can check the ingestion log." ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Chunk Parameters 800 Characters and 100 Overlap (rag-chunk-params-800-100)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the size of your RAG (Rapid Autocomplete Grammar) chunk parameters. The error message indicates that the chunk parameters are too large (800 characters) and the overlap is too high (100).\n\nTo fix this issue, you can try the following steps:\n\n**Step 1: Reduce the chunk size**\n\nYou can reduce the chunk size by changing the value in the `rag-chunk-size` configuration option. Here's an example command:\n\n```bash\ndotnet build -c Release --configuration Release --arg \"rag-chunk-size=600\"\n```\n\nIn this command, we're changing the chunk size to 600 characters.\n\n**Step 2: Reduce the overlap**\n\nYou can also reduce the overlap by changing the value in the `rag-chunk-overlap` configuration option. Here's an example command:\n\n```bash\ndotnet build -c Release --configuration Release --arg \"rag-chunk-overlap=50\"\n```\n\nIn this command, we're changing the overlap to 50 characters.\n\n**Step 3: Rebuild the project**\n\nAfter making these changes, you'll need to rebuild your project to apply the new configuration options. You can do this using the following command:\n\n```bash\ndotnet build", "metrics": { "length": 1121, "commands": 2, "command_list": [ "dotnet build -c Release --configuration Release --arg \"rag-chunk-size=600\"", "dotnet build -c Release --configuration Release --arg \"rag-chunk-overlap=50\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cross-encoder reranker kills RAG latency on CPU-only machines (rag-cross-encoder-cpu-bottleneck)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Cross-encoder reranker kills RAG latency on CPU-only machines\" error, you can try the following concrete, actionable steps:\n\n**Step 1: Disable Cross-encoder Reranking**\n\nYou can disable cross-encoder reranking by adding the following configuration to your model configuration file (e.g., `config.json` or `model_config.py`):\n\n```json\n{\n \"model\": {\n \"name\": \"bge-reranker-v2-m3\",\n \"config\": {\n \"disable_cross_encoder_reranking\": true\n }\n }\n}\n```\n\nor\n\n```python\nimport json\n\nmodel_config = {\n \"model\": {\n \"name\": \"bge-reranker-v2-m3\",\n \"config\": {\n \"disable_cross_encoder_reranking\": True\n }\n }\n}\n\nwith open('config.json', 'w') as f:\n json.dump(model_config, f, indent=4)\n```\n\n**Step 2: Update the Model Configuration File**\n\nAfter making the change, update the model configuration file to include the new configuration.\n\n**Step 3: Re-run Your Model**\n\nRe-run your model with the updated configuration to see if it improves performance.\n\nNote:", "metrics": { "length": 1010, "commands": 1, "command_list": [ "or" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cross-encoder reranker kills RAG latency on CPU-only machines (rag-cross-encoder-cpu-bottleneck)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the performance of the Cross-Encoder Reranker model on CPU-only machines. This issue is known as the \"rag-cross-encoder-cpu-bottleneck.\" Here's a concrete, actionable fix with exact commands:\n\n**Fix 1: Increase the number of CPU cores**\n\nThe Cross-Encoder Reranker model relies heavily on the number of CPU cores available. Increasing the number of cores can significantly improve performance. You can do this by:\n\n* Adding more CPU cores to your machine (if possible)\n* Using a cloud service with more CPU cores (e.g., AWS EC2, Google Cloud Compute Engine)\n\nAlternatively, you can use a distributed computing framework like [Dask](https://dask.org/) to utilize multiple CPU cores.\n\n**Fix 2: Use a GPU-accelerated model**\n\nThe Cross-Encoder Reranker model can be accelerated using a GPU. You can do this by:\n\n* Installing a GPU-accelerated deep learning framework like [TensorFlow](https://www.tensorflow.org/), [PyTorch](https://pytorch.org/), or [Hugging Face Transformers](https://huggingface.co/models)\n* Migrating your model to a", "metrics": { "length": 1086, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG 检索六层静默退化:BM25 失败 + 截断 + 分数混合导致有效 chunk 被丢弃 (rag-retrieval-six-layer-silent-degradation)", "condition": "with_lesson", "status": 200, "content": "为了解决 RAG 检索六层静默退化:BM25 失败 + 截断 + 分数混合导致有效 chunk 被丢弃(rag-retrieval-six-layer-silent-degradation)的问题,我们需要进行以下修复:\n\n**步骤 1:验证 BM25 索引完整性**\n\n```bash\npython3 scripts/misakanet_cli.py doctor\n```\n\n**步骤 2:添加 warmup 重试逻辑**\n\n```bash\n# 在 misakanet_cli.py 中添加 warmup 重试逻辑\nif __name__ == \"__main__\":\n # ... existing code ...\n if not query_result:\n # 等待 5s 重试\n time.sleep(5)\n if not query_result:\n # 重试失败后回退到 BM25-only\n query_result = run_bm25_query(query)\n # ... existing code ...\n```\n\n**步骤 3:修复 $contains tokenization**\n\n```bash\n# 在 misakanet_cli.py 中添加统一查询预处理\ndef preprocess_query(query):\n # 分词\n tokens = tokenizer.tokenize(query)\n # 匹配\n matched_tokens = [token", "metrics": { "length": 713, "commands": 6, "command_list": [ "python3 scripts/misakanet_cli.py doctor", "if __name__ == \"__main__\":", "if not query_result:", "time.sleep(5)", "if not query_result:" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG 检索六层静默退化:BM25 失败 + 截断 + 分数混合导致有效 chunk 被丢弃 (rag-retrieval-six-layer-silent-degradation)", "condition": "plain", "status": 200, "content": "The error message you're encountering suggests that the RAG (Ranking Algorithm Group) is experiencing issues with six-layer silent degradation, specifically with BM25 (Berk-Székely-Moody 25), truncation, and score mixing. This can lead to the loss of effective chunks. To fix this issue, you can try the following steps:\n\n**Step 1: Update the RAG model**\n\nRun the following command to update the RAG model to the latest version:\n```bash\npip install --upgrade ragg\n```\n**Step 2: Update the BM25 algorithm**\n\nUpdate the BM25 algorithm to the latest version:\n```bash\npip install --upgrade scibert\n```\n**Step 3: Increase the maximum chunk size**\n\nIncrease the maximum chunk size to prevent the loss of effective chunks. You can do this by setting the `max_chunk_size` parameter in the RAG configuration file:\n```python\n# rag_config.py\n\nRAG_CONFIG = {\n # ...\n 'max_chunk_size': 1024, # Increase the maximum chunk size\n # ...\n}\n```\n**Step 4: Disable score mixing**\n\nDisable score mixing by setting the `score_mixing` parameter to `False` in the R", "metrics": { "length": 1050, "commands": 2, "command_list": [ "pip install --upgrade ragg", "pip install --upgrade scibert" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Three-Channel LLM Disaster Recovery (rag-three-channel-llm-disaster-recovery)", "condition": "with_lesson", "status": 200, "content": "To implement three-channel automatic disaster recovery for the RAG knowledge base, you'll need to modify the Gradio application configuration and add error handling mechanisms. Here's a step-by-step guide to achieve this:\n\n**Step 1: Verify the current configuration**\n\nRun the following commands to inspect the current configuration:\n```bash\ngrep -i 'bm25\\|chunk\\|embed' lessons/contrib/rag-.md 2/dev/null | head -3\necho Search verified\n```\nThis should output the expected verification message.\n\n**Step 2: Update the Gradio application configuration**\n\nModify the `rag_three_channel_llm_disaster_recovery.py` file to include the three-channel configuration:\n```python\nimport gradio as gr\nfrom gradio import Text, Button, Image, Video, Audio\nfrom gradio import Component, ComponentGrid, MultiComponent\nfrom gradio.components import TextInput, Switch\nfrom gradio.components import ImageUpload, VideoUpload\nfrom gradio.components import AudioUpload\nfrom gradio.components import ComponentGrid\nfrom gradio.components import MultiComponent\nimport requests\nimport time\n\n# Define the three-channel configuration\nchannel_config = [\n {\n \"name\": \"Internal Model - Flash\",\n \"url\": \"http://", "metrics": { "length": 1195, "commands": 2, "command_list": [ "grep -i 'bm25\\|chunk\\|embed' lessons/contrib/rag-.md 2/dev/null | head -3", "echo Search verified" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "正则陷阱 — 源码中转义引号导致非贪婪匹配提前终止 (regex-escaped-quotes-source-parsing)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you can use the following command:\n\n```bash\necho \"Verification passed: [^\\\\]|\\.\"\n```\n\nThis command uses a character class to match any character except backslash (`[^\\\\]`) or escape sequence (`\\\\.`).", "metrics": { "length": 217, "commands": 1, "command_list": [ "echo \"Verification passed: [^\\\\]|\\.\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Three-Channel LLM Disaster Recovery (rag-three-channel-llm-disaster-recovery)", "condition": "plain", "status": 200, "content": "I'm happy to help you with the error. However, I don't see any error message in your question. Could you please provide the exact error message you're encountering?\n\nThat being said, if you're experiencing issues with a Hugging Face model, such as the \"RAG Three-Channel LLM Disaster Recovery\" model, here are some general troubleshooting steps you can try:\n\n1. Check the model's documentation: Make sure you're using the model correctly and that you've checked the documentation for any specific requirements or usage guidelines.\n2. Verify your Python environment: Ensure that your Python environment is up-to-date and that you have the required libraries installed. You can try updating your environment by running `pip install --upgrade transformers`.\n3. Try a different version of the model: If you're using a specific version of the model, try updating to the latest version by running `pip install transformers --upgrade`.\n\nIf you're still experiencing issues, please provide the exact error message you're encountering, and I'll do my best to provide a concrete, actionable fix.\n\nHere is an example of how you might use the RAG model:\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\n# Load the model and tokenizer\nmodel_name = \"", "metrics": { "length": 1259, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "rdt-cli — Reddit in Your Terminal (Reverse-Engineered API) (rdt-cli-reddit-terminal)", "condition": "plain", "status": 200, "content": "It looks like the rdt-cli is not compatible with the latest versions of Python. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Update pip**\n\nOpen your terminal and update pip to the latest version:\n\n```bash\npython -m pip install --upgrade pip\n```\n\n**Step 2: Install rdt-cli**\n\nNow, install rdt-cli using pip:\n\n```bash\npython -m pip install rdt-cli\n```\n\n**Step 3: Install required packages**\n\nrdt-cli requires some additional packages to be installed. You can install them using the following command:\n\n```bash\npython -m pip install -r rdt-cli/requirements.txt\n```\n\n**Step 4: Verify installation**\n\nAfter installing the packages, verify that rdt-cli is working correctly by running:\n\n```bash\nrdt-cli\n```\n\nIf you still encounter issues, make sure that you have the latest version of Python installed.\n\nNote: If you're using a virtual environment, ensure that you activate it before running the above commands.", "metrics": { "length": 917, "commands": 4, "command_list": [ "python -m pip install --upgrade pip", "python -m pip install rdt-cli", "python -m pip install -r rdt-cli/requirements.txt", "rdt-cli" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "rdt-cli — Reddit in Your Terminal (Reverse-Engineered API) (rdt-cli-reddit-terminal)", "condition": "with_lesson", "status": 200, "content": "To fix the error and verify that `rdt-cli` is installed correctly, follow these steps:\n\n1. **Install `rdt-cli` using pipx**: Run the following command in your terminal:\n ```bash\npipx install rdt-cli\n```\n\n2. **Verify the installation**: Run the following command to verify that `rdt-cli` is installed correctly:\n ```bash\nrdt --version\n```\n\n This should display the version number of `rdt-cli`, which is `v0.4.1` in your case.\n\n3. **Login to `rdt-cli`**: Run the following command to login to `rdt-cli`:\n ```bash\nrdt login\n```\n\n This will extract your browser cookies and authenticate you with the Reddit reverse-engineered API.\n\n4. **Verify successful login**: Run the following command to verify that you are logged in successfully:\n ```bash\nrdt status --json\n```\n\n This should display a JSON response indicating that you are authenticated and have a valid cookie count.\n\n5. **Verify with a verification command**: Run the following command to verify that `rdt-cli` is working correctly:\n ```bash\npipx install rdt-cli\necho \"", "metrics": { "length": 1040, "commands": 4, "command_list": [ "pipx install rdt-cli", "rdt --version", "rdt login", "rdt status --json" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "正则陷阱 — 源码中转义引号导致非贪婪匹配提前终止 (regex-escaped-quotes-source-parsing)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the fact that the regular expression engine is treating the double quotes in your regex pattern as literal characters instead of escaped quotes. This is because the regex engine is interpreting the double quotes as the start of a quoted string, rather than as an escaped character.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Using Python**\n\nYou can use raw strings in Python to avoid this issue. Raw strings are strings that start with `r` and do not interpret backslashes (`\\`) as escape characters.\n\n```python\nimport re\n\n# Define your regex pattern\npattern = r\"(\\w+) \\\"(.*?)\\\"\"\n\n# Use the raw string to define your regex pattern\nregex_pattern = r\"(\\w+) \\\"(.*?)\\\"\"\n\n# Compile the regex pattern\nregex = re.compile(regex_pattern)\n\n# Test the regex pattern\nmatch = regex.match(\"John \\\"Doe\\\"\")\nif match:\n print(\"Match found:\", match.groups())\nelse:\n print(\"No match found\")\n```\n\n**Using Bash**\n\nIn Bash, you can use single quotes (`'`) to define a raw string.\n\n```bash\n# Define your regex pattern\npattern='(\\w+) „(.*?)“'\n\n# Use the regex pattern to search", "metrics": { "length": 1114, "commands": 2, "command_list": [ "**Using Bash**", "In Bash, you can use single quotes (`'`) to define a raw string." ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "正则表达式 debugging — 贪婪匹配造成的意外结果 (regex-greedy-matching)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to modify the regular expression to make it non-greedy. You can do this by appending a question mark (`?`) after the `.*` or `.+` part of the pattern.\n\nHere's the corrected code:\n\n```python\nimport re\n\ntext = \"
内容1
内容2
\"\n\n# Non-greedy pattern: matches the closest
\nprint(re.findall(r\"\", text))\n# Output: ['内容1', '内容2']\n```\n\nIn this corrected pattern, `.*?` is used instead of `.*` to make the match non-greedy. This will cause the pattern to match the closest `
` instead of the farthest one.\n\nAlternatively, you can use the `re.DOTALL` flag to make the `.` match any character, including a newline, and then use a non-greedy pattern:\n\n```python\nimport re\n\ntext = \"
内容1
内容2
\"\n\n# Non-greedy pattern: matches the closest \nprint(re.findall(r\"
(.*?)
\", text, re.DOTALL))\n# Output: ['内容", "metrics": { "length": 886, "commands": 2, "command_list": [ "In this corrected pattern, `.*?` is used instead of `.*` to make the match non-greedy. This will cause the pattern to match the closest `` instead of the farthest one.", "Alternatively, you can use the `re.DOTALL` flag to make the `.` match any character, including a newline, and then use a non-greedy pattern:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "正则表达式 debugging — 贪婪匹配造成的意外结果 (regex-greedy-matching)", "condition": "plain", "status": 200, "content": "The \"贪婪匹配造成的意外结果\" error, also known as \"regex-greedy-matching\" error, occurs when a regular expression engine is unable to determine the correct match due to greedy matching.\n\nHere's a concrete, actionable fix with exact commands:\n\n**For Python**\n\n1. Open your Python script or file in a text editor.\n2. Look for the line of code where the error is occurring.\n3. Check if there's a `+` symbol (`+`) after the `*` symbol (`*`) in the regular expression.\n4. If there is, replace the `+` symbol with a `?` symbol (`?`) to make the match non-greedy.\n\nExample:\n\n```python\nimport re\n\n# Before\ntext = \"Hello world123\"\nmatch = re.search(r\"world\\d+\", text)\n\n# After\nmatch = re.search(r\"world\\d?\", text)\n```\n\n**For Java**\n\n1. Open your Java file in an IDE like Eclipse or IntelliJ IDEA.\n2. Look for the line of code where the error is occurring.\n3. Check if there's a `+` symbol (`+`) after the `*` symbol (`*`) in", "metrics": { "length": 911, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 12, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Remote search rate limiting: 5 free/day, then registration (remote-search-rate-limiting)", "condition": "with_lesson", "status": 200, "content": "To fix the rate limiting issue, you'll need to modify your Cloudflare Worker to implement the rate limiting rules. Here's a step-by-step guide:\n\n**1. Create a new Cloudflare Worker**\n\nIn the Cloudflare dashboard, go to Workers > Create worker. Choose \"Cloudflare KV\" as the storage engine and give your worker a name (e.g., \"rate-limited-search\").\n\n**2. Add the rate limiting logic**\n\nIn your Cloudflare Worker code, add the following logic to implement the rate limiting rules:\n```javascript\nconst key = `rate:${ip}:${date}`;\nconst count = await env.MISAKANET_KV.get(key, \"number\") || 0;\n\nif (count >= 5) {\n return {\n error: \"Rate limit exceeded. Register for unlimited.\",\n hint: \"Register to get unlimited access: misakanet_register\",\n };\n}\n\nawait env.MISAKANET_KV.put(key, count + 1, { expirationTtl: 86400 });\n```\nThis code checks if the rate limit has been exceeded (i.e., if the count is 5 or more). If it has, it returns an error response with a hint to register for unlimited access. If not, it", "metrics": { "length": 1010, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Remote search rate limiting: 5 free/day, then registration (remote-search-rate-limiting)", "condition": "plain", "status": 200, "content": "The error message you're seeing is related to a rate limiting issue with your Elasticsearch cluster. To fix this, you'll need to increase the `remote_search_rate_limit` parameter in your Elasticsearch configuration.\n\nHere are the steps to increase the `remote_search_rate_limit` parameter:\n\n**Method 1: Update the Elasticsearch configuration file**\n\nIf you're using Elasticsearch 7.x, you can update the `remote_search_rate_limit` parameter in the `elasticsearch.yml` file.\n\n1. Open the `elasticsearch.yml` file in a text editor.\n2. Locate the `remote_search_rate_limit` parameter and update its value to a higher number, e.g., `10000`.\n3. Save the changes to the file.\n\nExample:\n```yaml\nremote_search_rate_limit: 10000\n```\n**Method 2: Update the Elasticsearch configuration using the `xpack` API**\n\nIf you're using Elasticsearch 7.x, you can also update the `remote_search_rate_limit` parameter using the `xpack` API.\n\n1. Open a terminal or command prompt.\n2. Use the following command to update the `remote_search_rate_limit` parameter:\n```bash\ncurl -X PUT 'http://localhost:9200/_xpack/security/_settings?pretty", "metrics": { "length": 1114, "commands": 4, "command_list": [ "**Method 2: Update the Elasticsearch configuration using the `xpack` API**", "If you're using Elasticsearch 7.x, you can also update the `remote_search_rate_limit` parameter using the `xpack` API.", "1. Open a terminal or command prompt.", "2. Use the following command to update the `remote_search_rate_limit` parameter:" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Repository Traffic Is Not Lesson Use (repository-traffic-is-not-lesson-use)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Repository Traffic Is Not Lesson Use\" error, follow these steps:\n\n**Step 1: Instrument the lesson-consumption path**\n\nAdd a new event to your GitHub repository's `events` file in the `.github/events` directory:\n```yml\n# .github/events\n{\n \"lesson-consumption\": {\n \"type\": \"lesson_consumed\",\n \"properties\": {\n \"lesson_id\": {\n \"type\": \"string\"\n },\n \"user_id\": {\n \"type\": \"string\"\n }\n }\n }\n}\n```\nThis will track when a user consumes a lesson.\n\n**Step 2: Route high-traffic pages into lessons**\n\nAdd direct links to related lessons from the following pages:\n\n* README first screen: `https://example.com/lesson/lesson-name`\n* Issue templates: `https://example.com/lesson/lesson-name`\n* PR templates: `https://example.com/lesson/lesson-name`\n* Welcome comments: `https://example.com/lesson/lesson-name`\n* Thank-you comments: `https://example.com/lesson/lesson-name`\n\nExample:\n```markdown\n# README\nBefore retrying a failing DCO, pip, token, or CI issue, search", "metrics": { "length": 1009, "commands": 9, "command_list": [ "This will track when a user consumes a lesson.", "**Step 2: Route high-traffic pages into lessons**", "Add direct links to related lessons from the following pages:", "* README first screen: `https://example.com/lesson/lesson-name`", "* Issue templates: `https://example.com/lesson/lesson-name`" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Repository Traffic Is Not Lesson Use (repository-traffic-is-not-lesson-use)", "condition": "plain", "status": 200, "content": "To fix the \"Repository Traffic Is Not Lesson Use\" error, you'll need to update your repository's settings to use the correct configuration. Here's a step-by-step guide:\n\n**Prerequisites:**\n\n* You have a GitHub repository set up.\n* You have the necessary permissions to edit repository settings.\n\n**Fix:**\n\n1. Log in to your GitHub account and navigate to your repository.\n2. Click on the \"Settings\" icon (looks like a gear) in the top-right corner of the page.\n3. In the left sidebar, click on \"Repository settings\".\n4. Scroll down to the \"Traffic\" section.\n5. Click on \"Traffic is not a lesson use\" and then select \"Use this repository as a lesson use\".\n6. Click on \"Update\" to save your changes.\n\nAlternatively, you can also use the GitHub web interface to update your repository settings:\n\n1. Log in to your GitHub account and navigate to your repository.\n2. Click on the \"Settings\" icon (looks like a gear) in the top-right corner of the page.\n3. In the left sidebar, click on \"Repository settings\".\n4. Scroll down to the \"Traffic\" section.\n5. Click on the \"Traffic is not a lesson use\" link.\n", "metrics": { "length": 1097, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "When Lessons Are Too Heavy, Use Rescue Cards (rescue-cards-for-non-github-users)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to introduce rescue cards for non-GitHub users. Here's a step-by-step guide to implement rescue cards:\n\n**Step 1: Create Rescue Card Template**\n\nCreate a new Markdown file (e.g., `rescue-cards.md`) with the following content:\n\n```markdown\n# Rescue Card Template\n\n## Problem Title\n\nTry these 3 steps first\n\n1. [Insert step 1 command]\n2. [Insert step 2 command]\n3. [Insert step 3 command]\n\nStill broken? Send these:\n\n* Screenshot\n* File type/link/error text\n* Operating system/app version\n\n## Maintainer Notes\n\n* Likely root cause:\n* Reusable fix:\n* Should become lesson? Yes/No\n```\n\n**Step 2: Add Rescue Cards**\n\nCreate individual rescue card files (e.g., `archive-open-failure.md`, `pdf-read-failure.md`, etc.) with the following content:\n\n```markdown\n# Archive Open Failure\n\n## Problem Title\n\nTry these 3 steps first\n\n1. Try opening the archive file again.\n2. Check if the archive file is corrupted.\n3. Try opening the file with a different viewer.\n\nStill broken? Send these:\n\n* Screenshot\n* File", "metrics": { "length": 1024, "commands": 2, "command_list": [ "**Step 2: Add Rescue Cards**", "Create individual rescue card files (e.g., `archive-open-failure.md`, `pdf-read-failure.md`, etc.) with the following content:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "When Lessons Are Too Heavy, Use Rescue Cards (rescue-cards-for-non-github-users)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to the `rescue-cards` package not being able to find a GitHub token to authenticate its API requests. To fix this, you'll need to create a GitHub personal access token and install the `rescue-cards` package with the token.\n\nHere are the steps to follow:\n\n**Step 1: Create a GitHub personal access token**\n\n1. Log in to your GitHub account.\n2. Click on your profile picture in the top right corner, then click on \"Settings\".\n3. Scroll down to the \"Developer settings\" section and click on \"Personal access tokens\".\n4. Click on \"Generate new token\".\n5. Choose the scope that suits your needs (e.g., \"repo\", \"read:org\", etc.).\n6. Give the token a name and description, then click on \"Generate token\".\n7. Copy the token.\n\n**Step 2: Install the `rescue-cards` package with the token**\n\nIf you're using npm or yarn:\n\n```bash\nnpm config set github-token \n```\n\nor\n\n```bash\nyarn config set github-token \n```\n\nThen, install the `rescue-cards` package:\n\n```bash\nnpm", "metrics": { "length": 1032, "commands": 2, "command_list": [ "npm config set github-token ", "yarn config set github-token " ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "SAG-Lite Data Quality: Clean Search Results (sag-lite-data-quality-cleaning)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the `extract_description` function:\n\n```python\nimport re\n\ndef extract_description(text: str, max_len: int = 200) -> str:\n \"\"\"Extract a short description from the lesson body.\"\"\"\n # Remove frontmatter (both ---{json}--- and ---\\nyaml\\n--- formats)\n m = re.match(r\"^---\\s*(?:\\{.*?\\})?\\s*---\", text, re.DOTALL)\n if m:\n text = text[m.end():]\n\n # Also remove any remaining frontmatter-like patterns\n text = re.sub(r'^\\s*\\{.*?\\}\\s*$', '', text, flags=re.MULTILINE)\n\n # Find first non-heading, non-empty, non-metadata line\n for line in text.split(\"\\n\"):\n line = line.strip()\n if not line:\n continue\n if line.startswith(\"#\") or line.startswith(\"##\") or line.startswith(\"###\"):\n continue\n if line.startswith(\"{\") and line.endswith(\"}\"):\n continue\n if line.startswith(\"---\"):\n continue\n description = line\n break\n else:\n # If no non-empty, non-metadata line is found, return the", "metrics": { "length": 1040, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Scrapling — Web Scraping Library with Anti-Detection (scrapling-installation-and-usage)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fix the Scraping error:\n\n**Step 1: Install Scraping**\n\n1. Create a new virtual environment using `python3 -m venv scrapling-env`\n2. Activate the virtual environment using `source scrapling-env/bin/activate` (on Linux/Mac) or `scrapling-env\\Scripts\\activate` (on Windows)\n3. Install Scraping with all dependencies using `pip install \"scrapling[all]\"`\n\n**Step 2: Verify Installation**\n\n1. Run `python` to open the Python interpreter\n2. Import Scraping and create a Fetcher instance: `from scrapling import Fetcher; fetcher = Fetcher()`\n3. Test the installation by running a simple GET request: `page = fetcher.get(\"https://example.com\", timeout=15); print(page.status); print(page.css(\"title::text\").get())`\n\n**Troubleshooting**\n\nIf you encounter issues, try the following:\n\n1. Check your `User-Agent` header by running `fetcher.get(\"https://example.com\", headless=True, user_agent=\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (", "metrics": { "length": 974, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 8, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Scrapling — Web Scraping Library with Anti-Detection (scrapling-installation-and-usage)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to Scraping being a prohibited library in your environment. Here's a step-by-step guide to install and use Scraping safely:\n\n**Prerequisites:**\n\n1. Install Python 3.8 or higher.\n2. Install a virtual environment (e.g., `venv` or `conda`) to isolate your project dependencies.\n\n**Step 1: Install Scraping**\n\nSince Scraping is not available on PyPI, we'll use the `scrapy` library as a replacement. You can install it using pip:\n\n```bash\npip install scrapy\n```\n\n**Step 2: Install Anti-Detection Tools**\n\nTo avoid detection, you can use tools like `scrapy-splash` or `scrapy-requests-headers`. Here, we'll use `scrapy-splash`:\n\n```bash\npip install scrapy-splash\n```\n\n**Step 3: Configure Scraping**\n\nCreate a new file named `settings.py` in your project directory:\n\n```python\n# settings.py\n\nimport scrapy\n\n# Scrapy settings for your project\nBOT_NAME = 'your_project_name'\n\nSPIDER_MODULES = ['your_project_name.spiders']\nNEWSPIDER_MODULE = 'your_project_name.spiders'\n\n# Splash settings\n", "metrics": { "length": 1025, "commands": 2, "command_list": [ "pip install scrapy", "pip install scrapy-splash" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "SAG-Lite Data Quality: Clean Search Results (sag-lite-data-quality-cleaning)", "condition": "plain", "status": 200, "content": "The SAG-Lite Data Quality: Clean Search Results error typically occurs when there are duplicate or irrelevant results in your search. Here's a step-by-step fix using Elasticsearch and Kibana:\n\n**Prerequisites:**\n\n1. Make sure you have Elasticsearch and Kibana installed.\n2. You have the necessary permissions to access and modify your Elasticsearch indices.\n\n**Fix:**\n\n**Step 1: Identify the affected index**\n\nRun the following command to find the index that's causing the error:\n```bash\ncurl -XGET 'http://localhost:9200/_search?search_type=query_then_fetch&size=0' | jq '.aggs.search_type'\n```\nThis will show you the search type used in your search query. If it's set to `query_then_fetch`, you'll need to clean up the results.\n\n**Step 2: Clean up the index**\n\nRun the following command to clean up the index:\n```bash\ncurl -XPOST 'http://localhost:9200/_msearch' -H 'Content-Type: application/json' -d '\n{\n \"index\": {\n \"index\": \"your_index_name\"\n },\n \"query\": {\n \"match_all\": {}\n },\n \"size\": 0", "metrics": { "length": 1006, "commands": 1, "command_list": [ "curl -XGET 'http://localhost:9200/_search?search_type=query_then_fetch&size=0' | jq '.aggs.search_type'" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "搜索评估陷阱:评估函数先检查标题再检查内容导致 rank 偏差 (search-evaluation-rank-tracking-bias)", "condition": "with_lesson", "status": 200, "content": "To fix the `search-evaluation-rank-tracking-bias` issue, you can modify the evaluation function to track both title and content matches simultaneously. Here's an example of how you can do this using Python:\n\n```python\ndef evaluate_rank(results, expected_title, expected_content):\n best_rank = float('inf')\n title_match = False\n content_match = False\n \n for i, result in enumerate(results):\n if 'title' in result and expected_title in result['title']:\n title_match = True\n if 'content' in result and expected_content in result['content']:\n content_match = True\n \n # Simultaneously track, take the best match\n if title_match or content_match:\n best_rank = min(best_rank, i + 1)\n \n return best_rank if best_rank != float('inf') else None\n```\n\nHowever, this approach is not very efficient because it checks every result for both title and content matches. A more efficient approach is to use a single loop that checks for both title and content matches simultaneously:\n\n```python\ndef evaluate_rank(results, expected_title, expected_content):\n best_rank = float('inf')\n for i, result in enumerate(results):\n title_match = expected_title", "metrics": { "length": 1233, "commands": 1, "command_list": [ "However, this approach is not very efficient because it checks every result for both title and content matches. A more efficient approach is to use a single loop that checks for both title and content matches simultaneously:" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "搜索评估陷阱:评估函数先检查标题再检查内容导致 rank 偏差 (search-evaluation-rank-tracking-bias)", "condition": "plain", "status": 200, "content": "The \"search-evaluation-rank-tracking-bias\" error occurs when the evaluation function is checking the title before the content, which can lead to biased rankings. Here's a concrete and actionable fix:\n\n**Solution:**\n\n1. **Update your evaluation function**: Modify your evaluation function to prioritize the content over the title. You can do this by changing the order of the checks or by adding a weight to the content score.\n\n ```python\ndef evaluate_document(title, content, ranking):\n # Prioritize content over title\n content_score = calculate_content_score(content)\n title_score = calculate_title_score(title)\n \n # Calculate overall score\n overall_score = content_score * 0.7 + title_score * 0.3\n \n # Update ranking\n ranking.update({title: overall_score})\n```\n\n2. **Use a more robust evaluation metric**: Instead of using a simple score, consider using a more robust evaluation metric that takes into account both the title and content. For example, you can use the cosine similarity between the title and content.\n\n ```python\nimport numpy as np\n\ndef evaluate_document(title, content, ranking):\n # Calculate cosine similarity between title and content\n title_vector = np.array(title.split())\n ", "metrics": { "length": 1239, "commands": 1, "command_list": [ "2. **Use a more robust evaluation metric**: Instead of using a simple score, consider using a more robust evaluation metric that takes into account both the title and content. For example, you can use the cosine similarity between the title and content." ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search Quota Exhaustion Causes False Zero Results (search-quota-exhaustion-false-zero)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Search Quota Exhaustion Causes False Zero Results\" error, you can follow these steps:\n\n**Immediate Fix**\n\n1. Reset the quota by deleting the existing file:\n```bash\nrm misakanet/.quota.json\n```\nThis will immediately reset the search quota to its default value, allowing you to run multiple searches without any issues.\n\n**Contributing a Lesson to Restore Quota**\n\nIf you want to contribute a lesson to restore the quota, you can use the following command:\n```bash\npython3 scripts/queue_lesson.py -t \"title\" -d domain \"content\"\n```\nReplace `\"title\"`, `\"domain\"`, and `\"content\"` with the actual values for your lesson.\n\n**Prevention**\n\nTo prevent the issue in the future, you can follow these best practices:\n\n1. **Check quota before running multiple queries**:\n```bash\ncat misakanet/.quota.json\n```\nThis will show you the current quota value. If it's low, you can reset the quota or wait until it's replenished.\n\n2. **Run searches with sufficient gaps between them**:\nTry to space out your searches by at least 5 minutes to allow the quota to replenish.\n\n3. **Reset quota between test batches", "metrics": { "length": 1103, "commands": 3, "command_list": [ "rm misakanet/.quota.json", "python3 scripts/queue_lesson.py -t \"title\" -d domain \"content\"", "cat misakanet/.quota.json" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search Quota Exhaustion Causes False Zero Results (search-quota-exhaustion-false-zero)", "condition": "plain", "status": 200, "content": "The \"Search Quota Exhaustion Causes False Zero Results\" error typically occurs when you're using the Elasticsearch query DSL and your search query is causing the index to be exhausted, resulting in zero results being returned. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Check the Index Size and Data Volume**\n\nBefore attempting to fix the issue, it's essential to understand the size of your index and the volume of data it contains. You can use the following commands to get an estimate of the index size and data volume:\n\n```bash\n# Get the index size in bytes\ncurl -XGET 'http://localhost:9200/_cat/indices/_all?pretty&size=1' | grep 'size_in_bytes' | awk '{print $2}'\n\n# Get the number of documents in the index\ncurl -XGET 'http://localhost:9200/_cat/indices/_all?pretty&size=1' | grep 'doc_count' | awk '{print $2}'\n```\n\n**Step 2: Check for Query Exhaustion**\n\nTo check if query exhaustion is the cause of the issue, you can use the `_explain` parameter in Elasticsearch. This parameter provides detailed information about the query execution plan, including the number", "metrics": { "length": 1096, "commands": 2, "command_list": [ "curl -XGET 'http://localhost:9200/_cat/indices/_all?pretty&size=1' | grep 'size_in_bytes' | awk '{print $2}'", "curl -XGET 'http://localhost:9200/_cat/indices/_all?pretty&size=1' | grep 'doc_count' | awk '{print $2}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search SSOT: Fixing Data Source Pollution in Static-Deployed Sites (search-ssot-data-source-pollution-fix)", "condition": "with_lesson", "status": 200, "content": "Here is a concrete, actionable fix with exact commands to resolve the issue:\n\n**Step 1: Create a new branch and update the data source**\n\nCreate a new branch to work on the changes:\n```bash\ngit checkout -b fix-data-source-pollution\n```\nUpdate the data source by copying `data/lessons.json` to `docs/data/lessons.json`:\n```bash\ncp data/lessons.json docs/data/\n```\n**Step 2: Update the `getLessonsUrl` function**\n\nUpdate the `getLessonsUrl` function to return the new data source URL:\n```javascript\n// Before (polluted)\nfunction getLessonsUrl() {\n return \"/api/lessons\"; // Worker fetches from stale branch\n}\n\n// After (clean)\nfunction getLessonsUrl() {\n return \"/data/lessons.json\"; // Static, same as main branch\n}\n```\n**Step 3: Update the CI workflow**\n\nUpdate the CI workflow to copy `data/lessons.json` to `docs/data/` on each run:\n```yml\n# .github/workflows/ci.yml\n\nname: CI\n\non:\n push:\n branches:\n - main\n\njobs:\n build:\n runs-on", "metrics": { "length": 950, "commands": 4, "command_list": [ "git checkout -b fix-data-source-pollution", "cp data/lessons.json docs/data/", "**Step 3: Update the CI workflow**", "Update the CI workflow to copy `data/lessons.json` to `docs/data/` on each run:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search Smart Fallback — Turning Zero Results into Discovery (search-smart-fallback-implementation)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the Search Smart Fallback issue:\n\n**Step 1: Install required packages**\n\n```bash\npip install nltk\npip install spacy\npython -m spacy download en_core_web_sm\n```\n\n**Step 2: Create a new file for smart fallback implementation**\n\nCreate a new file named `smart_fallback.py` in the same directory as your original search implementation.\n\n**Step 3: Implement closest matches by keyword overlap**\n\nIn `smart_fallback.py`, add the following code:\n\n```python\nimport re\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nfrom collections import Counter\nimport spacy\n\nnlp = spacy.load(\"en_core_web_sm\")\n\ndef _find_closest_matches(query, docs, top_n=3):\n query_words = set(re.findall(r'\\w+', query.lower()))\n scored = []\n for doc in docs:\n doc_words = set(re.findall(r'\\w+', (doc.title + \" \" + doc.content[:500]).lower()))\n overlap = len(query_words & doc_words)\n if overlap > 0:\n scored.append((overlap / len(query_words), doc))\n return sorted(scored, key=lambda x: -x[0", "metrics": { "length": 1064, "commands": 3, "command_list": [ "pip install nltk", "pip install spacy", "python -m spacy download en_core_web_sm" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search Smart Fallback — Turning Zero Results into Discovery (search-smart-fallback-implementation)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely related to the Elasticsearch query DSL (Domain Specific Language) implementation for the \"search-smart-fallback\" feature. The \"search-smart-fallback\" feature is used to turn zero results into discovery results.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the Elasticsearch query DSL**\n\nYou'll need to update the query DSL to include the `smart_fallback` parameter. Here's an example of how to do this:\n\n```json\n{\n \"query\": {\n \"match_all\": {\n \"smart_fallback\": true\n }\n }\n}\n```\n\n**Step 2: Update the Elasticsearch index mapping**\n\nYou'll also need to update the index mapping to include the `smart_fallback` parameter. Here's an example of how to do this:\n\n```json\n{\n \"properties\": {\n \"smart_fallback\": {\n \"type\": \"boolean\",\n \"default\": true\n }\n }\n}\n```\n\n**Step 3: Re-index your data**\n\nOnce you've updated your index mapping, you'll need to re-index your data to include the `smart_fallback` parameter. Here's an example of how to do this using the Elasticsearch REST API:\n\n", "metrics": { "length": 1075, "commands": 2, "command_list": [ "**Step 2: Update the Elasticsearch index mapping**", "You'll also need to update the index mapping to include the `smart_fallback` parameter. Here's an example of how to do this:" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Search SSOT: Fixing Data Source Pollution in Static-Deployed Sites (search-ssot-data-source-pollution-fix)", "condition": "plain", "status": 200, "content": "The error \"Search SSOT: Fixing Data Source Pollution in Static-Deployed Sites\" is typically related to a security vulnerability in SharePoint. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update SharePoint**\n\nUpdate SharePoint to the latest version.\n\nOpen a PowerShell console as an administrator and run the following command:\n```\nInstall-Package Microsoft.SharePoint.PowerShell -Version 16.0.0.8023\n```\n**Step 2: Update SharePoint Configuration**\n\nUpdate the SharePoint configuration to prevent data source pollution.\n\nOpen a PowerShell console as an administrator and run the following command:\n```\nSet-SPSite -Identity https://your-sharepoint-site.com -WebApplication \"SharePoint Web Application\"\n```\nReplace \"https://your-sharepoint-site.com\" with the URL of your SharePoint site.\n\nThen, run the following command:\n```\nSet-SPWebConfig -Identity \"SharePoint Web Application\" -Bitfield 0x80000000\n```\n**Step 3: Update SharePoint Web Configuration**\n\nUpdate the SharePoint web configuration to prevent data source pollution.\n\nOpen a PowerShell console as an administrator and run the following command:\n```\nSet-SPWebConfig -Identity \"SharePoint Web Application\" -Bitfield ", "metrics": { "length": 1195, "commands": 3, "command_list": [ "Install-Package Microsoft.SharePoint.PowerShell -Version 16.0.0.8023", "Set-SPSite -Identity https://your-sharepoint-site.com -WebApplication \"SharePoint Web Application\"", "Set-SPWebConfig -Identity \"SharePoint Web Application\" -Bitfield 0x80000000" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Forum Accessibility Testing — Systematic Reachability Check (session-lesson-2-forum-accessibility-testing)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, we need to modify the script to handle different types of inaccessible forums. Here's an updated version of the script:\n\n```bash\n#!/bin/bash\n\n# Define the list of forums to test\nforums=(\"news.ycombinator.com\" \"dev.to\" \"lobste.rs\" \"juejin.cn\" \"reddit.com\")\n\n# Level 1: HTTP 状态码\nfor site in \"${forums[@]}\"; do\n code=$(curl -sL --max-time 5 -o /dev/null -w \"%{http_code}\" \"https://$site/\" -H \"User-Agent: Mozilla/5.0\")\n echo \"$site: $code\"\ndone\n\n# Level 2: API 可用性\nfor site in \"${forums[@]}\"; do\n if curl -sL --max-time 8 \"https://hn.algolia.com/api/v1/search?query=test&hitsPerPage=1\" | head -100; then\n echo \"$site: API 可达\"\n else\n echo \"$site: API 可达\"\n fi\ndone\n\n# Level 3: Playwright 渲染\nfor site in \"${forums[@]}\"; do\n if curl -s", "metrics": { "length": 758, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Forum Accessibility Testing — Systematic Reachability Check (session-lesson-2-forum-accessibility-testing)", "condition": "plain", "status": 200, "content": "I don't see any code provided in your question. However, I'll provide a general solution for the error you're likely experiencing.\n\nThe error you're referring to is likely related to the WAVE Web Accessibility Evaluation Tool, which is a browser extension used for web accessibility testing. Here's a step-by-step guide to fix the error:\n\n**Error:** \"The WAVE Web Accessibility Evaluation Tool has encountered an error.\"\n\n**Fix:**\n\n1. **Check the WAVE Web Accessibility Evaluation Tool's settings:**\n Open the WAVE Web Accessibility Evaluation Tool in your browser. Go to the settings by clicking on the gear icon or the three dots (⋮) next to the \"Start Evaluation\" button.\n\n2. **Clear the cache and cookies:**\n In the settings, click on the \"Clear Cache and Cookies\" option.\n\n3. **Disable any extensions that might be causing the issue:**\n If you have any browser extensions installed, try disabling them one by one to see if the error persists.\n\n4. **Check for any conflicts with other browser extensions:**\n If you have multiple browser extensions installed, try disabling all of them except for the WAVE Web Accessibility Evaluation Tool.\n\n5. **Update the WAVE Web Accessibility Evaluation Tool:**\n", "metrics": { "length": 1211, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lobsters JSON API — Structured Tech Forum Scraping (session-lesson-3-lobsters-json-api)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to add a search endpoint to the Lobsters API. Unfortunately, the Lobsters API does not provide a built-in search endpoint. However, you can use a workaround by making a GET request to the `/search.json` endpoint with the `q` parameter set to your desired search query.\n\nHere's an example of how you can modify your Python code to add a search endpoint:\n\n```bash\n# Install the required libraries\npip install requests\n\n# Define the search endpoint URL\nsearch_url = \"https://lobste.rs/search.json\"\n\n# Define the search query\nsearch_query = \"agent\"\n\n# Define the keywords\nkeywords = [\"agent\", \"mcp\", \"claude\", \"memory\", \"devops\", \"automation\", \n \"docker\", \"kubernetes\", \"ci\", \"security\", \"rust\", \"python\"]\n\n# Make a GET request to the search endpoint\nreq = requests.get(search_url, params={\"q\": search_query, \"sort\": \"score\", \"page\": 1})\n\n# Check if the request was successful\nif req.status_code == 200:\n # Parse the JSON response\n data = req.json()\n\n # Extract the relevant posts\n relevant = []\n for post in", "metrics": { "length": 1057, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Lobsters JSON API — Structured Tech Forum Scraping (session-lesson-3-lobsters-json-api)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the fact that the Lobsters JSON API is not designed to handle the requests you're sending. The API has specific endpoint URLs and parameters that must be followed exactly.\n\nTo scrape the Lobsters JSON API, you can use the `requests` library in Python to send a GET request to the API endpoint. However, you need to make sure you're sending the correct parameters.\n\nHere's an example of how you can fix the error:\n\n```bash\n# Install the required libraries\npip install requests\n\n# Use the following Python code to scrape the Lobsters JSON API\nimport requests\nimport json\n\n# Set the API endpoint URL\nurl = \"https://www.lobsters.com/api/v1/posts.json\"\n\n# Set the parameters\nparams = {\n \"limit\": 10, # Limit the number of posts returned\n \"sort\": \"desc\", # Sort the posts in descending order\n \"offset\": 0 # Offset the posts to start from the beginning\n}\n\n# Send a GET request to the API endpoint\nresponse = requests.get(url, params=params)\n\n# Check if the request was successful\nif response.status_code == 200:\n # Parse the JSON response\n data = response", "metrics": { "length": 1113, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright Forum Selectors — WoltLab/IPS/Common Patterns (session-lesson-4-playwright-forum-selectors)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to the fact that the forum selector pattern used in the Playwright course is not a standard CSS selector and might be specific to the WoltLab/IPS platform.\n\nHere's a concrete, actionable fix:\n\n**Method 1: Using the `has-text` selector**\n\nYou can try using the `has-text` selector to target the forum selector pattern. Here's an example command:\n\n```bash\nplaywright inspect --target main --selector \"div.has-text\" --filter-by-class\n```\n\nThis command will inspect the `div` elements with the `has-text` class, which might contain the forum selector pattern.\n\n**Method 2: Inspecting the HTML structure**\n\nYou can try inspecting the HTML structure of the forum selector pattern to identify the specific class or ID used to target it. Here's an example command:\n\n```bash\nplaywright inspect --target main --filter-by-class\n```\n\nThis command will display the HTML structure of the page, which you can then use to identify the class or ID used to target the forum selector pattern.\n\n**Method 3: Using a custom selector**\n\nIf the above methods don't work, you can try creating a custom selector to target the forum selector pattern. Here's an", "metrics": { "length": 1177, "commands": 2, "command_list": [ "playwright inspect --target main --selector \"div.has-text\" --filter-by-class", "playwright inspect --target main --filter-by-class" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright Forum Selectors — WoltLab/IPS/Common Patterns (session-lesson-4-playwright-forum-selectors)", "condition": "with_lesson", "status": 200, "content": "To fix the issue with the Playwright forum selectors, you need to update the selectors to match the specific HTML structure of each forum. Here's an updated code snippet with concrete, actionable fixes for each forum:\n\n**WoltLab (robot-forum.com)**\n\n```javascript\n// 帖子列表\nconst threads = await page.evaluate(() => {\n const results = [];\n document.querySelectorAll('.wbbThread').forEach((item) => {\n const titleEl = item.querySelector('.columnSubject h3 a');\n const stats = item.querySelectorAll('.columnStats .statsDataList');\n const replies = stats[0] ? parseInt(stats[0].querySelector('dd').textContent) : 0;\n const views = stats[1] ? parseInt(stats[1].querySelector('dd').textContent) : 0;\n const resolved = item.dataset.isDone === '1'; // 关键:data-is-done 属性\n const dateEl = item.querySelector('woltlab-core-date-time');\n \n if (titleEl) {\n results.push({\n href: titleEl.href,\n replies, views, resolved,\n date: dateEl ? dateEl.getAttribute('date') : ''\n });\n }\n });\n return results;\n});\n``", "metrics": { "length": 1054, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Shell Debugging — set -x 与常见Pitfalls (shell-script-debugging)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is due to the fact that the `set -x` option only prints the commands that are executed, but it doesn't show the variables that are being used. This can make it difficult to diagnose issues.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Add `set -x` to your shell script**\n\nAdd the following line to the top of your shell script:\n```bash\nset -x\n```\nThis will print the commands that are executed, which can help you diagnose issues.\n\n**Step 2: Use double quotes around variable expansions**\n\nIn your script, you're using the `for` loop to iterate over the files, but you're not using double quotes around the variable expansion:\n```bash\nfor f in $FILES; do\n echo \"处理: $f\"\ndone\n```\nTo fix this, add double quotes around the variable expansion:\n```bash\nfor f in \"$FILES\"; do\n echo \"处理: $f\"\ndone\n```\nThis will prevent the files with spaces from being split.\n\n**Step 3: Use `mapfile` instead of `ls`**\n\nIn your script, you're using `ls` to get the files, but you're", "metrics": { "length": 1017, "commands": 7, "command_list": [ "set -x", "for f in $FILES; do", "echo \"处理: $f\"", "done", "for f in \"$FILES\"; do" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "shared json needs atomic write (shared-json-needs-atomic-write)", "condition": "with_lesson", "status": 200, "content": "To fix the \"shared json needs atomic write\" error, you can use the following approach:\n\n1. Create a temporary file for the JSON data.\n2. Write the JSON data to the temporary file.\n3. Use `os.rename` to atomically rename the temporary file to the original file path.\n\nHere's an example of how you can implement this in Python:\n\n```python\nimport os\nimport json\n\ndef write_json_atomic(path, data):\n \"\"\"\n Write JSON data to a file in an atomic way.\n\n Args:\n path (str): The path to the file.\n data (dict): The JSON data to write.\n\n Returns:\n None\n \"\"\"\n # Create a temporary file for the JSON data\n with tempfile.NamedTemporaryFile('w', delete=False, dir=os.path.dirname(path)) as f:\n # Write the JSON data to the temporary file\n json.dump(data, f)\n # Get the name of the temporary file\n tmp = f.name\n\n # Use os.rename to atomically rename the temporary file to the original file path\n os.rename(tmp, path)\n```\n\nTo test this function, you can use the following command:\n\n```bash\necho \"Lesson: shared json needs atomic write\"", "metrics": { "length": 1095, "commands": 1, "command_list": [ "To test this function, you can use the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "shared json needs atomic write (shared-json-needs-atomic-write)", "condition": "plain", "status": 200, "content": "The error \"shared json needs atomic write\" is typically raised when two or more processes are trying to write to the same shared JSON file at the same time. This can happen in distributed systems or when multiple processes are accessing the same data source.\n\nTo fix this issue, you can use a locking mechanism to ensure that only one process can write to the shared JSON file at a time. Here's an example of how you can use `flock` command on Linux systems to achieve this:\n\n**Step 1: Install the required package**\n\n```bash\nsudo apt-get install flock\n```\n\n**Step 2: Wrap your JSON write operation with a lock**\n\nAssuming you're using Python, here's an example code snippet that wraps your JSON write operation with a lock:\n```python\nimport json\nimport os\nimport time\n\ndef write_json_to_file(filename, data):\n lock_file = filename + \".lock\"\n with open(lock_file, \"w\") as lock_file:\n os.flock(lock_file, os.F LOCK_EX | os.F LOCK_NB)\n try:\n with open(filename, \"w\") as json_file:\n json.dump(data, json_file)\n finally:\n os.flock(lock_file, os.F LOCK_UN)\n os", "metrics": { "length": 1130, "commands": 1, "command_list": [ "sudo apt-get install flock" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Shell Debugging — set -x 与常见Pitfalls (shell-script-debugging)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the use of `set -x` in shell scripting, which can lead to unexpected behavior if not used correctly. Here's a concrete, actionable fix with exact commands:\n\n**Problem:**\n\nWhen you use `set -x`, it enables tracing of the commands executed by the shell. However, if you're using `set -x` inside a function or a conditional block, the tracing only happens when the condition is true. This can lead to unexpected behavior, as the tracing may not capture the commands executed when the condition is false.\n\n**Fix:**\n\nTo fix this issue, you can use the following approach:\n\n```bash\n#!/bin/bash\n\n# Enable tracing for the entire script\nset -x\n\n# Define a function that will be executed with tracing\nmy_function() {\n # Use tracing inside the function\n echo \"Inside my_function\"\n}\n\n# Call the function with tracing\nmy_function\n```\n\nIn this example, the `set -x` command is used outside the function definition to enable tracing for the entire script. Inside the function, the `set -x` command is used again to enable tracing for the function itself.\n\nAlternatively, you can use `set -x` only when needed, by", "metrics": { "length": 1143, "commands": 5, "command_list": [ "set -x", "my_function() {", "echo \"Inside my_function\"", "}", "my_function" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "SSH host key verification failed when connecting to a remote server (ssh-host-key-verification-failed)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the SSH host key verification failed error:\n\n**Step 1: Remove the old host key (for changed keys)**\n\nIf the remote server was previously connected to but has been reinstalled or reconfigured, you can remove the old host key using the following command:\n\n```bash\nssh-keygen -R hostname.example.com\n```\n\nReplace `hostname.example.com` with the actual server hostname or IP address.\n\n**Step 2: Edit ~/.ssh/known_hosts manually (for unknown hosts)**\n\nIf the server is not in `known_hosts` at all, or if StrictHostKeyChecking is set to `yes`, you can edit the file manually to delete the offending line. Here's how:\n\n```bash\nnano ~/.ssh/known_hosts\n```\n\nNavigate to the line that corresponds to the server you're trying to connect to, and delete it. Save and close the file.\n\n**Step 3: Connect again**\n\nAfter removing or editing the old host key, connect to the remote server again using the following command:\n\n```bash\nssh user@hostname.example.com\n```\n\nSSH will prompt you to accept the new host key. Verify the key fingerprint with the server administrator to ensure it's legitimate.\n\n**Example Use Case", "metrics": { "length": 1139, "commands": 3, "command_list": [ "ssh-keygen -R hostname.example.com", "nano ~/.ssh/known_hosts", "ssh user@hostname.example.com" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "SSH host key verification failed when connecting to a remote server (ssh-host-key-verification-failed)", "condition": "plain", "status": 200, "content": "The SSH host key verification failed error typically occurs when the SSH client and server have different host keys. Here's a step-by-step fix to resolve this issue:\n\n**Method 1: Add the Host Key to the Client**\n\nThis method involves adding the host key to the client's known hosts file. This method is not recommended as it can make your system vulnerable to man-in-the-middle attacks.\n\n```bash\n# Connect to the remote server using SSH\nssh -o \"StrictHostKeyChecking=no\" user@remote-server\n\n# Add the host key to the known hosts file\nssh-keyscan -t rsa -H remote-server > known_hosts\n```\n\n**Method 2: Ignore Host Key Verification**\n\nThis method involves ignoring host key verification for the remote server. This method is not recommended as it can make your system vulnerable to man-in-the-middle attacks.\n\n```bash\n# Connect to the remote server using SSH\nssh -o \"StrictHostKeyChecking=no\" user@remote-server\n```\n\n**Method 3: Add the Host Key Manually**\n\nThis method involves adding the host key manually to the client's known hosts file.\n\n```bash\n# Connect to the remote server using SSH\nssh -o \"StrictHostKeyChecking=no\" user@remote", "metrics": { "length": 1135, "commands": 3, "command_list": [ "ssh -o \"StrictHostKeyChecking=no\" user@remote-server", "ssh-keyscan -t rsa -H remote-server > known_hosts", "ssh -o \"StrictHostKeyChecking=no\" user@remote-server" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Superteam Earn API returns Insufficient credits on submission create (superteam-earn-api-insufficient-credits)", "condition": "plain", "status": 200, "content": "The error \"Insufficient credits\" typically indicates that the API has exceeded its usage limits or has insufficient credits to process your request. Here's a concrete, actionable fix with exact commands to help you resolve the issue:\n\n**Method 1: Check and Adjust API Credits**\n\n1. Check the API usage credits: Run the following command to check the current API credits:\n ```bash\nsuperteam-earn-api credits\n```\n This will display the current credit balance and usage limits.\n\n2. Adjust the API credits (if necessary): If you've exceeded the usage limits or need more credits, you can adjust them using the following command:\n ```bash\nsuperteam-earn-api adjust-credits \n```\n Replace `` with the desired credit limit.\n\n**Method 2: Check and Optimize API Request**\n\n1. Review the API request: Check the API request to ensure you're not exceeding the usage limits. Review the request body, parameters, and headers to identify any unnecessary or excessive data.\n\n2. Optimize the API request: Refine the API request to reduce its size and complexity. You can do this by:\n * Removing unnecessary parameters or data.\n * Using more efficient data formats", "metrics": { "length": 1193, "commands": 2, "command_list": [ "superteam-earn-api credits", "superteam-earn-api adjust-credits " ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Superteam Earn API returns Insufficient credits on submission create (superteam-earn-api-insufficient-credits)", "condition": "with_lesson", "status": 200, "content": "To fix the Insufficient credits error, you need to follow the canonical host after redirect discovery. Here's a concrete, actionable fix with exact commands:\n\n1. Prefer the canonical host after redirect discovery:\n\n```bash\nFollow redirects\ncurl -sS -L -X POST 'https://superteam.fun/api/submission/create' \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: $COOKIE\" \\\n -d '{\"listingId\":\"...\",\"link\":\"...\",\"tweet\":\"...\",\"otherInfo\":\"...\"}'\n```\n\nHowever, you mentioned that you are getting a 403 error earlier, which means the server is not allowing your request. \n\nTo troubleshoot this issue, you can try the following:\n\n```bash\n# Get the headers from the previous 403 response\nresponse=$(curl -s -X GET 'https://superteam.fun/api/submission/create')\n\n# Extract the Location header which indicates the redirect URL\nredirect_url=$(echo \"$response\" | grep Location | awk '{print $2}')\n\n# Follow the redirect\nresponse=$(curl -s -L -X POST \"$redirect_url\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: $COOKIE\" \\\n -", "metrics": { "length": 1027, "commands": 5, "command_list": [ "Follow redirects", "curl -sS -L -X POST 'https://superteam.fun/api/submission/create' \\", "-H \"Content-Type: application/json\" \\", "-H \"Cookie: $COOKIE\" \\", "-d '{\"listingId\":\"...\",\"link\":\"...\",\"tweet\":\"...\",\"otherInfo\":\"...\"}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "TaskBounty payout POST succeeds but solver_readiness still fails (taskbounty-payout-api-ok-readiness-still-fail)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you need to update the `solver_readiness` checks to ignore the payout POST success for already-awarded tasks. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the `solver_readiness` checks**\n\nIn your code, modify the `solver_readiness` function to ignore the payout POST success for already-awarded tasks. You can do this by adding a condition to check if the task is already awarded before checking the payout method.\n\nHere's an example code snippet in Python:\n```python\ndef solver_readiness(task):\n # Check if the task is already awarded\n if task.status == 'awarded':\n return True # Ignore payout POST success for already-awarded tasks\n\n # Check if there's a payout method on file\n if not task.payout_method:\n return False # No payout method, cannot send payments\n\n # Check if the payout method is valid\n if task.payout_method['type'] != 'solana_usdc':\n return False # Invalid payout method\n\n # Check if the Solana address is valid\n if not task.payout_method['address']:\n return False # Invalid Solana address\n\n return True", "metrics": { "length": 1126, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "TaskBounty payout POST succeeds but solver_readiness still fails (taskbounty-payout-api-ok-readiness-still-fail)", "condition": "plain", "status": 200, "content": "The error \"taskbounty-payout-api-ok-readiness-still-fail\" typically indicates that the TaskBounty payout API has been successfully updated, but the solver readiness has not been updated accordingly.\n\nHere's a step-by-step fix:\n\n**Step 1: Update the TaskBounty Payout API**\n\nRun the following command to update the TaskBounty payout API:\n\n```bash\nkubectl patch taskbounty/payout-api -p '{\"spec\":{\"solverReadiness\":true}}'\n```\n\nThis command updates the `solverReadiness` field to `true` in the `payout-api` TaskBounty resource.\n\n**Step 2: Wait for the TaskBounty Payout API to be updated**\n\nRun the following command to wait for the TaskBounty payout API to be updated:\n\n```bash\nkubectl get taskbounty/payout-api -o jsonpath='{.status.updated}'\n```\n\nThis command prints the timestamp of when the TaskBounty payout API was last updated.\n\n**Step 3: Check the solver readiness**\n\nRun the following command to check the solver readiness:\n\n```bash\nkubectl get taskbounty/payout-api -o jsonpath='{.spec.solverReadiness}'\n```\n\nThis command prints the current solver readiness status.\n\nIf", "metrics": { "length": 1078, "commands": 3, "command_list": [ "kubectl patch taskbounty/payout-api -p '{\"spec\":{\"solverReadiness\":true}}'", "kubectl get taskbounty/payout-api -o jsonpath='{.status.updated}'", "kubectl get taskbounty/payout-api -o jsonpath='{.spec.solverReadiness}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "TypeScript solution-style tsconfig — tsc --noEmit checks nothing silently (typescript-solution-tsconfig-silent-nocheck)", "condition": "with_lesson", "status": 200, "content": "To fix the TypeScript error, you need to delete the unused import from `lucide-react`, use the correct typecheck command targeting the app project, and add a deliberate-breakage test to CI. Here are the concrete, actionable steps:\n\n**Step 1: Delete the unused import**\n\nRemove the line `import { Map } from 'lucide-react';` from your code.\n\n**Step 2: Use the correct typecheck command**\n\nUpdate your `tsconfig.app.json` file to use the correct typecheck command:\n```json\n{\n \"compilerOptions\": {\n // ...\n \"outDir\": \"build\",\n \"module\": \"commonjs\",\n \"noImplicitAny\": true,\n \"strict\": true,\n \"sourceMap\": true,\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"target\": \"esnext\",\n \"moduleResolution\": \"node\",\n \"resolveJsonModule\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"module\": \"commonjs\",\n \"noImplicitThis\": true\n }\n}\n```\nThen, run the following command to typecheck your app project:\n```bash\nnpx tsc -p tsconfig.app", "metrics": { "length": 981, "commands": 1, "command_list": [ "Then, run the following command to typecheck your app project:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "TypeScript solution-style tsconfig — tsc --noEmit checks nothing silently (typescript-solution-tsconfig-silent-nocheck)", "condition": "plain", "status": 200, "content": "The error you're experiencing is due to a configuration issue in your `tsconfig.json` file. The `--noEmit` flag tells TypeScript to compile your code without emitting any output files. However, when you run `tsc` with this flag, it checks your code silently and reports any errors or warnings.\n\nTo fix this issue, you need to add the `noEmit` option to your `compilerOptions` in your `tsconfig.json` file. Here's how you can do it:\n\n1. Open your `tsconfig.json` file in a text editor.\n2. Add the following line to the `compilerOptions` section:\n\n```json\n\"noEmit\": true,\n```\n\nSo your `tsconfig.json` file should look something like this:\n\n```json\n{\n \"compilerOptions\": {\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"noImplicitAny\": true,\n \"moduleResolution\": \"node\",\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"noCheckJs\": true,\n \"noEmit\": true\n },\n \"include\": [\"src/**/*\"]\n}\n```\n\n3. Save your `tsconfig.json`", "metrics": { "length": 954, "commands": 1, "command_list": [ "So your `tsconfig.json` file should look something like this:" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 2, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "USDC: base units vs human amounts — агент платит 1000x или думает, что 1000 (usdc-base-units-vs-human-amounts-agent-marketplaces-ru)", "condition": "with_lesson", "status": 200, "content": "**Fixing the Issue: USDC Base Units vs Human Amounts**\n\nTo resolve the issue, we need to address the following problems:\n\n1. Convert `paymentAmount` from base units to human (USDC) amounts.\n2. Handle the difference in decimal places between USDC and other cryptocurrencies (18 decimals vs 6 decimals).\n3. Update the code to correctly handle `balanceBaseUnits` and `balanceUsdc`.\n\n**Step 1: Convert `paymentAmount` to Human (USDC) Amounts**\n\nWe need to modify the code to convert `paymentAmount` from base units to human (USDC) amounts. We can do this by dividing the `paymentAmount` by the number of base units in 1 USDC (1,000,000).\n\n```python\n# Replace this line\npayment_amount = 1000\n\n# With this line\npayment_amount = payment_amount / 10**6 # Convert base units to human (USDC) amounts\n```\n\n**Step 2: Handle Decimal Place Difference**\n\nSince USDC has 6 decimals, we need to handle the difference in decimal places when converting between base units and human (USDC) amounts. We can do this by rounding the `paymentAmount", "metrics": { "length": 1028, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 8, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "USDC: base units vs human amounts — агент платит 1000x или думает, что 1000 (usdc-base-units-vs-human-amounts-agent-marketplaces-ru)", "condition": "plain", "status": 200, "content": "The error message you're seeing is related to a specific marketplace issue with USDC. Here's a step-by-step fix:\n\n**Method 1: Update the marketplace configuration**\n\n1. Open the terminal and navigate to the marketplace directory.\n2. Run the following command to update the marketplace configuration:\n```bash\nnpm run config:marketplace:usdc\n```\nThis command updates the marketplace configuration to reflect the correct USDC base units.\n\n**Method 2: Update the agent configuration**\n\n1. Open the terminal and navigate to the agent directory.\n2. Run the following command to update the agent configuration:\n```bash\nnpm run config:agent:usdc\n```\nThis command updates the agent configuration to reflect the correct USDC base units.\n\n**Method 3: Update the marketplace settings**\n\n1. Open the terminal and navigate to the marketplace directory.\n2. Run the following command to update the marketplace settings:\n```bash\nnpm run config:marketplace:settings:usdc\n```\nThis command updates the marketplace settings to reflect the correct USDC base units.\n\nAfter running any of these commands, restart the marketplace and agent services. You can do this by running the following commands:\n```bash\nnpm start\n```\nThis should resolve the issue and", "metrics": { "length": 1231, "commands": 4, "command_list": [ "npm run config:marketplace:usdc", "npm run config:agent:usdc", "npm run config:marketplace:settings:usdc", "npm start" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "USDC пришёл в Ethereum mainnet, а нужен Base — и 0 ETH на газ (usdc-ethereum-instead-of-base-zero-eth-gas)", "condition": "plain", "status": 200, "content": "The error message you're encountering suggests that the USDC token has been deployed on the Ethereum mainnet, but the contract is expecting the Base token, which is not present. Additionally, there is an issue with the gas price, as it's set to 0.\n\nTo fix this issue, you'll need to deploy the Base token on the Ethereum mainnet and update the USDC contract to use the Base token instead of the Ethereum token. Here are the steps to follow:\n\n**Step 1: Deploy the Base token**\n\nYou'll need to deploy a new contract for the Base token. You can use a tool like Truffle or OpenZeppelin to deploy a contract.\n\nAssuming you're using Truffle, run the following command:\n```bash\ntruffle migrate --network mainnet\n```\nThis will deploy a new contract for the Base token on the Ethereum mainnet.\n\n**Step 2: Update the USDC contract**\n\nYou'll need to update the USDC contract to use the Base token instead of the Ethereum token. You can do this by updating the `token` variable in the contract's ABI.\n\nAssuming you have the USDC contract's ABI, you can update it using the following command:\n```bash\ntruffle update-usdc-contract", "metrics": { "length": 1116, "commands": 1, "command_list": [ "truffle migrate --network mainnet" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Version Management Across Multiple Files (version-management-multiple-files)", "condition": "plain", "status": 200, "content": "The error \"Version Management Across Multiple Files (version-management-multiple-files)\" typically occurs when you're trying to manage the version of a file using Git, but the file has been modified by multiple people.\n\nHere's a step-by-step fix to resolve this issue:\n\n**Step 1: Check the commit history**\n```bash\ngit log\n```\nThis command will display the commit history of your repository. Look for any commits that include the file you're trying to manage.\n\n**Step 2: Identify the conflicting changes**\n```bash\ngit diff --stat\n```\nThis command will show you the differences between the current version of the file and the previous versions. Look for any changes that were made by multiple people.\n\n**Step 3: Use `git merge` to resolve conflicts**\n```bash\ngit merge \n```\nReplace `` with the name of the branch that contains the conflicting changes. This will merge the changes from that branch into your current branch.\n\n**Step 4: Resolve conflicts manually**\nIf the merge was successful, you may need to manually resolve any conflicts that were detected. Look for any files that have been modified by multiple people and resolve the conflicts by choosing the version that you want to keep.\n\n**Step ", "metrics": { "length": 1227, "commands": 3, "command_list": [ "git log", "git diff --stat", "git merge " ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "USDC пришёл в Ethereum mainnet, а нужен Base — и 0 ETH на газ (usdc-ethereum-instead-of-base-zero-eth-gas)", "condition": "with_lesson", "status": 200, "content": "Чтобы решить эту проблему, нам нужно найти USDC на Ethereum mainnet и USDC на Base. Затем мы можем использовать эти балансы для преобразования USDC на Base.\n\nСначала, мы можем использовать `cast` команду для определения баланса USDC на Ethereum mainnet и Base:\n\n```bash\n# ETH balance (mainnet)\neth_getBalance --rpc-url https://ethereum.publicnode.com\n\n# USDC mainnet (balanceOf)\ncast call 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \"balanceOf(address)(uint256)\" --rpc-url https://ethereum.publicnode.com\n\n# USDC Base\ncast call 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \"balanceOf(address)(uint256)\" --rpc-url https://ethereum.publicnode.com\n```\n\nЗатем мы можем использовать эти балансы для преобразования USDC на Base:\n\n```bash\n# Преобразование USDC на Base\nUSDC_MAINNET_BALANCE", "metrics": { "length": 818, "commands": 3, "command_list": [ "eth_getBalance --rpc-url https://ethereum.publicnode.com", "cast call 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \"balanceOf(address)(uint256)\" --rpc-url https://ethereum.publicnode.com", "cast call 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \"balanceOf(address)(uint256)\" --rpc-url https://ethereum.publicnode.com" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Version Management Across Multiple Files (version-management-multiple-files)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of having a single source of truth for version numbers across multiple files, we can use a combination of tools and techniques. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update `pyproject.toml`**\n\nOpen your `pyproject.toml` file in a text editor and update the `version` field to the desired version number:\n```toml\n[tool.poetry.version]\nversion = \"X.Y.Z\"\n```\nReplace `X.Y.Z` with the desired version number.\n\n**Step 2: Update `CHANGELOG.md`**\n\nOpen your `CHANGELOG.md` file in a text editor and update the version number at the top of the file:\n```markdown\nVX.Y.Z — YYYY-MM-DD\n\nHighlights\n- Feature 1\n- Feature 2\n\nFixes\n- Fix 1\n- Fix 2\n```\nReplace `VX.Y.Z` with the version number from `pyproject.toml`.\n\n**Step 3: Update `README.md`**\n\nOpen your `README.md` file in a text editor and update the version number in the image source URL:\n```markdown\n/node_modules/'],\n collectCoverageFrom: ['**/*.{js,jsx,ts,tsx}'],\n coverageReporters: ['json', 'text', 'lcov', 'clover'],\n coverageThreshold: {\n global", "metrics": { "length": 1012, "commands": 1, "command_list": [ "npm install vitest@latest" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wcferry wechat version lock (wcferry-wechat-version-lock)", "condition": "with_lesson", "status": 200, "content": "To fix the WCFerry WeChat version lock error, you need to downgrade your WeChat version to the one that WCFerry supports. Here are the steps to follow:\n\n**Step 1: Close WeChat and uninstall the current version**\n\nOpen PowerShell as an administrator and run the following commands:\n\n```powershell\nStop-Service WeChat\nGet-Service WeChat | Stop-Service\nGet-Service WeChat | Set-Service -StartupType Disabled\n```\n\nThen, uninstall the current version of WeChat:\n\n```powershell\nAdd-WindowsFeature WeChat-2015\nGet-WindowsFeature WeChat-2015 | Uninstall-WindowsFeature\n```\n\n**Step 2: Download and install the supported version**\n\nDownload the WeChatSetup-3.9.12.51.exe file from the official WeChat website:\n\n```powershell\n$downloadUrl = \"https://github.com/WeChat-Group/wcferry/releases/download/v39.5.0/WeChatSetup-3.9.12.51.exe\"\nInvoke-WebRequest -Uri $downloadUrl -OutFile WeChatSetup-3.9.12.51.exe\n```\n\nRun the installer and disable automatic updates:\n\n```powershell\n& We", "metrics": { "length": 968, "commands": 4, "command_list": [ "Then, uninstall the current version of WeChat:", "**Step 2: Download and install the supported version**", "Download the WeChatSetup-3.9.12.51.exe file from the official WeChat website:", "Run the installer and disable automatic updates:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wcferry wechat version lock (wcferry-wechat-version-lock)", "condition": "plain", "status": 200, "content": "The error `wcferry wechat version lock (wcferry-wechat-version-lock)` is related to a version conflict issue in WeChat Mini Program development using WCFerry.\n\nHere's a step-by-step fix:\n\n**Step 1: Update WeChat Mini Program SDK**\n\nUpdate the WeChat Mini Program SDK to the latest version:\n```bash\nnpm install wechat-sdk@latest\n```\n**Step 2: Update WCFerry**\n\nUpdate WCFerry to the latest version:\n```bash\nnpm install wcferry@latest\n```\n**Step 3: Run WCFerry with the `--force` flag**\n\nRun WCFerry with the `--force` flag to force the update:\n```bash\nwcferry --force\n```\n**Step 4: Check for version conflicts**\n\nAfter running WCFerry, check for version conflicts by running:\n```bash\nwcferry check\n```\nIf there are any conflicts, you'll see an error message indicating the conflicting versions.\n\n**Step 5: Resolve version conflicts (if necessary)**\n\nIf there are version conflicts, you may need to resolve them by updating the conflicting dependencies or using the `--ignore` flag to ignore the conflicts:\n```bash\nwcf", "metrics": { "length": 1016, "commands": 4, "command_list": [ "npm install wechat-sdk@latest", "npm install wcferry@latest", "wcferry --force", "wcferry check" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Webhook duplicate delivery defeated by an over-broad dedupe key (webhook-duplicate-delivery-dedupe-scope)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to modify your code to include a namespaced marker in the webhook-written references and restrict the duplicate matcher to entries that carry this marker. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Give webhook-written references a namespaced marker**\n\nIn your code, add a prefix to the `PaymentIntent` reference when writing it to the ledger in the webhook path:\n```python\n# webhook path\npayment_intent_id = 'pi_1234567890abcdef'\nwebhook_payment_intent_id = f'stripe_pi:{payment_intent_id}'\n# Write to ledger\nledger_ref = f'pi_{webhook_payment_intent_id}'\n```\n\n**Step 2: Restrict the duplicate matcher to entries that carry the marker**\n\nIn your code, modify the duplicate matcher to only consider entries that carry the namespaced marker:\n```python\n# duplicate matcher\ndef is_duplicate(ledger_ref, webhook_ref):\n # Check if the ledger_ref contains the namespaced marker\n if not webhook_ref.startswith('stripe_pi:'):\n return False\n # Compare the ledger_ref and webhook_ref\n # ...\n```\n\n**Step 3: Unit-test both paths**\n\nCreate unit tests to verify that the changes work", "metrics": { "length": 1141, "commands": 2, "command_list": [ "**Step 2: Restrict the duplicate matcher to entries that carry the marker**", "In your code, modify the duplicate matcher to only consider entries that carry the namespaced marker:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 1, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Webhook duplicate delivery defeated by an over-broad dedupe key (webhook-duplicate-delivery-dedupe-scope)", "condition": "plain", "status": 200, "content": "The error message \"Webhook duplicate delivery defeated by an over-broad dedupe key (webhook-duplicate-delivery-dedupe-scope)\" typically occurs when the dedupe scope for a webhook is too broad, causing the webhook to be duplicated.\n\nTo fix this issue, you need to narrow down the dedupe scope for the webhook. Here's a step-by-step guide to help you resolve the issue:\n\n**Step 1: Check the current dedupe scope**\n\nRun the following command to check the current dedupe scope for the webhook:\n```bash\nn8n webhooks list\n```\nThis will list all webhooks in your N8n instance, including their dedupe scopes.\n\n**Step 2: Identify the webhook with the issue**\n\nLook for the webhook that's causing the issue and take note of its ID and name.\n\n**Step 3: Update the dedupe scope**\n\nRun the following command to update the dedupe scope for the webhook:\n```bash\nn8n webhooks update --dedupe-scope \n```\nReplace `` with the ID of the webhook you identified in Step 2, and `` with a narrower", "metrics": { "length": 1034, "commands": 2, "command_list": [ "n8n webhooks list", "n8n webhooks update --dedupe-scope " ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "webMCP — Chrome's Experimental Protocol for AI Agents (webmcp-chrome-ai-agent-protocol)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the experimental webMCP protocol not being supported by your version of Chrome. To fix this issue, you can try the following steps:\n\n1. Update Chrome to the latest version:\n\n You can update Chrome by following these steps:\n\n - Open a terminal or command prompt.\n - Type the following command to check for updates: `google-chrome --version`\n - If an update is available, type the following command to update Chrome: `google-chrome --version` (or `google-chrome-stable` for stable version)\n\n Alternatively, you can also update Chrome using the Google Chrome website.\n\n2. Disable experimental features:\n\n If updating Chrome doesn't work, you can try disabling experimental features. To do this, follow these steps:\n\n - Open Chrome and type `chrome://flags/` in the address bar.\n - Look for the \"WebMCP\" flag and click on the dropdown menu next to it.\n - Select \"Disabled\" from the dropdown menu.\n - Click on the \"Relaunch\" button at the bottom of the page.\n\n3. Check if the issue is related to a specific extension:\n\n If disabling experimental features doesn't work, it's possible that the issue is", "metrics": { "length": 1164, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 2, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "webMCP — Chrome's Experimental Protocol for AI Agents (webmcp-chrome-ai-agent-protocol)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, it appears that the issue is related to the experimental Chrome protocol \"webMCP\" for AI agents. To fix this issue, you'll need to update your code to use the webMCP protocol instead of the standard HTML/CSS presentation.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Update your code to use the webMCP protocol**\n\nYou'll need to modify your code to use the webMCP endpoint instead of the standard HTML/CSS presentation. You can do this by adding a new endpoint to your code and using the `webMCP` protocol to retrieve the structured data.\n\nFor example, if you're using JavaScript, you can use the following code:\n```javascript\nconst webMCPEndpoint = 'https://example.com/webmcp';\nfetch(`${webMCPEndpoint}/structured-data`)\n .then(response => response.json())\n .then(data => console.log(data));\n```\n**Step 2: Update your Chrome settings**\n\nTo use the webMCP protocol, you'll need to enable it in your Chrome settings. You can do this by following these steps:\n\n1. Open Chrome and go to `chrome://settings/`\n2. Scroll down to the \"Experimental features\"", "metrics": { "length": 1110, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.75 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wechat pubacct fetch separate search from retrieval (wechat-pubacct-fetch-separate-search-from-retrieval)", "condition": "plain", "status": 200, "content": "The error \"wechat-pubacct-fetch-separate-search-from-retrieval\" is likely related to WeChat's API usage policies. Here's a concrete, actionable fix:\n\n**Step 1: Update your WeChat API credentials**\n\nYou need to update your WeChat API credentials to use the `wechat-pubacct-fetch-separate-search-from-retrieval` endpoint. To do this:\n\n1. Go to the WeChat Developer Center () and log in with your account.\n2. Click on \"My Account\" (, and then click on \"API Credentials\" ().\n3. Click on \"Edit\" next to \"API Secret\" and update the \"API Secret\" with a new value.\n4. Click \"Save\" to save the changes.\n\n**Step 2: Update your code**\n\nYou need to update your code to use the `wechat-pubacct-fetch-separate-search-from-retrieval` endpoint. Here's an example in Python using the `requests` library:\n\n```python\nimport requests\n\naccess_token = \"your_access_token\"\naccount_id = \"your_account_id\"\n\nurl = f\"https://api.weixin.qq.com/pubacct/fetch?access_token={access_token}&account_id={account_id", "metrics": { "length": 1019, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wechat pubacct fetch separate search from retrieval (wechat-pubacct-fetch-separate-search-from-retrieval)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"wechat-pubacct-fetch-separate-search-from-retrieval\", you can follow these steps:\n\n**Step 1: Update the `fetch_article` function to separate search and retrieval phases**\n\n```python\nimport requests\nfrom bs4 import BeautifulSoup\nimport time\nimport random\n\ndef search_phase(query):\n try:\n url = \"https://sogou.com/web?\"\n params = {\n \"id\": \"web\",\n \"query\": query,\n \"pos\": \"1\"\n }\n headers = {\n \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3\"\n }\n response = requests.get(url, params=params, headers=headers)\n return response.json()[\"result\"][\"list\"]\n except requests.exceptions.RateLimitError:\n log(\"搜索阶段限流,稍后重试\")\n raise\n\ndef retrieval_phase(url):\n try:\n headers = {\n \"User-Agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.", "metrics": { "length": 986, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wecom robot long connect no ngrok (wecom-robot-long-connect-no-ngrok)", "condition": "with_lesson", "status": 200, "content": "To fix the error `wecom robot long connect no ngrok`, you need to use the long connection mode instead of the traditional HTTP callback mode. Here are the steps to follow:\n\n1. **Update your WeCom Bot code**: Replace the traditional HTTP callback code with the long connection code. You can find an example in the verified lesson you provided.\n\n2. **Create a WebSocket connection**: Use a library like `websocket-client` to establish a WebSocket connection from your WeCom Bot server to the WeChat server. This connection will be used for long connection mode.\n\n3. **Send messages**: Use the WebSocket connection to send messages to the WeChat server. This is the key step in long connection mode.\n\nHere's an example code in Python using the `websocket-client` library:\n```python\nimport asyncio\nimport websockets\n\n# WeChat server URL\nwechat_server_url = \"wss://api.weixin.qq.com\"\n\n# WeCom Bot token\nwecom_bot_token = \"YOUR_WECOM_BOT_TOKEN\"\n\n# WebSocket connection\nasync def connect():\n async with websockets.connect(wechat_server_url) as websocket:\n # Send a message to the WeChat server\n message = {\"msgtype\": \"text\", \"content\": \"Hello", "metrics": { "length": 1152, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Welcome bot should show MCP intake path for agents (welcome-bot-mcp-intake-path)", "condition": "plain", "status": 200, "content": "To fix the error and display the MCP intake path for agents, you can use the following command:\n\n```bash\nbot say MCP intake path for agents\n```\n\nIf you want to make it a default welcome message, you can add it to the bot's configuration file.\n\nHere's an example of how to add it to the `config.yml` file (assuming you're using the Rasa Open Source bot):\n\n```yml\nintents:\n - name: welcome-bot-mcp-intake-path\n text: MCP intake path for agents\n\nwelcome_message:\n - text: MCP intake path for agents\n```\n\nThen, restart the bot server:\n\n```bash\nrasa run --enable-api --port 5005\n```\n\nAfter making these changes, the bot should display the MCP intake path for agents when it starts.", "metrics": { "length": 681, "commands": 2, "command_list": [ "bot say MCP intake path for agents", "Then, restart the bot server:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 2, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Welcome bot should show MCP intake path for agents (welcome-bot-mcp-intake-path)", "condition": "with_lesson", "status": 200, "content": "To fix the welcome bot message to show the MCP intake path for agents, you can add a new section to the `.github/workflows/pr-welcome.yml` file. Here are the steps:\n\n1. Open the `.github/workflows/pr-welcome.yml` file in a text editor.\n2. Add the following code to the file:\n```yaml\nconst body = [\n \" Welcome to MisakaNet!\",\n \"\",\n \" For Agents & Crawlers\",\n \"\",\n \"Found a missing lesson? Submit via MCP (no account needed):\",\n \"bash\",\n \"curl -sS https://misakanet.org/mcp \\\\\",\n \" -H 'Content-Type: application/json' \\\\\",\n \" -H 'MCP-Protocol-Version: 2025-06-18' \\\\\",\n \" -d '{\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"method\\\":\\\"tools/call\\\",\\\"params\\\":{\\\"name\\\":\\\"misakanet_submit_intake\\\",\\\"arguments\\\":{\\\"problem\\\":\\\"YOUR PROBLEM\\\",\\\"source\\\":\\\"your-agent\\\"}}}'\",\n \"\",\n \"(refs)\",\n \"MCP verified\",\n];\n```\n3. Save the changes to the file.\n4. Commit the changes with a meaningful commit message, e.g.,", "metrics": { "length": 905, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 3, "lesson_hits": 5, "lesson_hit_rate": 0.833 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wecom robot long connect no ngrok (wecom-robot-long-connect-no-ngrok)", "condition": "plain", "status": 200, "content": "The error \"wecom-robot-long-connect-no-ngrok\" is a known issue with WeCom robots, where they are unable to connect to WeChat due to a specific configuration issue.\n\nHere's a step-by-step solution to fix this issue:\n\n**Prerequisites:**\n\n1. Make sure you have a WeChat account and a WeCom robot account.\n2. Ensure that your WeCom robot is connected to the internet.\n\n**Step 1: Check WeCom Robot Settings**\n\n1. Log in to your WeCom robot account and go to the \"Robot Settings\" page.\n2. Click on \"Robot Information\" and check if the \"Access Token\" is valid and not expired.\n\n**Step 2: Update WeCom Robot Configuration**\n\n1. Go to the WeCom robot settings page and click on \"Robot Configuration\".\n2. Scroll down to the \"Robot Connection\" section.\n3. Click on \"Edit\" next to \"Robot Connection\".\n4. In the \"Robot Connection\" section, check if the \"Proxy\" field is empty.\n5. If it's not empty, delete the existing proxy configuration.\n6. Click \"Save\" to save the changes.\n\n**Step 3: Check NGROK Configuration**\n\n1. If you're using NGRO", "metrics": { "length": 1027, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 1, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Windows CI: splitCommand backslash stripping, UnicodeEncodeError, and detached (windows-ci-splitcommand-backslash-unicode-detached)", "condition": "with_lesson", "status": 200, "content": "To fix the issues you're experiencing in your Windows CI session, you'll need to make the following changes:\n\n### Fix 1: Restore the `isWindows` guard in `splitCommand`\n\nFirst, you need to restore the `isWindows` guard that prevents backslash stripping in your `splitCommand` function. You can do this by adding the following code:\n\n```diff\n- if not isWindows:\n+ if not isWindows:\n```\n\nThen, you need to add the `isWindows` guard to your `splitCommand` function:\n\n```python\ndef splitCommand(command):\n if not isWindows:\n return command\n return command.replace('\\\\', '\\\\\\\\')\n```\n\n### Fix 2: Specify the encoding for the Python subprocess\n\nTo fix the `UnicodeEncodeError` issue, you need to specify the encoding for the Python subprocess. You can do this by adding the following code:\n\n```python\nimport subprocess\n\n# Specify the encoding for the subprocess\nsubprocess.run(command, shell=True, encoding='utf-8', errors='ignore')\n```\n\nOr, you can use the `text` parameter when calling `subprocess.run`:\n\n```python\nsubprocess.run(command, shell=True, text=True, errors='ignore')\n```\n\n", "metrics": { "length": 1092, "commands": 3, "command_list": [ "Then, you need to add the `isWindows` guard to your `splitCommand` function:", "To fix the `UnicodeEncodeError` issue, you need to specify the encoding for the Python subprocess. You can do this by adding the following code:", "Or, you can use the `text` parameter when calling `subprocess.run`:" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Windows CI: splitCommand backslash stripping, UnicodeEncodeError, and detached (windows-ci-splitcommand-backslash-unicode-detached)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the way Windows handles path separators and Unicode encoding. Here's a concrete, actionable fix to resolve the issue:\n\n**Solution:**\n\n1. Update your `settings.json` file to include the following configuration:\n```json\n{\n \"version\": 2,\n \"paths\": {\n \"windows\": [\"$(SystemRoot)/System32\", \"$(SystemRoot)/SysWOW64\"]\n }\n}\n```\nThis tells Visual Studio Code to use the 32-bit and 64-bit system directories for path resolution.\n\n2. In your `tasks.json` file, add the following configuration:\n```json\n{\n \"version\": \"2.0.0\",\n \"tasks\": [\n {\n \"label\": \"build\",\n \"type\": \"shell\",\n \"command\": \"bash\",\n \"args\": [\n \"-c\",\n \"echo \\\"Building...\\\" && your_command_here\"\n ],\n \"group\": {\n \"kind\": \"build\",\n \"isDefault\": true\n },\n \"problemMatcher\": [],\n \"presentation\": {\n \"focus\": false,\n \"panel\": \"shared\",\n \"reveal\": \"silent\",\n \"showReuseMessage\": false,\n \"clear", "metrics": { "length": 1145, "commands": 2, "command_list": [ "This tells Visual Studio Code to use the 32-bit and 64-bit system directories for path resolution.", "2. In your `tasks.json` file, add the following configuration:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 3, "lesson_hit_rate": 0.5 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "deepseek tui write file sandbox worktree git path (worktree-git-path-deepseek-tui)", "condition": "with_lesson", "status": 200, "content": "根据给出的问题和解决方案,以下是解决错误的具体命令:\n\n1. 使用 `code_execution` 替代 `write_file` 做文件写入:\n\n```bash\ncode_execution python -c \"import os; f = open('path/to/file.txt', 'w'); f.write('Hello World'); f.close()\"\n```\n\n2. 绕过 `worktree`,直接对 `main` 分支做 `git add/commit/push`:\n\n```bash\n# 对 main 分支进行 add\ngit -C main add .\n\n# 对 main 分支进行 commit\ngit -C main commit -m \"Commit message\"\n\n# 对 main 分支进行 push\ngit -C main push origin main\n```\n\n3. git push 使用显式认证:\n\n```bash\ngit push -u origin main --force-with-lease\n```\n\n注意:-u选项用于设置远程分支的默认分支。\n\n请确保您有正确的GitHub个人访问 token(PAT)和分支名称。\n\n此解决方案假设您正在使用WSL(Windows Subsystem for Linux)和Hydra worktree管理。", "metrics": { "length": 609, "commands": 5, "command_list": [ "code_execution python -c \"import os; f = open('path/to/file.txt', 'w'); f.write('Hello World'); f.close()\"", "git -C main add .", "git -C main commit -m \"Commit message\"", "git -C main push origin main", "git push -u origin main --force-with-lease" ], "has_command_block": true, "actionable": false, "inline_code_count": 10, "lesson_hits": 2, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wsl pip gbk hub poller crash (wsl-pip-gbk-hub-poller-crash)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to specify the encoding when reading the config.yaml file and when opening files in the hub_poller.py script. Here are the steps:\n\n1. Update the Python script to explicitly specify the encoding when reading the config.yaml file:\n\n ```python\npython\nimport yaml\n\nwith open(config_path, encoding=\"utf-8\") as f:\n return yaml.safe_load(f)\n```\n\n Replace `config_path` with the actual path to your config.yaml file.\n\n2. Update the hub_poller.py script to add the encoding parameter to all open() calls:\n\n ```python\npython\nimport os\n\n# ...\n\nwith open(file_path, encoding=\"utf-8\") as f:\n contents = f.read()\n\n# ...\n```\n\n Replace `file_path` with the actual path to the file you are trying to read.\n\n3. Update your PowerShell terminal to use UTF-8 encoding:\n\n ```bash\nwsl --set-locale LANG=C.UTF-8\n```\n\n This will set the locale to C.UTF-8, which uses UTF-8 encoding.\n\n4. Verify the changes:\n\n ```bash\necho \"Lesson: wsl pip gbk hub poller crash\"\nwc -l lessons", "metrics": { "length": 1007, "commands": 6, "command_list": [ "Replace `config_path` with the actual path to your config.yaml file.", "2. Update the hub_poller.py script to add the encoding parameter to all open() calls:", "Replace `file_path` with the actual path to the file you are trying to read.", "3. Update your PowerShell terminal to use UTF-8 encoding:", "This will set the locale to C.UTF-8, which uses UTF-8 encoding." ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 3, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "deepseek tui write file sandbox worktree git path (worktree-git-path-deepseek-tui)", "condition": "plain", "status": 200, "content": "The error you're encountering suggests that there's an issue with the `deepseek` command in the context of a Git worktree. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Update Git and DeepSeek**\n\nFirst, make sure you're running the latest version of Git and DeepSeek. You can update them using the following commands:\n\n```bash\ngit update-worktree --prune\ngit fetch --all\ngit pull --all\n```\n\n**Step 2: Check if the issue is related to the worktree**\n\nIf the issue persists, try removing the worktree and recreate it:\n\n```bash\ngit worktree remove \n```\n\nReplace `` with the actual name of your worktree.\n\n**Step 3: Check if the issue is related to the .git directory**\n\nSometimes, issues with the `.git` directory can cause problems with DeepSeek. Try the following command to clean up the `.git` directory:\n\n```bash\nrm -rf .git/.gitmodules\n```\n\nThis command will remove the `.gitmodules` file, which is used to manage Git submodules.\n\n**Step 4: Try the `deepseek` command again**\n\nAfter completing the above steps", "metrics": { "length": 1056, "commands": 5, "command_list": [ "git update-worktree --prune", "git fetch --all", "git pull --all", "git worktree remove ", "rm -rf .git/.gitmodules" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wsl pip gbk hub poller crash (wsl-pip-gbk-hub-poller-crash)", "condition": "plain", "status": 200, "content": "The error message you're seeing suggests that the `wsl-pip-gbk-hub-poller` is crashing. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Update the WSL Distribution**\n\nFirst, update the WSL distribution to the latest version:\n\n```bash\nwsl --update\n```\n\n**Step 2: Update pip**\n\nNext, update pip to the latest version:\n\n```bash\npython -m pip install --upgrade pip\n```\n\n**Step 3: Update the `wsl-pip-gbk-hub-poller`**\n\nThen, update the `wsl-pip-gbk-hub-poller` package:\n\n```bash\nwsl --install --update\n```\n\nThis command will update the `wsl-pip-gbk-hub-poller` package to the latest version.\n\n**Step 4: Restart the `wsl-pip-gbk-hub-poller` service**\n\nAfter updating the package, restart the `wsl-pip-gbk-hub-poller` service:\n\n```bash\nwsl --set-stdin-wsl-polling --enable\n```\n\nThis command will enable the `wsl-pip-gbk-hub-poller` service to run in the", "metrics": { "length": 856, "commands": 4, "command_list": [ "wsl --update", "python -m pip install --upgrade pip", "wsl --install --update", "wsl --set-stdin-wsl-polling --enable" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 1, "lesson_hit_rate": 0.333 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wsl proxy huggingface external (wsl-proxy-huggingface-external)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to configure WSL2 to use your Windows proxy settings. Here's a step-by-step guide:\n\n**Step 1: Add the proxy configuration to `~/.bashrc`**\n\nOpen the `~/.bashrc` file in a text editor:\n```bash\nnano ~/.bashrc\n```\nAdd the following lines at the end of the file:\n```bash\nexport http_proxy=http://127.0.0.1:7890\nexport https_proxy=http://127.0.0.1:7890\nexport no_proxy=localhost,127.0.0.1,.local\n```\nReplace `7890` with the actual port number of your proxy server (e.g., `8080` for Clash).\n\n**Step 2: Reload the `bashrc` configuration**\n\nReload the `bashrc` configuration to apply the changes:\n```bash\nsource ~/.bashrc\n```\n**Step 3: Verify the proxy configuration**\n\nTest the proxy configuration by running the following command:\n```bash\nexport http_proxy=http://127.0.0.1:7890\necho \"Verification passed: fix command exited 0\"\n```\nThis should print \"Verification passed: fix command exited 0\"", "metrics": { "length": 914, "commands": 7, "command_list": [ "nano ~/.bashrc", "export http_proxy=http://127.0.0.1:7890", "export https_proxy=http://127.0.0.1:7890", "export no_proxy=localhost,127.0.0.1,.local", "source ~/.bashrc" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wsl proxy huggingface external (wsl-proxy-huggingface-external)", "condition": "plain", "status": 200, "content": "The error message you're encountering is likely due to a missing configuration file or an incorrect proxy setting in your WSL (Windows Subsystem for Linux) installation.\n\nHere's a step-by-step guide to fix the issue:\n\n**Step 1: Update WSL Proxy Configuration**\n\nRun the following command to update the WSL proxy configuration:\n\n```bash\nwsl --set-proxy huggingface-external https://huggingface.co\n```\n\nThis command updates the proxy setting for the `huggingface-external` WSL distribution.\n\n**Step 2: Create a `~/.bashrc` file (if it doesn't exist)**\n\nCreate a new file named `~/.bashrc` if it doesn't already exist. This file will contain the proxy settings for your WSL distributions.\n\n```bash\nmkdir -p ~/.bashrc\n```\n\n**Step 3: Add the following lines to `~/.bashrc`**\n\nAdd the following lines to the `~/.bashrc` file:\n\n```bash\nexport http_proxy='http://huggingface-proxy:3128'\nexport https_proxy='http://huggingface-proxy:3128'\n```\n\nThese lines set the HTTP and HTTPS proxy settings to use the `huggingface-proxy` server", "metrics": { "length": 1022, "commands": 4, "command_list": [ "wsl --set-proxy huggingface-external https://huggingface.co", "mkdir -p ~/.bashrc", "export http_proxy='http://huggingface-proxy:3128'", "export https_proxy='http://huggingface-proxy:3128'" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 4, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL 代理Setup — 通过 Windows 梯子Access外网 (wsl-proxy-setup)", "condition": "with_lesson", "status": 200, "content": "To fix the WSL proxy setup error, you can follow these steps:\n\n**Step 1: Set up the proxy**\n\nOpen a new terminal in WSL and run the following commands to set up the proxy:\n\n```bash\nexport http_proxy=http://$(hostname).local:7890\nexport https_proxy=http://$(hostname).local:7890\nexport HTTP_PROXY=$http_proxy\nexport HTTPS_PROXY=$https_proxy\n```\n\n**Step 2: Add the proxy to `~/.bashrc`**\n\nAdd the following lines to `~/.bashrc` to make the proxy settings persistent across sessions:\n\n```bash\necho '\nexport http_proxy=http://$(hostname).local:7890\nexport https_proxy=http://$(hostname).local:7890\nexport NO_PROXY=localhost,127.0.0.1,.local\n' >> ~/.bashrc\n```\n\n**Step 3: Configure Git**\n\nSince WSL Git doesn't inherit environment variables, you need to configure Git separately:\n\n```bash\ngit config --global http.proxy http://$(hostname).local:7890\ngit config --global https.proxy http://$(hostname).local:7890\n```\n\n**Step 4: Verify the proxy setup**\n\nRun the following command to verify", "metrics": { "length": 983, "commands": 11, "command_list": [ "export http_proxy=http://$(hostname).local:7890", "export https_proxy=http://$(hostname).local:7890", "export HTTP_PROXY=$http_proxy", "export HTTPS_PROXY=$https_proxy", "echo '" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL 代理Setup — 通过 Windows 梯子Access外网 (wsl-proxy-setup)", "condition": "plain", "status": 200, "content": "The error message you're seeing is related to WSL (Windows Subsystem for Linux) proxy setup. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Update WSL and install the latest version of the wsl-proxy-setup package**\n\nOpen a new terminal and run the following commands:\n```bash\nsudo apt update\nsudo apt upgrade -y\nsudo apt install -y wsl-proxy-setup\n```\n**Step 2: Configure the proxy settings**\n\nOnce the package is installed, you'll need to configure the proxy settings. You can do this by running the following command:\n```bash\nwsl-proxy-setup --configure\n```\nThis will prompt you to enter your proxy settings. You can enter the following values:\n\n* HTTP Proxy: `http://your-proxy-server:your-port`\n* HTTPS Proxy: `https://your-proxy-server:your-port`\n\nReplace `your-proxy-server` and `your-port` with your actual proxy server and port.\n\n**Step 3: Restart WSL**\n\nAfter configuring the proxy settings, you'll need to restart WSL to apply the changes. Run the following command:\n```bash\nsudo systemctl restart wsl\n```\n**Step 4: Verify the proxy setup**\n\nOnce WSL", "metrics": { "length": 1070, "commands": 5, "command_list": [ "sudo apt update", "sudo apt upgrade -y", "sudo apt install -y wsl-proxy-setup", "wsl-proxy-setup --configure", "sudo systemctl restart wsl" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL 终端编辑Setup危险 — TTy粘贴吞下划线 (wsl-terminal-underscore-corruption)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the WSL terminal editing setup danger:\n\n**方案 A:终端设置**\n\n1. 打开 Windows Terminal。\n2. 选择设置(设置 → 交互)。\n3. 关闭“将文本格式设置为 HTML”。\n\n**方案 B:配置编辑安全**\n\n1. 打开 terminal。\n2. 使用 Python 读取和写入 `.env` 文件:\n```bash\npython\nimport json\n\n# 读取 .env 文件\nwith open('/home//.hermes/.env') as f:\n content = f.read()\n\n# 处理内容\nnew_content = content.replace('\\n', '\\n\\n') # 替换行符\n\n# 写入 .env 文件\nwith open('/home//.hermes/.env', 'w') as f:\n f.write(new_content)\n```\n**注意事项**\n\n* 必须使用 Python 读取和写入 `.env` 文件,而不是使用 `echo`、`cat` 或 `heredoc`。\n* `.env` 文件中使用 `\\n` 替换行符,而不是 `\\r\\n`。\n* 如果需要修改 `.env` 文件中的值,请使用 `replace", "metrics": { "length": 626, "commands": 7, "command_list": [ "python", "import json", "with open('/home//.hermes/.env') as f:", "content = f.read()", "new_content = content.replace('\\n', '\\n\\n') # 替换行符" ], "has_command_block": true, "actionable": false, "inline_code_count": 10, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL 终端编辑Setup危险 — TTy粘贴吞下划线 (wsl-terminal-underscore-corruption)", "condition": "plain", "status": 200, "content": "The \"WSL 终端编辑Setup危险 — TTy粘贴吞下划线\" error, also known as \"wsl-terminal-underscore-corruption\", is a known issue in Windows Subsystem for Linux (WSL). It's caused by a corrupted state of the terminal's configuration file.\n\nHere's a step-by-step fix to resolve the issue:\n\n1. **Open a new WSL terminal**: Open a new terminal window by searching for \"Windows Terminal\" in the Start menu, or by running `wsl` in the Command Prompt.\n\n2. **Run the following command to clean the configuration file**: This command will delete the corrupted configuration file and reset the terminal settings.\n ```bash\n sudo rm -rf /etc/wsl.conf.d/*\n ```\n\n3. **Update the configuration file**: After deleting the corrupted file, update the configuration file to enable the \"TTy\" paste mode.\n ```bash\n sudo nano /etc/wsl.conf\n ```\n Add the following line to the end of the file:\n ```\n [General]\n enable-pty = 1\n ```\n Then, save and exit the editor.\n\n4. **Restart the WSL terminal**: Restart the WSL terminal", "metrics": { "length": 1004, "commands": 4, "command_list": [ "sudo rm -rf /etc/wsl.conf.d/*", "sudo nano /etc/wsl.conf", "[General]", "enable-pty = 1" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 1, "lesson_hit_rate": 0.167 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wxauto 必须在 Windows Python 下安装,不能走 WSL pip (wxauto-windows-python-not-wsl)", "condition": "plain", "status": 200, "content": "The error message indicates that you're trying to install wxAuto, a GUI automation tool, but it requires a specific setup for Windows Python installations. To fix this issue, you'll need to install wxAuto using a Python environment that's compatible with Windows.\n\nHere's a step-by-step solution:\n\n**Method 1: Install wxAuto using conda (recommended)**\n\n1. Install Miniconda or Anaconda (if you haven't already) from the official website: https://docs.anaconda.com/anaconda/install/\n2. Open a new terminal or command prompt and create a new conda environment for your project:\n```bash\nconda create --name wxauto-env python=3.9\n```\n Replace `python=3.9` with the Python version you want to use.\n\n3. Activate the new environment:\n```bash\nconda activate wxauto-env\n```\n4. Install wxAuto using pip:\n```bash\npip install wxauto\n```\n\n**Method 2: Install wxAuto using pip and virtualenv (alternative)**\n\n1. Install virtualenv using pip:\n```bash\npip install virtualenv\n```\n2. Create a new virtual environment for your project:\n```bash\nvirtualenv wxauto-env\n```\n3", "metrics": { "length": 1053, "commands": 5, "command_list": [ "conda create --name wxauto-env python=3.9", "conda activate wxauto-env", "pip install wxauto", "pip install virtualenv", "virtualenv wxauto-env" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "wxauto 必须在 Windows Python 下安装,不能走 WSL pip (wxauto-windows-python-not-wsl)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fix the error:\n\n**Step 1: Close the WSL Terminal**\n\nIf you are currently in the WSL terminal, close it by pressing `Ctrl + D` or `Ctrl + Z`.\n\n**Step 2: Open Windows PowerShell or Command Prompt**\n\nOpen Windows PowerShell or Command Prompt by searching for it in the Start menu.\n\n**Step 3: Install wxauto using pip**\n\nIn Windows PowerShell or Command Prompt, run the following command to install wxauto using pip:\n```powershell\npip install wxauto requests\n```\nThis command will install wxauto and its dependencies, including requests.\n\n**Step 4: Verify the Installation**\n\nAfter installation, verify that wxauto has been installed correctly by running the following command:\n```powershell\npython -c 'import sys; print(sys.version)'\n```\nThis command will print the Python version, which should be Python 3.x.\n\n**Step 5: Verify wxauto Installation**\n\nTo verify that wxauto has been installed correctly, run the following command:\n```powershell\npython -c 'import wx; print(wx.__version__)'\n```\nThis command will print the version of wxauto, which should be a version number.\n\nThat's it! You should now", "metrics": { "length": 1128, "commands": 6, "command_list": [ "This command will install wxauto and its dependencies, including requests.", "**Step 4: Verify the Installation**", "After installation, verify that wxauto has been installed correctly by running the following command:", "This command will print the Python version, which should be Python 3.x.", "**Step 5: Verify wxauto Installation**" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Zero-Bounty Agent Competition Flywheel: Issue Design for Crawler Attraction (zero-bounty-agent-competition-flywheel)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you can create a new file in the root of your repository with the following content:\n\n```markdown\n# Issue Template (Machine-Readable)\n\nagent competition — zero-bounty\n\nNo monetary bounty. Merge earns credit.\n\nTask\n\nFix exactly one file: path/to/file.md\n\nAcceptance Criteria\n\n- [ ] Only the target file changed\n- [ ] No generated files unless explicitly requested\n- [ ] Validation passes:\n PYTHONIOENCODING=utf-8 python scripts/validate_lessons.py path/to/file.md\n\n\nPR Rules\n\nComment /claim before working. 8h claim window. Multiple PRs allowed. Smallest passing diff wins.\n\n\nLabel Strategy\n\n| Label | Purpose |\n|---|---|\n| zero-bounty | Signals no monetary reward, credit-only |\n| agent-friendly | Machine-readable AC, clear file path |\n| has-test | Includes validation command |\n| one-file | Single file scope |\n| no-credentials | No Cloudflare/GH token needed |\n| status:competition | Appears in competition\n```\n\nThen, add the following labels to your repository:\n\n```bash\n# Add labels\ngit tag -a zero-bounty-agent-competition-flywheel -m \"Initial fix for Zero-Bounty Agent Competition Flywheel", "metrics": { "length": 1115, "commands": 1, "command_list": [ "Then, add the following labels to your repository:" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Zero-Bounty Agent Competition Flywheel: Issue Design for Crawler Attraction (zero-bounty-agent-competition-flywheel)", "condition": "plain", "status": 200, "content": "I'll guide you through a potential fix for the \"Zero-Bounty Agent Competition Flywheel: Issue Design for Crawler Attraction\" error. \n\nThis error typically occurs when the Crawler Attraction section of the Zero-Bounty Agent Competition Flywheel is not properly configured, causing the flywheel to fail. Here's a step-by-step fix:\n\n**Step 1: Check the Crawler Attraction settings**\n\n1. Open the Google Ads console and navigate to the campaign where the issue is occurring.\n2. Click on the campaign name and select the \"Crawler Attraction\" tab.\n3. Verify that the \"Crawler Attraction\" settings are enabled and that the \"Crawl delay\" is set to a reasonable value (e.g., 24 hours).\n\n**Step 2: Review the Crawler Attraction design**\n\n1. Click on the \"Crawler Attraction\" settings and then click on the \"Design\" tab.\n2. Review the design for the Crawler Attraction section. Ensure that:\n\t* The design is visually appealing and consistent with the rest of the campaign.\n\t* The text and images are clear and concise.\n\t* The design is optimized for mobile devices.\n\n**Step 3: Update the Crawler Attraction design**\n\n", "metrics": { "length": 1106, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Java version mismatch causing UnsupportedClassVersionError in builds (자바-버전-불일치-빌드-오류)", "condition": "with_lesson", "status": 200, "content": "To fix the `UnsupportedClassVersionError` caused by a Java version mismatch, follow these steps:\n\n**Step 1: Verify JAVA_HOME and runtime Java**\n\nOpen a terminal and run the following commands to check the JAVA_HOME and runtime Java versions:\n\n```bash\necho $JAVA_HOME\njava -version\njavac -version\n```\n\nThis will show you the path to the JDK installation (`JAVA_HOME`) and the versions of Java and javac installed on your system.\n\n**Step 2: Set the Maven compiler settings in pom.xml**\n\nOpen your `pom.xml` file in a text editor and verify that the `maven.compiler.source` and `maven.compiler.target` settings match your runtime JVM version.\n\nFor example, if your runtime JVM version is 17, update the `pom.xml` file as follows:\n\n```xml\n\n 17\n 17\n\n```\n\n**Step 3: Update the Java compiler options**\n\nIf you're using Gradle, update the `java` options in your `build.gradle` file to match the runtime JVM version:\n\n```groovy\njavaOptions = ['--source', '", "metrics": { "length": 1072, "commands": 5, "command_list": [ "echo $JAVA_HOME", "java -version", "javac -version", "**Step 3: Update the Java compiler options**", "If you're using Gradle, update the `java` options in your `build.gradle` file to match the runtime JVM version:" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 6, "lesson_hit_rate": 1.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Java version mismatch causing UnsupportedClassVersionError in builds (자바-버전-불일치-빌드-오류)", "condition": "plain", "status": 200, "content": "The Java version mismatch error occurs when the Java version used to compile your code is different from the Java version used to run your code. This can cause issues with class compatibility and lead to errors like `UnsupportedClassVersionError`.\n\nHere's a step-by-step guide to fix the Java version mismatch error:\n\n**Step 1: Check the Java versions**\n\nOpen a terminal or command prompt and run the following commands to check the Java versions installed on your system:\n\n```bash\n# For macOS (using Homebrew)\njava -version\n\n# For Linux\njava -version\n\n# For Windows\njava -version\n```\n\n**Step 2: Verify the Java version used in your build process**\n\nCheck your `pom.xml` file (if you're using Maven) or your `build.gradle` file (if you're using Gradle) to see which Java version is being used for compilation:\n\n```xml\n\n\n \n \n org.apache.maven.plugins\n maven-compiler-plugin\n 3.8.1\n \n 1.8\n 1", "metrics": { "length": 1124, "commands": 3, "command_list": [ "java -version", "java -version", "java -version" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 4, "lesson_hit_rate": 0.667 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cronjob One-Shot Race Condition - Duplicate Execution (cronjob-one-shot-race-condition-duplicate-execution)", "condition": "with_lesson", "status": 200, "content": "To fix the cron job one-shot race condition, you need to add a lock to prevent multiple gateway threads from executing the job at the same time. Here's a step-by-step guide with exact commands:\n\n**Step 1: Install the required package**\n\nYou'll need to install the `threading` package, which is part of the Python standard library. However, if you're using a virtual environment, make sure it's installed.\n\n```bash\n# If you're using a virtual environment\npip install --upgrade threading\n```\n\n**Step 2: Modify the scheduler.py file**\n\nAdd a lock to the `scheduler.py` file to prevent multiple gateway threads from executing the job at the same time. Here's the modified code:\n\n```python\nimport threading\nimport time\n\nclass Scheduler:\n def __init__(self):\n self._tick_thread_lock = threading.Lock()\n\n def tick(self):\n with self._tick_thread_lock:\n # Your existing code here\n pass\n\n def mark_job_run(self, job_id):\n with self._tick_thread_lock:\n # Your existing code here\n pass\n```\n\n**Step 3: Remove cron-tick.sh from crontab**\n\nRemove the cron job that triggers the `cron-t", "metrics": { "length": 1144, "commands": 1, "command_list": [ "pip install --upgrade threading" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cronjob One-Shot Race Condition - Duplicate Execution (cronjob-one-shot-race-condition-duplicate-execution)", "condition": "plain", "status": 200, "content": "The Cronjob One-Shot Race Condition - Duplicate Execution error occurs when a cron job is executed multiple times in a short period of time, potentially leading to duplicate or unexpected behavior. Here's a concrete, actionable fix with exact commands:\n\n**Fix:**\n\n1. **Check the cron table**: Verify that the cron job is not set to run too frequently. You can do this by running the following command:\n ```bash\ncrontab -l\n```\n Look for the cron job that's causing the issue and note its minute, hour, day, month, and day of the week.\n\n2. **Set the cron job to run at a specific time**: If the cron job is set to run at a specific time, you can try setting it to run at a specific minute to prevent duplicates. For example:\n ```bash\ncrontab -e\n```\n Add the following line to the end of the file:\n ```\n0 0 * * * your_command_here\n```\n Replace `your_command_here` with the actual command you want to run.\n\n3. **Add a delay**: If you need the cron job to run at a specific time but don't want it to run too frequently, you can add a delay using", "metrics": { "length": 1052, "commands": 3, "command_list": [ "crontab -l", "crontab -e", "0 0 * * * your_command_here" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DCO Auto-Fix Workflow — /fix-dco Command Design & Implementation (dco-auto-fix-workflow)", "condition": "with_lesson", "status": 200, "content": "以下是解决DCO Auto-Fix Workflow — /fix-dco Command Design & Implementation (dco-auto-fix-workflow)错误的具体步骤和命令:\n\n**步骤 1:检查并修复 DCO 检查**\n\n使用以下命令检查 DCO 检查是否通过:\n```bash\npre-commit run --all-checks\n```\n如果 DCO 检查失败,使用以下命令修复 DCO 检查:\n```bash\ngit rebase --signoff\npre-commit run --all-checks\n```\n**步骤 2:创建独立仓库**\n\n使用以下命令创建独立仓库:\n```bash\ngit clone https://github.com/your-username/your-repo.git\ncd your-repo\ngit remote add origin https://github.com/your-username/your-repo.git\ngit push -u origin --all --delete\ngit push -u origin --tags\n```\n**步骤 3:提取核心资产**\n\n使用以下命令提取核心资产:\n```bash\ngit ls-files .pre-commit-hooks.yaml setup.cfg setup.py check_dco.py tests/ | xargs git add\ngit commit -m \"提取核心资产\"\n``", "metrics": { "length": 677, "commands": 8, "command_list": [ "pre-commit run --all-checks", "git rebase --signoff", "pre-commit run --all-checks", "git clone https://github.com/your-username/your-repo.git", "cd your-repo" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DCO Auto-Fix Workflow — /fix-dco Command Design & Implementation (dco-auto-fix-workflow)", "condition": "plain", "status": 200, "content": "The error message you're seeing is likely due to a DCO (Data Center Operations) issue that's causing the workflow to fail. Here's a step-by-step fix to resolve the issue using the `/fix-dco` command:\n\n**Step 1: Check the DCO status**\n\n Run the following command to check the current DCO status:\n```bash\ndco status\n```\nThis will display the current DCO status, including any errors or warnings.\n\n**Step 2: Run the `/fix-dco` command**\n\n Run the following command to attempt to fix the DCO issue:\n```bash\ndco auto-fix /fix-dco\n```\nThis command will scan your system for any DCO-related issues and attempt to fix them.\n\n**Step 3: Verify the fix**\n\n Run the following command to verify that the fix was successful:\n```bash\ndco status\n```\nThis should display a success message indicating that the DCO issue has been resolved.\n\n**Step 4: Check for any remaining errors**\n\n Run the following command to check for any remaining errors:\n```bash\ndco error\n```\nThis will display a list of any remaining errors that were not resolved by the `/fix-dco` command.\n\n**Step 5", "metrics": { "length": 1058, "commands": 4, "command_list": [ "dco status", "dco auto-fix /fix-dco", "dco status", "dco error" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FReeLLMAPI Session Context Mixing - Cross-Thread Delivery (freellmapi-session-context-mixing-cross-thread-delivery)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the FreeLLM API session context mixing issue, which can cause problems when using the FreeLLM API across multiple threads. To fix this issue, you can try the following steps:\n\n**Step 1: Disable Cross-Thread Delivery**\n\nYou can disable cross-thread delivery by setting the `FREELLM_API DisableCrossThreadDelivery` environment variable to `1`. Here's how you can do it:\n\n```bash\nexport FREELLM_API DisableCrossThreadDelivery=1\n```\n\n**Step 2: Update FreeLLM API Version**\n\nMake sure you're using the latest version of the FreeLLM API. You can update to the latest version using the following command:\n\n```bash\npip install --upgrade free_llm\n```\n\n**Step 3: Use a Thread-Safe Session**\n\nTo avoid the issue altogether, you can create a new session for each thread. Here's an example of how you can do it in Python:\n\n```python\nimport threading\n\ndef get_session():\n # Create a new session\n session = free_llm.Session()\n return session\n\ndef process_text(session, text):\n # Process the text using the session\n response = session.process(text)\n # Do something with", "metrics": { "length": 1115, "commands": 2, "command_list": [ "export FREELLM_API DisableCrossThreadDelivery=1", "pip install --upgrade free_llm" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Hermes State Database Lock Issues - Cleanup Protocol (hermes-state-database-lock-issues-cleanup-protocol)", "condition": "with_lesson", "status": 200, "content": "To fix the Hermes State Database Lock Issues, follow these steps:\n\n**Step 1: Restart the Hermes Gateway Service**\n\n```bash\n# On Ubuntu/Debian-based systems\nsudo systemctl restart hermes-gateway.service\n\n# On Red Hat/CentOS-based systems\nsudo systemctl restart hermes-gateway\n\n# On macOS (using Homebrew)\nbrew services restart hermes-gateway\n```\n\n**Step 2: Run PRAGMA wal_checkpoint(TRUNCATE)**\n\n```bash\n# Open a new terminal window (or use `nohup` to run in the background)\n# On Ubuntu/Debian-based systems\nsudo -u $USER sqlite3 /path/to/state.db \"PRAGMA wal_checkpoint(TRUNCATE)\"\n\n# On Red Hat/CentOS-based systems\nsudo sqlite3 /path/to/state.db \"PRAGMA wal_checkpoint(TRUNCATE)\"\n\n# On macOS (using Homebrew)\nsudo -u $USER /usr/local/bin/sqlite3 /path/to/state.db \"PRAGMA wal_checkpoint(TRUNCATE)\"\n```\n\nReplace `/path/to/state.db` with the actual path to your `state.db` file.\n\n**Step 3: Cleanup Corrupted Files**\n\n```bash\n# Delete corrupted backups\nfind /path/to/state.db -", "metrics": { "length": 975, "commands": 6, "command_list": [ "sudo systemctl restart hermes-gateway.service", "sudo systemctl restart hermes-gateway", "brew services restart hermes-gateway", "sudo -u $USER sqlite3 /path/to/state.db \"PRAGMA wal_checkpoint(TRUNCATE)\"", "sudo sqlite3 /path/to/state.db \"PRAGMA wal_checkpoint(TRUNCATE)\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FReeLLMAPI Session Context Mixing - Cross-Thread Delivery (freellmapi-session-context-mixing-cross-thread-delivery)", "condition": "with_lesson", "status": 200, "content": "To fix the `FREELLMAPI Session Context Mixing - Cross-Thread Delivery` error, you'll need to distribute threads across `freellmapi` instances with stable models and reduce retries by pre-validating provider health before session start. Here's a step-by-step guide with exact commands:\n\n**Step 1: Update `freellmapi` configuration**\n\nOpen the `freellmapi` configuration file (usually `freellmapi.yaml` or `freellmapi.json`) and update the `threads` section to distribute threads across multiple instances:\n```yaml\nthreads:\n - model: deepseek-v4-flash-free\n port: 3001\n - model: deepseek-v4-flash-free\n port: 3002\n - model: deepseek-v4-flash-free\n port: 3003\n```\nReplace `3001`, `3002`, and `3003` with the available ports on your system.\n\n**Step 2: Pre-validate provider health**\n\nCreate a script (e.g., `validate_provider_health.py`) to pre-validate the health of each `freellmapi` instance before starting a session:\n```python\nimport requests\n\ndef validate_provider_health(port):\n url =", "metrics": { "length": 1002, "commands": 3, "command_list": [ "Replace `3001`, `3002`, and `3003` with the available ports on your system.", "**Step 2: Pre-validate provider health**", "Create a script (e.g., `validate_provider_health.py`) to pre-validate the health of each `freellmapi` instance before starting a session:" ], "has_command_block": true, "actionable": false, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Hermes State Database Lock Issues - Cleanup Protocol (hermes-state-database-lock-issues-cleanup-protocol)", "condition": "plain", "status": 200, "content": "The error you're encountering, \"Hermes State Database Lock Issues - Cleanup Protocol,\" typically occurs when the Hermes state database is locked, preventing the application from functioning correctly. Here's a step-by-step guide to resolve the issue:\n\n**Prerequisites:**\n\n1. Make sure you have the latest version of the Hermes framework installed.\n2. Ensure that you have the necessary permissions to run the commands.\n\n**Step 1: Check for locked transactions**\n\nRun the following command to check for any locked transactions:\n\n```bash\nhermesctl get transactions --status=locked\n```\n\nThis command will list all transactions that are currently locked.\n\n**Step 2: Release locked transactions**\n\nRun the following command to release the locked transactions:\n\n```bash\nhermesctl release-transaction \n```\n\nReplace `` with the actual ID of the locked transaction. You can obtain the transaction ID from the previous command.\n\n**Step 3: Check for pending transactions**\n\nRun the following command to check for any pending transactions:\n\n```bash\nhermesctl get transactions --status=pending\n```\n\nThis command will list all transactions that are currently pending.\n\n**Step 4: Cancel pending transactions**\n\nRun the following command to cancel the pending transactions:\n\n```bash\n", "metrics": { "length": 1299, "commands": 3, "command_list": [ "hermesctl get transactions --status=locked", "hermesctl release-transaction ", "hermesctl get transactions --status=pending" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Cleanup SOP — Stale/Duplicate/Resolved PR Disposition (pr-cleanup-sop)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix with exact commands to address the PR Cleanup SOP issue:\n\n**Step 1: Automate Stale PR Cleanup**\n\nCreate a GitHub Actions workflow file (e.g., `.github/workflows/pr-cleanup.yml`) with the following content:\n```yaml\nname: PR Cleanup\n\non:\n schedule:\n - cron: 0 0 * * *\n\njobs:\n cleanup:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v2\n - name: Run PR cleanup script\n run: |\n curl -X GET \\\n https://api.github.com/repos/$GITHUB_REPOSITORY/pulls \\\n -H 'Authorization: Bearer $GITHUB_TOKEN' \\\n -H 'Content-Type: application/json' \\\n | jq '.[] | select(.state == \"open\") | .id' \\\n | xargs -I {} curl -X DELETE \\\n https://api.github.com/repos/$GITHUB_REPOSITORY/pulls/${{}}\n```\nThis workflow will run daily at midnight and automatically close stale PRs (i.e., PRs that haven't been updated in 21 days).\n\n**Step 2: Automate Duplicate", "metrics": { "length": 1003, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Cleanup SOP — Stale/Duplicate/Resolved PR Disposition (pr-cleanup-sop)", "condition": "plain", "status": 200, "content": "The error message you're encountering is likely due to a stale or duplicate pull request (PR) in your GitHub repository. Here's a step-by-step guide to fix this issue using the Git command-line interface:\n\n**Step 1: Remove stale PRs**\n\nTo remove stale PRs, you can use the `git push` command with the `--delete` option. This will delete all stale PRs from the remote repository.\n\n```bash\ngit push --delete origin \n```\n\nReplace `` with the name of the branch where the stale PRs are located.\n\n**Step 2: Remove duplicate PRs**\n\nTo remove duplicate PRs, you can use the `git merge` command with the `--no-ff` option. This will create a new merge commit that combines the duplicate PRs into a single commit.\n\n```bash\ngit merge --no-ff \n```\n\nReplace `` with the name of the branch where the duplicate PRs are located.\n\n**Step 3: Resolve PR dispositions**\n\nTo resolve PR dispositions, you can use the `git push` command with the `--force` option. This will force-push the updated branch to the remote repository, which will update the", "metrics": { "length": 1080, "commands": 2, "command_list": [ "git push --delete origin ", "git merge --no-ff " ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Welcome Not Triggering — author_association NONE vs FIRST_TIMER Trap (pull-request-welcome-trigger-trap)", "condition": "plain", "status": 200, "content": "The error you're experiencing is due to a conflict between the `author_association` setting and the `first-timer` trigger in a GitHub repository. Here's a step-by-step solution to resolve the issue:\n\n**Step 1: Check the `author_association` setting**\n\nRun the following command to check the current `author_association` setting:\n```bash\ngit config --get author_association\n```\nIf the output is `NONE`, update it to `FIRST_TIMER`:\n```bash\ngit config author_association FIRST_TIMER\n```\n\n**Step 2: Delete the existing pull request welcome trigger**\n\nRun the following command to delete the existing pull request welcome trigger:\n```bash\ngit config --delete pull-request.welcome.trigger\n```\n\n**Step 3: Create a new pull request welcome trigger**\n\nRun the following command to create a new pull request welcome trigger with the `author_association` setting:\n```bash\ngit config --add pull-request.welcome.trigger 'if (author_association == \"FIRST_TIMER\") then true else false'\n```\n\n**Verify the changes**\n\nRun the following command to verify the changes:\n```bash\ngit config --list\n```\nThis should display the updated `author_association` setting and the new", "metrics": { "length": 1151, "commands": 5, "command_list": [ "git config --get author_association", "git config author_association FIRST_TIMER", "git config --delete pull-request.welcome.trigger", "git config --add pull-request.welcome.trigger 'if (author_association == \"FIRST_TIMER\") then true else false'", "git config --list" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "एजेंट त्रुटि हैंडलिंग — पुनर्प्रयास और फॉलबैक पैटर्न (agent-error-handling-hi)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing is due to the AI agent failing to handle errors properly. To fix this, we need to implement a three-tiered error handling mechanism that includes retries and fallbacks.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Install the required libraries**\n\nOpen your terminal and run the following command to install the required libraries:\n```bash\npip install asyncio\n```\n**Step 2: Create a new Python file**\n\nCreate a new Python file called `resilient_calls.py` and add the following code:\n```python\nimport asyncio\nfrom typing import Optional\n\nasync def resilient_call(func, args, max_retries=3, fallback=None):\n \"\"\"Punish and fallback call with retries.\"\"\"\n last_error = None\n \n for attempt in range(max_retries):\n try:\n return await func(args)\n except Exception as e:\n last_error = e\n if attempt < max_retries - 1:\n # Exponential backoff\n wait_time = 2 ** attempt\n await asyncio.sleep(wait_time)\n \n # All attempts failed - use fallback\n if fallback:\n return await fallback(args)\n \n raise last_error\n\n# Example usage:\nasync def example_function", "metrics": { "length": 1216, "commands": 1, "command_list": [ "pip install asyncio" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "PR Welcome Not Triggering — author_association NONE vs FIRST_TIMER Trap (pull-request-welcome-trigger-trap)", "condition": "with_lesson", "status": 200, "content": "以下是解决 PR Welcome Not Triggering — author_association NONE vs FIRST_TIMER Trap 的具体步骤:\n\n**步骤 1:创建一个测试仓库**\n\n```bash\ngit clone https://github.com/username/repository.git\ncd repository\ngit init\n```\n\n**步骤 2:创建 pr-welcome.yml**\n\n```yaml\nname: Pull Request Welcome\non:\n pull_request:\n types: [opened]\n events: [opened]\n branches:\n - main\njobs:\n welcome:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n - name: Run welcome script\n run: |\n echo \"Welcome to our repository!\"\n echo \"Please review the changes and leave a comment.\"\n```\n\n**步骤 3:在 pr-welcome.yml 中添加 fix**\n\n```yaml\nif: contains(fromJSON('[\"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"NONE\"]'),\n github.event.pull_request.author_association)\n\njobs:\n welcome:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout code\n uses: actions/checkout@v3\n ", "metrics": { "length": 915, "commands": 4, "command_list": [ "git clone https://github.com/username/repository.git", "cd repository", "git init", "**步骤 3:在 pr-welcome.yml 中添加 fix**" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "एजेंट त्रुटि हैंडलिंग — पुनर्प्रयास और फॉलबैक पैटर्न (agent-error-handling-hi)", "condition": "plain", "status": 200, "content": "The error message you're encountering is related to an agent error handling issue, specifically with the retry and fallback pattern. Here's a step-by-step solution to resolve the issue:\n\n**Error Message Analysis:**\n\nThe error message suggests that there's an issue with the agent's error handling mechanism, which is preventing it from recovering from errors and implementing the retry and fallback pattern.\n\n**Solution:**\n\nTo fix the issue, you can try the following steps:\n\n1. **Check the Agent Configuration:**\n - Open your agent configuration file (e.g., `agent.json` or `agent.yaml`) in a text editor.\n - Look for the `error_handling` section and verify that the `retry` and `fallback` settings are properly configured.\n\n2. **Update the Error Handling Configuration:**\n - If the `retry` and `fallback` settings are not configured, add them to the `error_handling` section.\n - For example, if you're using the `agent.json` file, update it as follows:\n ```json\n{\n \"error_handling\": {\n \"retry\": {\n \"max_retries\": 3,\n \"retry_delay\": 500\n },\n \"fallback\": {\n \"strategy\": \"default\",\n \"", "metrics": { "length": 1125, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent 手动Update步骤(update Timeout Handling) (agent-manual-update-timeout)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"Agent 手动Update步骤(update Timeout Handling) (agent-manual-update-timeout)\", you need to follow these steps:\n\n1. Check the current version of the Agent:\n```bash\n/-latest.tar.gz\n```\n\n3. Manually install the Agent:\n```bash\ntar -xzf -latest.tar.gz\ncp /usr/local/bin/\n```\n\n4. Clean up old cache:\n```bash\nrm -rf ~/./cache/\n```\n\n5. Verify the installation:\n```bash\n`, ``, and `-latest.tar.gz` with the actual values for your Agent version.\n\nHere is the complete command sequence:\n\n```bash\n# Check current version\n/-latest.tar.gz", "tar -xzf -latest.tar.gz", "cp /usr/local/bin/", "rm -rf ~/./cache/" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Memory Extractor Timing — Eager vs Lazy with Implementation (agent-memory-extractor-timing)", "condition": "plain", "status": 200, "content": "To fix the \"Agent Memory Extractor Timing — Eager vs Lazy with Implementation\" error, you can try the following steps:\n\n**Step 1: Check the Agent Implementation**\n\n Ensure that the agent implementation is correct and does not contain any memory leaks or inefficient memory usage. You can use the `agent` command to check the agent implementation:\n```bash\nagent --help\n```\nThis will display the available commands and options for the agent.\n\n**Step 2: Verify the Agent Configuration**\n\n Check the agent configuration file (usually `agent.conf` or `agent.properties`) to ensure that it is correctly configured. Verify that the agent is set to extract memory at the correct intervals and that the memory extraction is not too aggressive.\n\n**Step 3: Use the `--verbose` Option**\n\n Run the agent with the `--verbose` option to increase the logging level and gather more information about the memory extraction process:\n```bash\nagent --verbose --help\n```\nThis will display more detailed logs and help you identify the source of the issue.\n\n**Step 4: Check for Memory Leaks**\n\n Use tools like `valgrind` or ` AddressSanitizer` to detect memory leaks in your application:\n```bash\nvalgrind --tool=memcheck", "metrics": { "length": 1196, "commands": 2, "command_list": [ "agent --help", "agent --verbose --help" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Memory Extractor Timing — Eager vs Lazy with Implementation (agent-memory-extractor-timing)", "condition": "with_lesson", "status": 200, "content": "The error message you're seeing is related to the `should_extract` function not having a return statement. Here's a fixed version of your code with a return statement added:\n\n```python\nimport re\n\nHIGH_DENSITY_PATTERNS = [\n r\"(?i)(prefer|like|always|never|remember that|my .+ is)\",\n r\"(?i)(fix|solve|workaround|the issue was|root cause)\",\n r\"(?i)(decision|chose|picked|going with|locked in)\",\n]\n\nLOW_DENSITY_PATTERNS = [\n r\"(?i)^(hi|hello|thanks|ok|sure|got it|yes|no)\\s[.!?]?$\",\n r\"(?i)^(lol|haha|nice|cool|great)\\s[.!?]?$\",\n]\n\ndef should_extract(message: str) -> bool:\n for pattern in HIGH_DENSITY_PATTERNS:\n if re.search(pattern, message):\n return True # Added return statement here\n for pattern in LOW_DENSITY_PATTERNS:\n if re.search(pattern, message):\n return True # Added return statement here\n return False # Return False if no pattern is found\n\n", "metrics": { "length": 915, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent 手动Update步骤(update Timeout Handling) (agent-manual-update-timeout)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the \"Agent 手动Update步骤(update Timeout Handling)\" issue, which is typically a problem with the update timeout handling in an agent. Here's a step-by-step guide to help you resolve this issue:\n\n**Step 1: Check the agent logs**\n\nTo diagnose the issue, check the agent logs for any errors or warnings related to the update timeout handling. You can do this by running the following command:\n\n```\nagent logs\n```\n\nThis will display a list of recent log entries. Look for any errors or warnings that mention \"update timeout\" or \"Agent 手动Update步骤\".\n\n**Step 2: Check the agent configuration**\n\nVerify that the agent configuration is set up correctly. Check the `agent.conf` file (or the equivalent configuration file for your agent) to ensure that the `update_timeout` setting is set to a reasonable value. You can use the following command to check the configuration:\n\n```\nagent config update_timeout\n```\n\nIf the value is not set, you can set it using the following command:\n\n```\nagent config update_timeout \n```\n\nReplace `` with the desired timeout value in seconds.\n\n**Step 3: Adjust the update timeout**\n\nIf", "metrics": { "length": 1159, "commands": 3, "command_list": [ "agent logs", "agent config update_timeout", "agent config update_timeout " ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Memory Three-Index Architecture on Elasticsearch (agent-memory-three-index-architecture)", "condition": "with_lesson", "status": 200, "content": "To address the Agent Memory Three-Index Architecture issue, you need to implement three separate indices in Elasticsearch, each for episodic events, semantic facts, and procedural playbooks. Here's a step-by-step guide:\n\n**Step 1: Create three separate indices in Elasticsearch**\n\n```bash\n# Create an index for episodic events\necho \"Creating index for episodic events\"\necho | elasticsearch -E \"put /episodic_events\"\n\n# Create an index for semantic facts\necho \"Creating index for semantic facts\"\necho | elasticsearch -E \"put /semantic_facts\"\n\n# Create an index for procedural playbooks\necho \"Creating index for procedural playbooks\"\necho | elasticsearch -E \"put /procedural_playbooks\"\n```\n\n**Step 2: Configure the mapping for each index**\n\nCreate a mapping for each index to define the fields and their types:\n\n```json\n# Episodic events mapping\necho \"Episodic events mapping\"\necho |\ncurl -XPOST 'http://localhost:9200/episodic_events/_mapping' -H 'Content-Type: application/json' -d '\n{\n \"properties\": {\n \"id\": {\"type\": \"keyword\"},\n \"text\": {\"type\": \"text", "metrics": { "length": 1061, "commands": 6, "command_list": [ "echo \"Creating index for episodic events\"", "echo | elasticsearch -E \"put /episodic_events\"", "echo \"Creating index for semantic facts\"", "echo | elasticsearch -E \"put /semantic_facts\"", "echo \"Creating index for procedural playbooks\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent Memory Three-Index Architecture on Elasticsearch (agent-memory-three-index-architecture)", "condition": "plain", "status": 200, "content": "The \"Agent Memory Three-Index Architecture\" error typically occurs when the Elasticsearch agent is unable to store data in its memory index. This error can be fixed by adjusting the configuration of the Elasticsearch agent. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Check the Elasticsearch Agent Configuration**\n\n1. Open the Elasticsearch agent configuration file in a text editor. The location of this file varies depending on the operating system and Elasticsearch agent version. For example:\n - On Linux: `sudo nano /etc/elasticsearch-agent.yml` or `sudo nano /usr/local/etc/elasticsearch-agent.yml`\n - On Windows: `type %ProgramFiles%\\Elasticsearch\\elasticsearch-agent.yml` (assuming you installed Elasticsearch in the default location)\n\n2. Look for the `memory_index` section and verify that the `enabled` property is set to `true`. If it's set to `false`, update it to `true`.\n\n**Step 2: Adjust the Number of Indices**\n\n1. In the same configuration file, find the `indices` section.\n2. Update the `num_indices` property to a higher value. For example:\n ```yml\nindices:\n num_indices: 10\n```\n This will increase the number of", "metrics": { "length": 1157, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent State Database Lock Issues — Cleanup Protocol (agent-state-database-lock-cleanup)", "condition": "with_lesson", "status": 200, "content": "To fix the \"Agent State Database Lock Issues — Cleanup Protocol\" error, follow these steps:\n\n**Step 1: Identify lock files**\n\nBefore running any commands, you need to identify the lock files associated with your agent. You can do this by checking the `.agent` directory in your home directory.\n\n```bash\nls -la ~/.agent/\n```\n\nThis command will list all the files and directories within the `.agent` directory.\n\n**Step 2: Remove lock artifacts**\n\nTo remove the lock artifacts, follow these steps:\n\n1. Stop the agent first:\n```bash\n\n```\n Replace `` with the actual name of your agent service (e.g., `consul` or `etcd`).\n\n2. **Delete the agent state database lock file:**\n ```bash\nsudo rm /var/lib//state.db-wal\n```\n Replace `` with the actual name of your agent service (e.g., `consul` or `etcd`).\n\n3. **Remove the agent state database lock file:**\n ```bash\nsudo rm /var/lib//state.db-shm\n```\n Replace `` with the actual name of your agent service (e.g., `consul` or `etcd`).\n\n4. **Restart the agent service:**\n ```bash\nsudo systemctl restart \n```\n Replace `` with the actual name of your agent service", "metrics": { "length": 1014, "commands": 4, "command_list": [ "sudo systemctl stop ", "sudo rm /var/lib//state.db-wal", "sudo rm /var/lib//state.db-shm", "sudo systemctl restart " ], "has_command_block": true, "actionable": true, "inline_code_count": 17, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AI Agent Project Outreach Guide (ai-agent-project-outreach-guide)", "condition": "plain", "status": 200, "content": "I'd be happy to help you troubleshoot the issue. However, I don't see any error message provided. Can you please provide the exact error message you're seeing, and I'll do my best to give you a concrete and actionable fix with exact commands?", "metrics": { "length": 242, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AI Agent Project Outreach Guide (ai-agent-project-outreach-guide)", "condition": "with_lesson", "status": 200, "content": "根据问题描述,似乎是由于GitHub API token的读取问题。问题出在读取token文件中时。下面提供一个解决方案:\n\n**解决方案**\n\n1. **查找token文件路径**\n\n * 通过下面命令找到token文件的路径:\n\n ```bash\ncat /home/.git-credentials\n```\n\n 或者:\n\n ```bash\nls /home/.git-credentials\n```\n\n 该文件路径将显示在输出中。\n\n2. **解决token文件路径问题**\n\n * 如果token文件路径不正确,请将token文件路径改为正确的路径。\n\n ```bash\nTOKEN_FILE=/home/your_username/.git-credentials\n```\n\n 请将`your_username`替换为实际的用户名。\n\n3. **修复读取token文件的代码**\n\n * 由于token文件可能包含多个token,下面提供一个修复代码:\n\n ```python\nimport urllib.request, json, base64\n\nTOKEN_FILE = '/home/.git-credentials'\n\n# 读取token文件\nwith open(TOKEN_FILE) as f:\n lines = f.readlines()\n\n# 读取第一个token\ntoken = lines", "metrics": { "length": 652, "commands": 3, "command_list": [ "cat /home/.git-credentials", "ls /home/.git-credentials", "TOKEN_FILE=/home/your_username/.git-credentials" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "aily feishu mcp pull only (aily-feishu-mcp-pull-only)", "condition": "with_lesson", "status": 200, "content": "The error message indicates that the `aily-feishu-mcp-pull-only` job is failing because the `aily` platform only supports being called by an external MCP server, but not being called by another server.\n\nTo fix this issue, you need to modify the `aily-feishu-mcp-pull-only` job to use a \"轮询拉取模式\" (polling mode) instead of expecting to be pushed to by the Hub. Here's a concrete, actionable fix:\n\n**Step 1: Update the `aily-feishu-mcp-pull-only` job to use polling mode**\n\nRun the following command to update the job:\n```bash\ncurl -X PATCH \\\n https://your-ailymcp-instance.com/jobs/aily-feishu-mcp-pull-only \\\n -H 'Content-Type: application/json' \\\n -d '{\"mode\": \"polling\"}'\n```\nReplace `your-ailymcp-instance.com` with your actual Aily MCP instance URL.\n\n**Step 2: Verify the job configuration**\n\nRun the following command to verify the job configuration:\n```bash\ncurl -X GET \\\n https://your-ailymcp-instance.com/jobs/aily-feishu-mcp-pull", "metrics": { "length": 941, "commands": 4, "command_list": [ "curl -X PATCH \\", "https://your-ailymcp-instance.com/jobs/aily-feishu-mcp-pull-only \\", "-H 'Content-Type: application/json' \\", "-d '{\"mode\": \"polling\"}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Bounty Contributors Are Not Always Users (bounty-contributors-are-not-always-users)", "condition": "plain", "status": 200, "content": "The error \"Bounty Contributors Are Not Always Users\" is typically raised by GitHub when there are contributors in a repository who are not also users of the repository. This can happen when a contributor has a GitHub account, but it's not linked to the repository.\n\nTo fix this issue, you can try the following steps:\n\n1. **Check if the contributor has a GitHub account:** Run the following command in your terminal:\n```\ngithub contributors --filter=contributors --filter=not-users --repo /\n```\nReplace `` and `` with the actual owner and name of your repository.\n\n2. **Link the contributor's GitHub account to the repository:** Run the following command in your terminal:\n```\ngithub link --filter=contributors --filter=not-users --repo /\n```\nAgain, replace `` and `` with the actual owner and name of your repository.\n\n3. **Verify the link:** Run the following command in your terminal:\n```\ngithub link --filter=contributors --filter=not-users --repo /\n```\nThis should display the linked GitHub account for the contributors.\n\nIf you're still facing issues, you can try the", "metrics": { "length": 1248, "commands": 3, "command_list": [ "github contributors --filter=contributors --filter=not-users --repo /", "github link --filter=contributors --filter=not-users --repo /", "github link --filter=contributors --filter=not-users --repo /" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Bounty Contributors Are Not Always Users (bounty-contributors-are-not-always-users)", "condition": "with_lesson", "status": 200, "content": "The error \"Bounty Contributors Are Not Always Users\" indicates that the contributors who submitted pull requests for bounty tasks may not be users of the product, knowledge base, or community. This is because the contributors may have only worked on the task without engaging with the product or knowledge base.\n\nHere are some steps you can take to fix this issue:\n\n1. **Track separate metrics**: As suggested in the solution, track separate metrics to measure the usefulness of the contributors. These metrics include:\n - `PR merged`: This metric tracks when a pull request is merged.\n - `Repeat contributor`: This metric tracks if the contributor is coming back for more work.\n - `Lesson cited in PR`: This metric tracks if the contributor has cited a lesson or documentation in their pull request.\n - `Feedback issue`: This metric tracks if the contributor has engaged with the knowledge base.\n - `Helpful vote`: This metric tracks if the contributor has provided a helpful vote.\n\n2. **Ask for signal, not more work**: After a pull request is merged, ask for a simple signal, such as a yes/no answer to a question like \"Did any lesson, doc, or search result help while working on this PR?\" This shows that you value the contributor's feedback and", "metrics": { "length": 1259, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "aily feishu mcp pull only (aily-feishu-mcp-pull-only)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a conflict between two Kubernetes deployments or a similar issue. To resolve this, you can try the following steps:\n\n1. **Check the current deployment status**: Run the following command to check the current deployment status:\n\n```bash\nkubectl get deployments -o wide\n```\n\n2. **Check the pod status**: Run the following command to check the pod status:\n\n```bash\nkubectl get pods -o wide\n```\n\n3. **Delete the pods**: If the pods are stuck in a pending state, you can try deleting them and letting Kubernetes recreate them:\n\n```bash\nkubectl delete pods -l aily-feishu-mcp-pull-only=true\n```\n\n4. **Update the deployment**: Run the following command to update the deployment:\n\n```bash\nkubectl rollout restart deployment aily-feishu-mcp-pull-only\n```\n\n5. **Verify the deployment status**: Run the following command to verify the deployment status:\n\n```bash\nkubectl get deployments -o wide\n```\n\nIf the issue persists, you can try to roll back to a previous version of the deployment:\n\n```bash\nkubectl rollout undo deployment aily-feishu-mcp-pull-only\n```\n\nPlease note that these commands are for a", "metrics": { "length": 1138, "commands": 6, "command_list": [ "kubectl get deployments -o wide", "kubectl get pods -o wide", "kubectl delete pods -l aily-feishu-mcp-pull-only=true", "kubectl rollout restart deployment aily-feishu-mcp-pull-only", "kubectl get deployments -o wide" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "browser-harness — AI 直连 Chrome 的 CDP 浏览器Automation (browser-harness-cdp-browser-automation)", "condition": "with_lesson", "status": 200, "content": "根据给出的错误信息和解决方案,问题可能出在 `browser-harness` 的版本中,没有 `browser-harness-cdp-browser-automation` 类。正确的解决方案是使用 `browser-harness` CLI。\n\n以下是具体的解决方案和命令:\n\n1. 安装 `browser-harness`:\n ```bash\ngit clone https://github.com/browser-use/browser-harness ~/Developer/browser-harness\ncd ~/Developer/browser-harness\nuv venv .venv && source .venv/bin/activate\nuv pip install -e .\n```\n2. 连接 Chrome:\n - 如果使用 OpenClaw 自带的 Chromium:\n ```bash\nBU_CDP_URL=http://127.0.0.1:18800\n```\n - 如果使用 Windows Chrome:\n ```bash\nBU_CDP_URL=http://127.0.0.1:9222\n```\n3. 运行 `browser-harness` CLI:\n ```bash\nbrowser-harness --target https://www.example.com\n```\n 这将启动一个 Chrome 浏览器,访问给定的 URL。\n\n如果您需要使用 `browser-harness-cdp-browser-automation` 类,可能需要", "metrics": { "length": 734, "commands": 7, "command_list": [ "git clone https://github.com/browser-use/browser-harness ~/Developer/browser-harness", "cd ~/Developer/browser-harness", "uv venv .venv && source .venv/bin/activate", "uv pip install -e .", "BU_CDP_URL=http://127.0.0.1:18800" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CDN edge cache serves stale responses for minutes after deploy (cdn-edge-cache-stale-after-deploy)", "condition": "plain", "status": 200, "content": "The error \"CDN edge cache serves stale responses for minutes after deploy\" indicates that the Content Delivery Network (CDN) is still serving cached versions of your website or application, even after a deployment. This can be frustrating because it means that users are seeing outdated content instead of the latest version.\n\nTo fix this issue, you'll need to invalidate the cache on the CDN. Here's a step-by-step guide to help you do that:\n\n**Method 1: Using the CDN's Cache Invalidation Tool (if available)**\n\n1. Check if your CDN provider offers a cache invalidation tool. Some popular CDNs like Cloudflare, MaxCDN, and KeyCDN have built-in tools for this purpose.\n2. Log in to your CDN account and navigate to the cache invalidation tool (usually found under \"Settings\" or \"Cache\" section).\n3. Enter the URL(s) of the resources you want to invalidate (e.g., your website's homepage, or specific JavaScript or CSS files).\n4. Click \"Invalid\" or \"Clear Cache\" to invalidate the cache.\n\n**Method 2: Using the `Cache-Control` Header (for custom CDNs)**\n\nIf your CDN doesn't have a built-in cache invalidation tool, you can try", "metrics": { "length": 1127, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "browser-harness — AI 直连 Chrome 的 CDP 浏览器Automation (browser-harness-cdp-browser-automation)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the fact that the `browser-harness` package requires the `chrome-remote-protocol` and `@types/chromedriver` packages to be installed.\n\nHere are the steps to fix this error:\n\n**Step 1: Install the required packages**\n\nRun the following command in your terminal:\n```bash\nnpm install chrome-remote-protocol @types/chromedriver\n```\n**Step 2: Update your `package.json` file**\n\nMake sure you have the following lines in your `package.json` file:\n```json\n\"dependencies\": {\n \"browser-harness\": \"^2.4.0\",\n \"chrome-remote-protocol\": \"^1.4.1\",\n \"@types/chromedriver\": \"^94.0.0\"\n},\n```\n**Step 3: Run your script**\n\nAfter updating your `package.json` file, you can run your script again using the following command:\n```bash\nnpm run script-name\n```\nReplace `script-name` with the actual name of your script.\n\nIf you're using a `yarn` package manager, you can run the following command:\n```bash\nyarn install chrome-remote-protocol @types/chromedriver\nyarn add", "metrics": { "length": 988, "commands": 5, "command_list": [ "npm install chrome-remote-protocol @types/chromedriver", "**Step 3: Run your script**", "After updating your `package.json` file, you can run your script again using the following command:", "Replace `script-name` with the actual name of your script.", "If you're using a `yarn` package manager, you can run the following command:" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CDN edge cache serves stale responses for minutes after deploy (cdn-edge-cache-stale-after-deploy)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix to resolve the issue:\n\n**Fix 1: Add a random query parameter to force a cache miss**\n\nIn your application code, add a random query parameter to the URL. This will force the CDN edge cache to miss and retrieve the latest version of your response.\n\nFor example, if you're using Node.js and Express.js, you can modify your code as follows:\n\n```javascript\nconst express = require('express');\nconst app = express();\n\n// Add a random query parameter\nconst random = Math.floor(Math.random() * 1000000);\napp.get('/your-endpoint', (req, res) => {\n // Your endpoint logic here\n res.send('Hello World!');\n res.query.random = random; // Set the random query parameter\n});\n```\n\n**Fix 2: Disable browser/edge caching during verification**\n\nTo disable browser/edge caching, you can use the `Cache-Control` and `Pragma` headers in your response. Set `Cache-Control` to `no-cache` and `Pragma` to `no-cache`. Here's an example using Node.js and Express.js:\n\n```javascript\nconst express = require('express');\nconst app = express();\n\napp.get('/your-endpoint', (req, res)", "metrics": { "length": 1088, "commands": 2, "command_list": [ "**Fix 2: Disable browser/edge caching during verification**", "To disable browser/edge caching, you can use the `Cache-Control` and `Pragma` headers in your response. Set `Cache-Control` to `no-cache` and `Pragma` to `no-cache`. Here's an example using Node.js and Express.js:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI key rotation silently breaking scheduled automation without a code change (ci-key-rotation-silent-failure)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix for the CI key rotation silently breaking scheduled automation without a code change:\n\n**Step 1: Verify where the automation reads the secret from**\n\nOpen a terminal and run the following command to verify where the automation reads the secret from:\n\n```bash\ngrep -rn \"ghp_|gho_|github_pat_\" .env ci/ 2/dev/null\n```\n\nThis command will search for the strings \"ghp_\", \"gho_\", or \"github_pat_\" in the `.env` file and its subdirectories.\n\n**Step 2: Rotate the secret in one place**\n\nOnce you've identified where the automation reads the secret from, update the secret in that location with the new value. For example, if the automation reads the secret from a `.env` file, update the file with the new value:\n\n```bash\necho \"GITHUB_TOKEN=your_new_token\" > .env\n```\n\n**Step 3: Add a cheap health check at automation start**\n\nTo ensure that the automation fails loudly if it still holds the stale credentials, add a cheap health check at the start of the automation. For example, in a Python script, you can add the following code:\n\n```python\nimport os\n\ndef check_credentials():\n ", "metrics": { "length": 1109, "commands": 2, "command_list": [ "grep -rn \"ghp_|gho_|github_pat_\" .env ci/ 2/dev/null", "echo \"GITHUB_TOKEN=your_new_token\" > .env" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "CI key rotation silently breaking scheduled automation without a code change (ci-key-rotation-silent-failure)", "condition": "plain", "status": 200, "content": "The error \"CI key rotation silently breaking scheduled automation without a code change\" occurs when the CI/CD pipeline is unable to rotate the encryption key used for storing sensitive data, such as database credentials or API keys, without making any changes to the code.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Assumptions:**\n\n* You're using a Git-based CI/CD pipeline (e.g., Jenkins, GitLab CI/CD, CircleCI).\n* You have a CI/CD pipeline configured to rotate encryption keys on a regular schedule (e.g., daily, weekly).\n* The pipeline is using a tool like `aws-iam-auth-to-aws` or `aws-iam-auth-to-aws-cli` to rotate the encryption key.\n\n**Step 1: Verify the pipeline configuration**\n\nCheck your pipeline configuration to ensure that the key rotation is properly set up. Look for the following:\n\n* A script or job that runs the key rotation command.\n* The correct key ID and region specified in the command.\n* The correct IAM role or credentials used for the key rotation.\n\n**Step 2: Update the pipeline configuration to handle silent failures**\n\nUpdate your pipeline configuration to handle silent failures during key rotation. You can do this by:\n\n* Adding a retry", "metrics": { "length": 1188, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cubic AI and PR Genius Comparison (cubic-ai-vs-pr-genius)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is likely due to the fact that PR Genius v1.4.1 does not support the webhook feature that Cubic AI uses to automatically trigger reviews. To fix this, you'll need to upgrade to PR Genius v1.5.0, which supports webhooks.\n\nHere are the steps to apply:\n\n1. Upgrade to PR Genius v1.5.0:\n\nYou can upgrade to the latest version of PR Genius by running the following command:\n```bash\npip install --upgrade prgenius-core\n```\n2. Add the webhook feature:\n\nOnce you've upgraded to v1.5.0, you can add the webhook feature to your GitHub Actions workflow by modifying the `on` section to include the `pull_request` event:\n```yaml\non:\n pull_request:\n types: [opened, synchronize]\njobs:\n coach:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - run: pip install prgenius-core\n - run: python3 -m prgenius coach \"$TITLE\" --repo \"$REPO\" --body \"$BODY\"\n - name: Add webhook\n uses: prgenius/prgenius-webhook@", "metrics": { "length": 970, "commands": 1, "command_list": [ "pip install --upgrade prgenius-core" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cubic AI and PR Genius Comparison (cubic-ai-vs-pr-genius)", "condition": "plain", "status": 200, "content": "I'd be happy to help you troubleshoot the issue. However, I need more information about the error you're encountering. Please provide the exact error message you're seeing.\n\nIf you're still unsure about the error, I can provide a general solution for common issues that might occur when comparing Cubic AI and PR Genius.\n\nAssuming you're using a command-line interface like the terminal or command prompt, here are some general steps you can try:\n\n1. Check if the necessary packages are installed:\n ```bash\npip install scikit-learn\npip install pandas\npip install numpy\npip install scipy\n```\n\n2. Check if the datasets are downloaded:\n ```bash\npython\nfrom cubic_ai import CubicAI\nfrom pr_genius import PRGenius\n```\n\n3. Compare the two models:\n ```bash\nfrom cubic_ai import CubicAI\nfrom pr_genius import PRGenius\n\ncubic_ai = CubicAI()\npr_genius = PRGenius()\n\n# Get the scores\ncubic_ai_score = cubic_ai.get_score()\npr_genius_score = pr_genius.get_score()\n\n# Print the scores\nprint(\"Cubic AI Score:\", cubic_ai_score)\nprint(\"PR Genius Score:\", pr_genius_score)\n\n", "metrics": { "length": 1062, "commands": 7, "command_list": [ "pip install scikit-learn", "pip install pandas", "pip install numpy", "pip install scipy", "python" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Data Quality Fix: Always Keep Three Layers (DB + ETL + Query) (data-quality-three-layer-fix-pattern)", "condition": "plain", "status": 200, "content": "The error message you're encountering suggests that your data quality fix pattern is missing a layer. Here's a concrete, actionable fix with exact commands.\n\nLet's assume you're working with a database (e.g., MySQL), an ETL (Extract, Transform, Load) tool (e.g., Apache NiFi), and a query tool (e.g., SQL).\n\n**Current Setup:**\n\n1. Database (DB): MySQL\n2. ETL Tool: Apache NiFi\n3. Query Tool: SQL\n\n**Fix: Add a Query Layer**\n\n**Step 1: Create a new query layer in your ETL tool (Apache NiFi)**\n\n```bash\n# Create a new query processor in NiFi\nnifi addQueryProcessor -name \"Data Quality Fix\" -query \"SELECT * FROM your_table_name\"\n```\n\n**Step 2: Configure the query processor to fetch data from the database**\n\n```bash\n# Configure the query processor to fetch data from the database\nnifi addDatabaseConnection -name \"MySQL Connection\" -host \"your_host\" -port \"your_port\" -username \"your_username\" -password \"your_password\"\nnifi addQueryProcessor -name \"Data Quality Fix\" -query \"SELECT * FROM your_table_name", "metrics": { "length": 1005, "commands": 1, "command_list": [ "nifi addQueryProcessor -name \"Data Quality Fix\" -query \"SELECT * FROM your_table_name\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Data Quality Fix: Always Keep Three Layers (DB + ETL + Query) (data-quality-three-layer-fix-pattern)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to apply the fixes at three layers: ETL, DB, and Query. Here are the concrete, actionable fixes with exact commands:\n\n**Fix 1: ETL (Prevent Recurrence)**\n\nYou've already written the Python function `normalize_robot_name` in the `common.py` file. Add this function to the ETL script to normalize the robot names before inserting them into the database.\n\n```python\n# common.py\nROBOT_NAME_PREFIXES = [\n ('TGO_FEN_处理后数据', 'TGO'),\n ('FEN&TGO', 'TGO'),\n ('TGO&FEN', 'TGO'),\n ('TGO FEN', 'TGO'),\n ('FE_处理后数据', 'FE'),\n ('UB&FE', 'FE'),\n ('FE66', 'FE'),\n]\n\ndef normalize_robot_name(name):\n for prefix, replacement in ROBOT_NAME_PREFIXES:\n if name.startswith(prefix):\n return replacement + name[len(prefix):]\n return name\n```\n\n**Fix 2: DB (Add Unique Constraint)**\n\nAdd a unique constraint on the `robot_name` column to prevent duplicate names.\n\n```sql\nCREATE TABLE robots (\n id", "metrics": { "length": 943, "commands": 2, "command_list": [ "**Fix 2: DB (Add Unique Constraint)**", "Add a unique constraint on the `robot_name` column to prevent duplicate names." ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Debugging memory leaks in Ruby (debugging-memory-leaks-in-ruby)", "condition": "with_lesson", "status": 200, "content": "To debug memory leaks in Ruby, you can follow these steps:\n\n### Step 1: Graph Memory Over Time\n\nFirst, you need to monitor the RSS (Resident Set Size) of your Ruby processes over time. Here's how you can do it using Graphite and Grafana:\n\n1. Install Graphite and Grafana on your server:\n\n ```bash\nsudo apt-get update\nsudo apt-get install graphite\nsudo apt-get install grafana-server\n```\n\n2. Configure Graphite to collect data from your Ruby processes:\n\n You'll need to add a graphite carbon daemon to your unicorn or sidekiq configuration file. For example, in your unicorn configuration file (`config/unicorn.rb`):\n\n ```ruby\nmodule Unicorn\n plugin :rackup\n plugin :preload_app\n plugin :static_file_cache\n\n rackup_options = {\n \"Ruby on Rails\" => \"config.ru\",\n \"Rails 4.2\" => \"config/rails.rb\",\n \"Rails 5.0\" => \"config/rails.rb\",\n # Add your configuration file here\n }\n\n # ...\n\n before_fork do\n # ...\n # Add graphite configuration here\n graphite_config = {\n 'graphite.host'", "metrics": { "length": 1011, "commands": 3, "command_list": [ "sudo apt-get update", "sudo apt-get install graphite", "sudo apt-get install grafana-server" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Debugging memory leaks in Ruby (debugging-memory-leaks-in-ruby)", "condition": "plain", "status": 200, "content": "To debug memory leaks in Ruby, you can use the following steps:\n\n1. **Use `gem install byebug`**: This will install the `byebug` gem, which provides a Ruby debugger.\n\n2. **Run your Ruby script with `byebug`**: Use the following command to run your Ruby script with `byebug`:\n\n ```bash\nbyebug your_script.rb\n```\n\n3. **Add a breakpoint**: In `byebug`, you can add a breakpoint by typing `b line_number` and pressing Enter. Replace `line_number` with the number of the line you want to break on.\n\n4. **Step through your code**: With a breakpoint set, you can step through your code by typing `next` and pressing Enter. This will execute the next line of code.\n\n5. **Inspect memory usage**: To inspect memory usage, you can type `p $mem_stats` and press Enter. This will display the current memory usage.\n\n6. **Check for circular references**: If you're experiencing a memory leak, it's possible that there are circular references in your code. To check for circular references, you can type `p $GC.object_id` and press Enter. This will display the object ID of the current object. If", "metrics": { "length": 1083, "commands": 1, "command_list": [ "byebug your_script.rb" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Banking-style escrow fee estimate has a per-provider rounding disparity (escrow-fee-rounding-per-provider)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix with exact commands:\n\n**Fix:**\n\n1. Update the `banking-style escrow fee estimate` calculation to use integer arithmetic (cents/wei/sats) instead of binary floating-point math.\n\n```python\n# Before\nfee_estimate = amount * rate\n\n# After\nfee_estimate = int(amount * rate * 100) # Convert to cents\n```\n\n2. Choose a single rounding mode (e.g., round-half-up) and apply it consistently throughout the calculation.\n\n```python\n# Before\nfee_estimate = int(amount * rate * 100)\n\n# After\nfee_estimate = round(int(amount * rate * 100) / 100) # Round-half-up\n```\n\n3. Sum the fee estimates in integer units, rounding once at the end.\n\n```python\n# Before\ntotal_fee_estimate = fee_estimate + other_fee_estimates\n\n# After\ntotal_fee_estimate = sum([round(int(fee_estimate) / 100) for fee_estimate in other_fee_estimates])\n```\n\n4. Add a \"recompute and compare to stored\" invariant check in tests.\n\n```python\ndef test_recompute_and_compare_to_stored():\n # Simulate data\n amount = 10.0", "metrics": { "length": 1005, "commands": 3, "command_list": [ "2. Choose a single rounding mode (e.g., round-half-up) and apply it consistently throughout the calculation.", "3. Sum the fee estimates in integer units, rounding once at the end.", "4. Add a \"recompute and compare to stored\" invariant check in tests." ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Banking-style escrow fee estimate has a per-provider rounding disparity (escrow-fee-rounding-per-provider)", "condition": "plain", "status": 200, "content": "To fix the banking-style escrow fee estimate per-provider rounding disparity, you can use the `round` function in Python to round the fee to the nearest cent. Here's a concrete, actionable fix with exact commands:\n\n```python\n# Assuming the escrow_fee_rounding_per_provider is a variable\n# containing the per-provider rounding disparity\n\n# Round the escrow fee to the nearest cent\nrounded_fee = round(escrow_fee, 2)\n\n# Apply the rounding disparity to the rounded fee\nrounded_fee_with_disparity = rounded_fee + (escrow_fee_rounding_per_provider / 100)\n\n# Print the final rounded fee with disparity\nprint(rounded_fee_with_disparity)\n```\n\nThis code will round the escrow fee to the nearest cent and then apply the per-provider rounding disparity to the rounded fee. The `/ 100` is used to convert the percentage to a decimal.\n\nFor example, if the `escrow_fee` is 100.00 and the `escrow_fee_rounding_per_provider` is 5, the `rounded_fee_with_disparity` will be:\n\n```python\nrounded_fee = round(100.00, 2) # 100.00\nrounded_fee_with_disparity = 100.00 +", "metrics": { "length": 1046, "commands": 2, "command_list": [ "This code will round the escrow fee to the nearest cent and then apply the per-provider rounding disparity to the rounded fee. The `/ 100` is used to convert the percentage to a decimal.", "For example, if the `escrow_fee` is 100.00 and the `escrow_fee_rounding_per_provider` is 5, the `rounded_fee_with_disparity` will be:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot Alarm Code Reference Table (fanuc-alarm-code-reference)", "condition": "plain", "status": 200, "content": "I can't provide a fix without knowing the exact error message you're receiving. The FANUC Robot Alarm Code Reference Table is a comprehensive resource for troubleshooting FANUC robot issues, but without more information, it's difficult to pinpoint the exact issue.\n\nCould you please provide the following details:\n\n1. The exact error message you're receiving.\n2. The FANUC robot model and version you're using.\n3. A description of the situation or action that led to the error.\n\nOnce I have this information, I can provide a more concrete and actionable fix with exact commands.", "metrics": { "length": 578, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot Alarm Code Reference Table (fanuc-alarm-code-reference)", "condition": "with_lesson", "status": 200, "content": "I can provide a concrete, actionable fix for the FANUC robot alarm code reference table. However, please note that the specific commands may vary depending on the FANUC robot model and firmware version.\n\n**Fix 1: MOTN-023 - 动作锁定 (Motion Lock)**\n\nTo resolve the MOTN-023 error, follow these steps:\n\n1. Check the motion group configuration to ensure it is correct.\n2. Verify that the condition for motion lock is not met.\n3. Run the following command to check the motion group configuration:\n```\nMOTN-023> MOTN-023\n```\nThis will display the motion group configuration. If the configuration is incorrect, update it using the `MOTN-023` command.\n\n**Fix 2: PROG-004 - 程序不存在 (Program Not Found)**\n\nTo resolve the PROG-004 error, follow these steps:\n\n1. Verify that the program name is correct.\n2. Check if the program is loaded using the `PROG-004` command:\n```\nPROG-004> PROG-004\n```\nThis will display the program list. If the program is not loaded, load it using the `LOAD` command.\n\n**Fix 3:", "metrics": { "length": 988, "commands": 2, "command_list": [ "MOTN-023> MOTN-023", "PROG-004> PROG-004" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Alarm Severity Levels — Handling and Color Codes (fanuc-alarm-severity-guide)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, it seems like you're experiencing an alarm on your FANUC robot, and you're not sure what it means or how to handle it. Here are some steps you can follow to address the issue:\n\n**Step 1: Check the Alarm Severity Table**\n\nRefer to the Alarm Severity Table provided in the lesson to determine the severity level of the alarm you're experiencing. This will help you understand the implications of each level and decide on the best course of action.\n\n**Step 2: Verify the Alarm Severity**\n\nUse the following commands to verify the alarm severity:\n\n- `ALARM SEVERITY` (for FANUC C-series) or `ALARM SEVERITY (for FANUC M-series)\n- This command will display the current alarm severity level.\n\n**Step 3: Check the Alarm Description**\n\nUse the following commands to check the alarm description:\n\n- `ALARM DESCRIPTION` (for FANUC C-series) or `ALARM DESCRIPTION (for FANUC M-series)\n- This command will display a brief description of the alarm.\n\n**Step 4: Take Action Based on Severity Level**\n\nBased on the alarm severity level and description, take the following actions:\n\n* For WARN, PAUSE, STOP, or", "metrics": { "length": 1128, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Alarm Severity Levels — Handling and Color Codes (fanuc-alarm-severity-guide)", "condition": "plain", "status": 200, "content": "The FANUC alarm severity levels are a set of predefined error codes used in FANUC CNC machines to indicate the severity of an alarm. Here's a concrete, actionable fix for some common errors:\n\n**Error 01: Machine Start Failure**\n\n* Cause: The machine cannot start due to a configuration error or a problem with the control system.\n* Fix:\n```bash\n# Restart the FANUC control system\nfncnc restart\n\n# Check the configuration file for errors\nfncnc checkconf\n```\n\n**Error 02: Tool Break**\n\n* Cause: A tool has broken or is damaged, preventing it from being used.\n* Fix:\n```bash\n# Check the tool condition and replace it if necessary\nfncnc toolcheck\n\n# Remove the broken tool\nfncnc removetool \n\n# Replace the broken tool\nfncnc addtool \n```\n\n**Error 03: Error in Program Execution**\n\n* Cause: An error occurred while executing a program.\n* Fix:\n```bash\n# Check the program for errors\nfncnc checkprog \n\n# Debug the program using the FANUC debugger\nfncnc debug \n```\n\n**Error ", "metrics": { "length": 1023, "commands": 7, "command_list": [ "fncnc restart", "fncnc checkconf", "fncnc toolcheck", "fncnc removetool ", "fncnc addtool " ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Auto Abort on Fault — Restart $SHELL_WRK Program (fanuc-auto-abort-on-fault-restart)", "condition": "with_lesson", "status": 200, "content": "To fix the FANUC Auto Abort on Fault — Restart $SHELL_WRK Program error, you'll need to modify the error severity of the \"TP Enabled in AUTO Mode\" fault and possibly add a background logic program to automatically abort and restart the main program. Here are the exact commands for each option:\n\n**Option 1: Modify Error Severity**\n\n1. Open the FANUC configuration menu:\n ```bash\nMENU → SYSTEM → CONFIG → Error Table\n```\n\n2. Change the severity of \"TP Enabled in AUTO Mode\" (Syst-045) from Pause to Abort:\n ```\nSyst-045 (TP Enabled in AUTO Mode) - Severity: Abort\n```\n\n**Option 2: Add Background Logic Program**\n\n1. Create a new background logic program:\n ```bash\n/PROG BG_ABORT\n```\n\n2. Add the following code to the program:\n ```bash\n-- Background logic program:\nIF (DI[abort_signal] OR $SHELL_WRK.$PROGRAM_STATE < 1) THEN\n ABORT\n -- Wait for abort to complete\n WAIT $SHELL_WRK.$PROGRAM_STATE = 0\n -- Restart main program\n RUN $SHELL_WRK.$CUST_NAME", "metrics": { "length": 962, "commands": 3, "command_list": [ "MENU → SYSTEM → CONFIG → Error Table", "Syst-045 (TP Enabled in AUTO Mode) - Severity: Abort", "/PROG BG_ABORT" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Auto Abort on Fault — Restart $SHELL_WRK Program (fanuc-auto-abort-on-fault-restart)", "condition": "plain", "status": 200, "content": "The error message you're encountering is a common issue on FANUC CNC machines. Here's a step-by-step fix:\n\n**Method 1: Using the FANUC Machine Monitor**\n\n1. Open the FANUC Machine Monitor (FMM) on your CNC machine.\n2. Navigate to the \"Status\" or \"Error\" tab.\n3. Look for the error message \"FANUC Auto Abort on Fault — Restart $SHELL_WRK Program\".\n4. Click on the \"Abort\" or \"Stop\" button to abort the current program.\n5. Click on the \"Restart\" button to restart the machine.\n6. Select the \"$SHELL_WRK\" program from the list of available programs.\n7. Click \"OK\" to confirm the restart.\n\n**Method 2: Using the FANUC Configuration File (CF) Editor**\n\n1. Open the FANUC CF Editor on your computer.\n2. Load the CF file corresponding to your CNC machine.\n3. Navigate to the \"Programs\" or \"Startup\" section of the CF file.\n4. Look for the \"$SHELL_WRK\" program and check if it has any errors or warnings.\n5. If the program has errors, fix them and re-save the CF file.\n", "metrics": { "length": 961, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot Backup and Restore — Full, Mirror, Auto, and File Restore (fanuc-backup-restore-guide)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, here's a step-by-step guide to resolve the issue:\n\n**Step 1: Check the Backup Type**\n\n1. Open the FANUC robot controller's menu by pressing the \"Menu\" button.\n2. Navigate to \"File\" and select \"Backup\".\n3. Check the backup type. If it's set to \"Image Backup\" or \"All of above\", proceed to the next step. If it's set to \"Auto Backup\", ensure that the backup is enabled and configured correctly.\n\n**Step 2: Verify Backup Configuration**\n\n1. If the backup type is set to \"All of above\" or \"Image Backup\", check the backup configuration.\n2. Ensure that the \"Period\" is set to the desired frequency (e.g., daily, weekly, or monthly).\n3. Check the \"Time\" to ensure it's set to the desired backup time.\n4. Verify the \"Type\" is set to \"Full\" or \"Incremental\" depending on the required backup type.\n5. Ensure the \"Storage\" is set to the desired location (e.g., USB, CF card, or network).\n\n**Step 3: Restore the Backup**\n\n1. If the backup type is set to \"Full Backup\", navigate to", "metrics": { "length": 1004, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot Backup and Restore — Full, Mirror, Auto, and File Restore (fanuc-backup-restore-guide)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a missing or corrupted configuration file. Here's a step-by-step guide to fix the issue using the FANUC Robot Backup and Restore tool:\n\n**Step 1: Stop the Backup Service**\n\n1. Open a terminal and navigate to the directory where the FANUC Robot Backup and Restore tool is installed. You can find the tool in the `/usr/local/fanuc/` directory on most Linux systems.\n\n```bash\ncd /usr/local/fanuc/\n```\n\n2. Stop the backup service using the following command:\n\n```bash\nsudo service fanuc-backup stop\n```\n\n**Step 2: Check for Corrupted Configuration Files**\n\n1. Run the following command to check for corrupted configuration files:\n\n```bash\nsudo find /usr/local/fanuc -type f -name \"*conf\" -exec grep -q \"error\" \\;\n```\n\nThis command searches for configuration files in the `/usr/local/fanuc/` directory and checks if any of them contain the word \"error\".\n\n**Step 3: Restore Configuration Files**\n\n1. If the previous command returns any errors, you'll need to restore the configuration files. You can do this using the following command:\n\n```bash\nsudo cp", "metrics": { "length": 1094, "commands": 3, "command_list": [ "cd /usr/local/fanuc/", "sudo service fanuc-backup stop", "sudo find /usr/local/fanuc -type f -name \"*conf\" -exec grep -q \"error\" \\;" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot TCP/IP Socket Communication Protocol and MAPPDK Setup (fanuc-communication-protocol-socket)", "condition": "plain", "status": 200, "content": "The FANUC robot TCP/IP socket communication protocol and MAPPDK setup error typically occurs when there is a mismatch between the FANUC robot's IP address, port number, and the settings in the MAPPDK (Machine Access Programming Package Development Kit). Here's a step-by-step guide to fix this issue:\n\n**Step 1: Check the FANUC Robot's IP Address and Port Number**\n\n1. Connect to the FANUC robot using a terminal or a console.\n2. Type `SETIP` and press Enter. This will display the current IP address of the FANUC robot.\n3. Take note of the IP address and port number (usually 102).\n\n**Step 2: Configure the MAPPDK Settings**\n\n1. Open the MAPPDK setup file (usually `mappdk.ini` or `mappdk.cfg`) in a text editor.\n2. Add the following lines at the end of the file:\n\n```\n[FANUC]\nIPAddress = \nPortNumber = 102\n```\n\nReplace `` with the actual IP address of the FANUC robot.\n\n3. Save the changes to the MAPPDK setup file.\n\n", "metrics": { "length": 981, "commands": 3, "command_list": [ "[FANUC]", "IPAddress = ", "PortNumber = 102" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot TCP/IP Socket Communication Protocol and MAPPDK Setup (fanuc-communication-protocol-socket)", "condition": "with_lesson", "status": 200, "content": "To fix the error and establish TCP/IP socket communication between an external PC (Python/C++/other) and a FANUC robot controller using the FANUC-communication-protocol-socket, follow these steps:\n\n**Step 1: Ensure Compatibility and Install MAPPDK**\n\n1. Log in to the FANUC robot controller and navigate to **MENU** > **NEXT** > **STATUS** > **Version ID** > **ORDER FI**.\n2. Verify that the following options are included in the list:\n\t* R632 — KAREL\n\t* R648 — User Socket Messaging\n3. If not, add them and serialize the installation.\n4. In the ROBOGUIDE environment, edit the robot options and add R632 and R648.\n5. Serialize the installation.\n\n**Step 2: Configure Network Connection**\n\n1. Navigate to **MENU** > **SETUP** > **Host Comm** > **TCP/IP**.\n2. Configure the following settings for the robot:\n\t* Robot IP: `192.168.234.2` (or the same network segment)\n\t* Subnet Mask: `255.255.255.0`\n\t* DHCP Enable: `False`\n\t* Host Name: The", "metrics": { "length": 938, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC DCS Safety System — Configuration and Stop Modes (fanuc-dcs-safety-configuration)", "condition": "plain", "status": 200, "content": "I can guide you through the process of fixing the FANUC DCS Safety System error. However, I need more information about the specific error you are encountering. Please provide me with the exact error message or the steps you have taken so far to troubleshoot the issue.\n\nThat being said, here are some general steps you can take to fix common issues with the FANUC DCS Safety System:\n\n**Error: \"Invalid configuration\" or \"Configuration not found\"**\n\n1. Check the configuration file: The configuration file is usually located in the `/etc/fanuc-dcs-safety` directory. Make sure the file exists and is not corrupted.\n2. Update the configuration file: Run the following command to update the configuration file: `sudo cp /etc/fanuc-dcs-safety/default.conf /etc/fanuc-dcs-safety/config.conf`\n3. Restart the DCS Safety System: Run the following command to restart the DCS Safety System: `sudo service fanuc-dcs-safety restart`\n\n**Error: \"Stop mode not enabled\"**\n\n1. Check the stop mode settings: Run the following command to check the stop mode settings: `sudo cat /etc/fanuc-dcs-safety/stop-mode.conf`\n2. Enable", "metrics": { "length": 1108, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC DCS Safety System — Configuration and Stop Modes (fanuc-dcs-safety-configuration)", "condition": "with_lesson", "status": 200, "content": "To resolve the FANUC DCS Safety System configuration and stop modes issue, we need to verify that the DCS is properly configured according to the provided solution and function table. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Verify the DCS Configuration**\n\n1. Connect to the FANUC DCS using the provided IP address and login credentials.\n2. Check the DCS version and confirm it matches the recommended version.\n3. Review the DCS configuration to ensure that the default emergency stop password (1111) is not changed.\n\n**Step 2: Configure Stop Modes**\n\n1. Go to the \"Stop Modes\" menu and select \"Stop Mode Configuration.\"\n2. Set the \"Stop Mode\" to \"Manual\" and save the changes.\n3. Configure the \"Emergency Stop\" settings:\n * Set the \"Emergency Stop\" mode to \"Cat 4\" (PL e / SIL 3).\n * Set the \"Emergency Stop\" delay to \"10 ms\" (default value).\n * Save the changes.\n\n**Step 3: Configure Safety I/O Connection**\n\n1. Go to the \"Safety I/O Connection\" menu and select \"Safety I/O Configuration", "metrics": { "length": 1027, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC DO Not Found in Program — Check Reference Position (fanuc-do-not-found-in-program-reference-position)", "condition": "with_lesson", "status": 200, "content": "To fix the \"FANUC DO Not Found in Program\" error, you need to check the following sources:\n\n1. Reference Positions\n2. Background Logic (BG Logic)\n3. Space Functions\n4. Manual Macros\n\nHere are the steps with exact commands:\n\n1. Check Reference Positions:\n\n * Open the FANUC robot control panel.\n * Go to `MENU` > `SETUP` > `Reference Position`.\n * Verify that the DO you're looking for is assigned to a reference position.\n\n2. Check Background Logic:\n\n * Go to `MENU` > `SETUP` > `BG Logic`.\n * Look for DO assignments in the BG Logic programs that run continuously.\n\n3. Check Space Functions:\n\n * Go to `MENU` > `SETUP` > `Space`.\n * Verify that the DO you're looking for is activated based on robot position within defined volumes.\n\n4. Search All Sources:\n\n * Open a terminal and run the following command to search for DO assignments in all program types:\n\n ```bash\ngrep -i \"DO[66]\" lessons/contrib/fanuc-.md 2/dev/null | wc -l\n", "metrics": { "length": 981, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC DO Not Found in Program — Check Reference Position (fanuc-do-not-found-in-program-reference-position)", "condition": "plain", "status": 200, "content": "The error \"FANUC DO Not Found in Program — Check Reference Position\" typically occurs when the FANUC CNC machine is unable to find the reference position specified in the program. Here's a step-by-step fix:\n\n**Prerequisites:**\n\n1. Ensure you have a valid FANUC CNC machine and a compatible program.\n2. Verify that the program is correctly loaded into the machine.\n3. Check that the reference position is correctly defined in the program.\n\n**Fix:**\n\n1. **Check the reference position definition:**\n - Open the FANUC program in a text editor or a FANUC-specific programming software (e.g., FANUC's own FANUC-NC Program Editor or a third-party tool like G-code Editor).\n - Look for the reference position definition, which is usually specified using the `G21` or `G90` command followed by the `G54` or `G55` command.\n - Ensure that the reference position is correctly defined and matches the actual position of the tool on the machine.\n\n2. **Verify the reference position:**\n - Check the machine's coordinate system and reference positions.\n - Ensure that the reference position specified in the program matches the actual position of the tool on the", "metrics": { "length": 1157, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot EtherNet/IP Connection with OMRON PLC (fanuc-eip-omron-plc-connection)", "condition": "with_lesson", "status": 200, "content": "根据提供的教程和错误信息,下面是一些具体的步骤来解决 FANUC Robot EtherNet/IP Connection with OMRON PLC(fanuc-eip-omron-plc-connection)错误:\n\n**步骤 1:检查 FANUC 机器人固件版本**\n\n使用 FANUC 机器人控制软件(如 FANUC CNC Software)检查机器人固件版本是否支持 EtherNet/IP 协议。\n\n```bash\n# 使用 FANUC CNC Software 检查机器人固件版本\nfncnc -version\n```\n\n**步骤 2:检查 OMRON PLC 主站功能**\n\n使用 OMRON PLC 编程软件(如 CX-Integrator)检查 PLC 主站功能是否支持 EtherNet/IP 主站功能。\n\n```bash\n# 使用 CX-Integrator 检查 PLC 主站功能\ncx-integrator -version\n```\n\n**步骤 3:设置 FANUC 机器人以太网参数**\n\n在 FANUC 机器人控制软件中,设置以太网参数:\n\n```bash\n# 设置以太网参数\nfncnc -setup -host-comm -", "metrics": { "length": 533, "commands": 2, "command_list": [ "fncnc -version", "cx-integrator -version" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot EtherNet/IP Connection with OMRON PLC (fanuc-eip-omron-plc-connection)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a configuration issue with the FANUC robot's EtherNet/IP connection to the OMRON PLC. Here's a step-by-step guide to help you resolve the issue:\n\n**Prerequisites:**\n\n1. Ensure that the FANUC robot and OMRON PLC are properly connected and powered on.\n2. Verify that the EtherNet/IP communication protocol is enabled on both the FANUC robot and OMRON PLC.\n\n**Fix:**\n\n1. **Check FANUC Robot Configuration:**\n\n Open the FANUC robot's programming software (e.g., FANUC Robotics Factory Talk HMI/DCS) and navigate to the \"EtherNet/IP\" tab.\n\n 1.1. Ensure that the \"EtherNet/IP\" module is enabled and configured correctly.\n 1.2. Check the \"IP Address\" and \"Port Number\" settings to ensure they match the OMRON PLC's IP address and port number.\n\n2. **Check OMRON PLC Configuration:**\n\n Open the OMRON PLC's programming software (e.g., OMRON PC-based) and navigate to the \"Communication\" or \"EtherNet/IP\" tab.\n\n 2.1. Ensure that", "metrics": { "length": 975, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Handling Robot Unexpected Auto Mode Dropout Diagnosis (fanuc-handling-robot-auto-drop-diagnosis)", "condition": "plain", "status": 200, "content": "The FANUC Handling Robot Unexpected Auto Mode Dropout Diagnosis error is a common issue. Here's a step-by-step guide to resolve the issue:\n\n**Prerequisites:**\n\n* Ensure you have a FANUC M-1000iA or M-2000iA robot controller.\n* Familiarize yourself with the robot's settings and configuration.\n\n**Step 1: Check the Robot's Status**\n\nOpen the FANUC Robot Studio software and connect to the robot. Check the robot's status by clicking on \"Robot\" > \"Status\" in the menu.\n\n**Step 2: Check the Auto Mode Settings**\n\nIn the Robot Studio software, navigate to \"Robot\" > \"Auto Mode\" > \"Auto Mode Settings\". Check if the \"Auto Mode\" is enabled and if it's set to the correct mode (e.g., \"Auto\" or \"Manual\").\n\n**Step 3: Check the Safety Settings**\n\nIn the Robot Studio software, navigate to \"Robot\" > \"Safety\" > \"Safety Settings\". Ensure that the \"Safety\" mode is enabled and that the \"Safety Enable\" switch is set to \"ON\".\n\n**Step 4: Check the Safety Light**\n\nCheck the safety light on the robot to ensure it's not indicating an error.", "metrics": { "length": 1025, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Handling Robot Unexpected Auto Mode Dropout Diagnosis (fanuc-handling-robot-auto-drop-diagnosis)", "condition": "with_lesson", "status": 200, "content": "以下是解决 FANUC 搬运机器人掉自动模式诊断 的具体步骤:\n\n**解决方案一:清洁与检查**\n\n1. 拆卸快换耦合器,检查所有电气触点:\n```bash\nsudo udevadm trigger --action=remove --subsystem=usb\n```\n2. 用酒精清洁触点表面氧化层和油污:\n```bash\nsudo rm -rf /sys/bus/usb/drivers/fanuc/trigger\nsudo echo \"0\" > /sys/bus/usb/drivers/fanuc/trigger\nsudo rm -rf /sys/bus/usb/drivers/fanuc/trigger\nsudo echo \"1\" > /sys/bus/usb/drivers/fanuc/trigger\n```\n3. 检查触点弹簧压力是否足够:\n```bash\nsudo cat /sys/bus/usb/drivers/fanuc/pin0\n```\n4. 验证耦合器机械对位精度:\n```bash\nsudo cat /sys/bus/usb/drivers/fanuc/position\n```\n\n**解决方案二:信号监控定位**\n\n1. 编写一个监控程序,实", "metrics": { "length": 539, "commands": 7, "command_list": [ "sudo udevadm trigger --action=remove --subsystem=usb", "sudo rm -rf /sys/bus/usb/drivers/fanuc/trigger", "sudo echo \"0\" > /sys/bus/usb/drivers/fanuc/trigger", "sudo rm -rf /sys/bus/usb/drivers/fanuc/trigger", "sudo echo \"1\" > /sys/bus/usb/drivers/fanuc/trigger" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "KAREL Core Utility Modules: errors, system, Strings API Reference (fanuc-karel-core-utility-modules)", "condition": "with_lesson", "status": 200, "content": "Based on the provided documentation, it appears that the errors are related to the lack of error handling, string manipulation, and system type definitions in the KAREL language. To fix these errors, you can follow these steps:\n\n1. Create a new file named `errors.klt` in the `errors` directory of your KAREL project.\n\n2. Add the following error codes to the `errors.klt` file:\n```karel\n// 类别 | 典型错误码\n// 数组\nARR_LEN_MISMATCH, INVALID_INDEX\n// 变量\nVAR_UNINIT\n// 文件\nFILE_NOT_OPEN\n// 程序\nTPE_PROGRAM_DOES_NOT_EXIST\n// 队列\nQUEUE_IS_EMPTY\n// 位置\nPOS_TYPE_MISMATCH\n// 运动\nSEARCH_MOTION_FAILED\n```\n3. Create a new file named `system.klt` in the `system` directory of your KAREL project.\n\n4. Add the following functions to the `system.klt` file:\n```karel\n// 时间日期\nkarel\nsystem__date() : STRING\n -- 返回 'DD-MMM-YYYY'\n return (\"DD-MMM-\" + system__day() + \"-YYYY\")\n\nsystem__", "metrics": { "length": 857, "commands": 2, "command_list": [ "3. Create a new file named `system.klt` in the `system` directory of your KAREL project.", "4. Add the following functions to the `system.klt` file:" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "KAREL Core Utility Modules: errors, system, Strings API Reference (fanuc-karel-core-utility-modules)", "condition": "plain", "status": 200, "content": "The error message you're seeing suggests that you're trying to use a module from the `fanuc-karel-core-utility-modules` library, which is not compatible with your current environment.\n\nHere's a step-by-step solution to resolve this issue:\n\n**Method 1: Update your dependencies**\n\nIf you're using Maven or Gradle, you can try updating your dependencies to the latest version of the `fanuc-karel-core-utility-modules` library.\n\n**Maven:**\n\n1. Open your `pom.xml` file in your IDE or text editor.\n2. Add the following dependency to your `pom.xml` file:\n```xml\n\n fanuc\n karel-core-utility-modules\n 1.0.0\n\n```\nReplace `1.0.0` with the latest version available on Maven Central.\n\n3. Save your `pom.xml` file and run `mvn clean install` in your terminal.\n\n**Gradle:**\n\n1. Open your `build.gradle` file in your IDE or text editor.\n2. Add the following dependency to your `build.gradle` file:\n```groovy\ndependencies {\n implementation 'fan", "metrics": { "length": 1029, "commands": 5, "command_list": [ "Replace `1.0.0` with the latest version available on Maven Central.", "3. Save your `pom.xml` file and run `mvn clean install` in your terminal.", "**Gradle:**", "1. Open your `build.gradle` file in your IDE or text editor.", "2. Add the following dependency to your `build.gradle` file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Geometry and Kinematics Layer — Shapes, Pose, Sensors for Robot Programming (fanuc-karel-geometry-kinematics-layer)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is due to the missing implementation of geometric operations in the FANUC KAREL standard library. To fix this issue, you need to implement the missing functions and data types.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Implement the missing data types**\n\nCreate a new module `shapes` and add the following data types:\n```karel\nt_POINT { x, y, z: REAL; }\nt_VECTOR { x, y, z: REAL; }\nt_NORMAL { x, y, z: REAL; }\n\nt_PLANE { normal: t_NORMAL; d: REAL; origin: t_POINT; }\nt_SEGMENT { r0, r1: t_POINT; }\nt_BOX { verts[5], vects[3], normals[3]; centroid: t_POINT; }\nt_CYLINDER { origin: t_POINT, radius, height: REAL; }\n```\n**Step 2: Implement the missing functions**\n\nAdd the following functions to the `shapes` module:\n```karel\n-- Construct a plane from two points\nshapes__create_plane_from_points(p1, p2, p3) : t_PLANE =\n let normal = t_NORMAL(2 * (p2.x", "metrics": { "length": 905, "commands": 2, "command_list": [ "**Step 2: Implement the missing functions**", "Add the following functions to the `shapes` module:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Geometry and Kinematics Layer — Shapes, Pose, Sensors for Robot Programming (fanuc-karel-geometry-kinematics-layer)", "condition": "plain", "status": 200, "content": "I don't see any code provided for the error. However, I can provide a general fix for common errors that might occur in the Geometry and Kinematics Layer.\n\nAssuming the error is related to a missing or incorrect import statement, a missing or incorrect class definition, or a syntax error, here are some concrete, actionable fixes with exact commands:\n\n**Fix 1: Missing Import Statement**\n\nIf the error is related to a missing import statement, add the following command at the top of your code:\n```python\nfrom fanuc_karel.geometry import *\nfrom fanuc_karel.kinematics import *\nfrom fanuc_karel.sensors import *\n```\nReplace `fanuc_karel` with the actual package name if it's different.\n\n**Fix 2: Missing or Incorrect Class Definition**\n\nIf the error is related to a missing or incorrect class definition, ensure that the class definition is correct and complete. For example:\n```python\nclass MyRobot:\n def __init__(self):\n self.pose = Pose()\n self.sensors = Sensors()\n\n def move_forward(self):\n self.pose.move_forward(10)\n```\nReplace `MyRobot` with the actual class name and `Pose` and `Sensors` with the actual class names.\n\n**", "metrics": { "length": 1155, "commands": 3, "command_list": [ "Replace `fanuc_karel` with the actual package name if it's different.", "**Fix 2: Missing or Incorrect Class Definition**", "If the error is related to a missing or incorrect class definition, ensure that the class definition is correct and complete. For example:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KAREL HTTP API — WebControl Robot Motion and Monitoring (fanuc-karel-http-api-webcontrol)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, the error is likely due to the fact that the API endpoint `/KAREL/webcontrol` is expecting specific parameter formats and return values, but these are not being met.\n\nHere's a concrete, actionable fix with exact commands to resolve the issue:\n\n1. **Verify the FANUC control controller's KAREL webserver version**: First, check the version of the FANUC control controller's KAREL webserver by sending a GET request to `http://:8080/KAREL/version`.\n\n```bash\ncurl http://:8080/KAREL/version\n```\n\n2. **Check the API endpoint documentation**: Review the API endpoint documentation to ensure that you are using the correct parameter formats and return values.\n\n```bash\ncurl http://:8080/KAREL/webcontrol?str_mtn_mod=3&str_coord1=100&str_coord2=200&str_coord3=300&str_coord4=0&str_coord5=0&str_coord6=0\n```\n\n3. **Format the JSON response**: The API endpoint `/KAREL/webmonitor` returns a JSON response. Verify that the JSON response is in the correct format by", "metrics": { "length": 1033, "commands": 2, "command_list": [ "curl http://:8080/KAREL/version", "curl http://:8080/KAREL/webcontrol?str_mtn_mod=3&str_coord1=100&str_coord2=200&str_coord3=300&str_coord4=0&str_coord5=0&str_coord6=0" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "IK/FK and Quaternion Math Guide for FANUC KAREL Robot Programming (fanuc-karel-ik-fk-quaternion-guide)", "condition": "with_lesson", "status": 200, "content": "Based on the provided guide, here are the concrete and actionable fixes for the given errors:\n\n**Error 1: IK/FK and Quaternion Math Guide for FANUC KAREL Robot Programming**\n\n### Fix 1: IK/FK求解\n\n```karel\nkarel\nVAR\n target : XYZWPR\n jpos : JOINTPOS\n\nBEGIN\n -- 步骤1:设置正确的坐标系\n pose__set_userframe(1, 1) -- 激活用户坐标系1,组1\n pose__set_toolframe(1, 1) -- 激活工具坐标系1,组1\n\n -- 步骤2:读取目标位置\n target = pose__get_posreg_xyz(10, 1) -- 从PR[10]读取\n\n -- 步骤3:IK求解\n jpos = pose__solveIK(target, 1)\n\n -- 步骤4:必须检查成功标志\n IF NOT pose__get_ok THEN\n karelError(INVALID_INDEX, 'IK failed', ER_ABORT)\n ENDIF\n\n -- 步", "metrics": { "length": 658, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KAREL HTTP API — WebControl Robot Motion and Monitoring (fanuc-karel-http-api-webcontrol)", "condition": "plain", "status": 200, "content": "I'm happy to help you with the FANUC KAREL HTTP API error. However, I need more information about the error you're encountering. Could you please provide the exact error message you're seeing?\n\nThat being said, here are some general steps you can try to resolve the issue:\n\n1. **Check the API documentation**: Make sure you're using the correct API endpoint, parameters, and headers.\n2. **Verify the API key**: Ensure that you're passing the correct API key in the request headers.\n3. **Check the robot's status**: Verify that the robot is properly connected and online before making API requests.\n\nAssuming you've checked the above and still encounter issues, here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update the API configuration**\n\n1. Open the `fanuc-karel-http-api-webcontrol` configuration file (usually `config.json` or `config.yaml`) in a text editor.\n2. Update the `api_key` field with your actual API key.\n3. Update the `robot_ip` field with the IP address of your robot.\n\nExample configuration:\n```json\n{\n \"api_key\": \"YOUR_API_KEY_HERE\",\n \"robot_ip\": \"192.168.1.100", "metrics": { "length": 1101, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "IK/FK and Quaternion Math Guide for FANUC KAREL Robot Programming (fanuc-karel-ik-fk-quaternion-guide)", "condition": "plain", "status": 200, "content": "I can guide you through a common issue with IK/FK and Quaternion math in FANUC KAREL robot programming. The issue is likely related to the IK/FK solver or quaternion calculations not being performed correctly.\n\n**Issue:** IK/FK solver or quaternion calculations not being performed correctly.\n\n**Symptoms:**\n\n* IK/FK solver returns incorrect joint angles or poses.\n* Quaternion calculations result in NaN (Not a Number) or infinity values.\n\n**Fix:**\n\n1. **Verify IK/FK Solver Settings:**\n\n * Check the IK/FK solver settings in the robot program. Ensure that the correct solver type is selected (e.g., FK, IK, or Hybrid).\n * Verify that the solver parameters, such as the joint limits and constraints, are correctly set.\n * Run a diagnostic test to validate the IK/FK solver settings.\n\n ```c\n// Set IK/FK solver type\nIKSolverType = FK;\n\n// Set joint limits and constraints\nJointLimit1 = 0.0;\nJointLimit2 = 180.0;\nJointLimit3 = 90.0;\n\n// Run IK/FK solver\nIKResult = IKSolver(IKSolverType, JointLimit1, JointLimit2, Joint", "metrics": { "length": 1037, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KAREL: INTP-316 调用TP程序触发动作锁定 (fanuc-karel-intp-316-call-error-motion-lock)", "condition": "with_lesson", "status": 200, "content": "To fix the error `FANUC KAREL: INTP-316 调用TP程序触发动作锁定`, you can follow these steps:\n\n1. **Check the syntax of the CALL command**:\n\n Open a KAREL terminal and execute the following command:\n ```bash\nkarel\nCALL 'PROGRAM.TP' -- 正确:单引号 + .TP 扩展名\n```\n If you get an error message, make sure to enclose the program name with single quotes and add the `.TP` extension.\n\n Example:\n ```bash\nCALL 'TEST.TP'\n```\n If you're still getting the error, try calling the program without the single quotes:\n ```bash\nCALL TEST.TP\n```\n\n2. **Enable the $KAREL_ENB system variable**:\n\n Open a KAREL terminal and execute the following command:\n ```bash\nkarel\n$KAREL_ENB = 1\n```\n This enables the KAREL runtime.\n\n3. **Check the TP program's permissions**:\n\n Open a KAREL terminal and execute the following command:\n ```bash\nkarel\nCALL 'PROGRAM.TP'\n```\n", "metrics": { "length": 852, "commands": 8, "command_list": [ "karel", "CALL 'PROGRAM.TP' -- 正确:单引号 + .TP 扩展名", "CALL 'TEST.TP'", "CALL TEST.TP", "karel" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KAREL: INTP-316 调用TP程序触发动作锁定 (fanuc-karel-intp-316-call-error-motion-lock)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a conflict between the TP (Tool Path) program and the action lock in FANUC KAREL programming. Here's a step-by-step solution:\n\n1. **Stop the machining operation**: Immediately stop the machining operation by pressing the stop button or sending a stop command to the machine.\n\n2. **Unlock the action lock**: Send the following command to unlock the action lock:\n```\nM00\n```\nThis will release the action lock, allowing you to modify the TP program.\n\n3. **Edit the TP program**: Use a text editor to edit the TP program. The location of the TP program file may vary depending on your system configuration.\n\n For FANUC KAREL, the TP program file is usually located in the `C:\\Program Files\\FANUC\\KAREL\\TP` directory (or similar, depending on your installation path).\n\n4. **Check for conflicts**: Review the TP program for any conflicts with the action lock. Look for any lines of code that might be causing the conflict.\n\n5. **Modify the TP program**: If you find a conflict, modify the TP program to avoid it. For example, if the conflict is caused by a line of code that tries to execute an", "metrics": { "length": 1137, "commands": 1, "command_list": [ "M00" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ka-Boost: 8-Layer KAREL Module Architecture and Build System (fanuc-karel-ka-boost-architecture)", "condition": "with_lesson", "status": 200, "content": "根据 Ka-Boost 的 8 层模块架构和工具链,以下是解决 Ka-Boost 错误的具体步骤:\n\n**步骤 1:安装必要的工具**\n\n```bash\n# 安装 rossum 包管理器\nsudo apt-get install -y rossum\n\n# 安装 ktransw 转译器/预处理器\nsudo apt-get install -y ktransw\n\n# 安装 ninja 构建系统\nsudo apt-get install -y ninja-build\n\n# 安装 kpush 部署工具\nsudo apt-get install -y kpush\n```\n\n**步骤 2:配置 rossum 包管理器**\n\n在你的 Ka-Boost 项目的根目录下创建 `package.json`文件:\n```json\n{\n \"name\": \"my-ka-boost-project\",\n \"version\": \"1.0.0\",\n \"dependencies\": {\n \"ktransw\": \"^1.0.0\",\n \"ninja\": \"^1.9.0\",\n \"kpush\": \"^1.0.0\"\n }\n}\n```\n\n**步骤 3:生成 build.ninja 文件**\n\n```bash\n# 运", "metrics": { "length": 556, "commands": 5, "command_list": [ "sudo apt-get install -y rossum", "sudo apt-get install -y ktransw", "sudo apt-get install -y ninja-build", "sudo apt-get install -y kpush", "**步骤 3:生成 build.ninja 文件**" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Ka-Boost: 8-Layer KAREL Module Architecture and Build System (fanuc-karel-ka-boost-architecture)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect dependency in your `build.gradle` file. The Ka-Boost architecture requires the `karel-ka-boost-architecture` module to be included in your build configuration.\n\nHere's a step-by-step fix:\n\n**Step 1: Check your `build.gradle` file**\n\nOpen your `build.gradle` file and look for the `dependencies` section. It should contain a block like this:\n```groovy\ndependencies {\n // Your dependencies here\n}\n```\n**Step 2: Add the Ka-Boost dependency**\n\nAdd the following line to the `dependencies` block:\n```groovy\ndependencies {\n implementation 'fanuc-karel-ka-boost-architecture:ka-boost:8-layer'\n}\n```\nThis will include the Ka-Boost architecture module in your build configuration.\n\n**Step 3: Update the Ka-Boost version**\n\nIf you're using an older version of Ka-Boost, you may need to update it to the latest version. You can do this by adding the following line to the `build.gradle` file:\n```groovy\nrepositories {\n mavenCentral()\n}\n\ndependencies {\n implementation 'fanuc-karel-ka-boost-architecture:ka", "metrics": { "length": 1076, "commands": 5, "command_list": [ "**Step 2: Add the Ka-Boost dependency**", "Add the following line to the `dependencies` block:", "This will include the Ka-Boost architecture module in your build configuration.", "**Step 3: Update the Ka-Boost version**", "If you're using an older version of Ka-Boost, you may need to update it to the latest version. You can do this by adding the following line to the `build.gradle` file:" ], "has_command_block": true, "actionable": false, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "KAREL Pose Library API Reference — IK/FK, Quaternion, Matrix Transforms (fanuc-karel-kl-pose-api-reference)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to implement the missing functionality in the Karel library. Here are the concrete, actionable fixes:\n\n**1. IK/FK求解**\n\n```karel\n-- 逆运动学:笛卡尔→关节角\njoint_pose = pose__solveIK(cart_pose, grp_no)\n\n-- 正运动学:关节角→笛卡尔\ncart_pose = pose__solveFK(joint_pose, grp_no)\n\n-- 必须检查成功标志\nIF NOT pose__get_ok THEN\n // handle error\nELSE\n // continue with cart_pose\nENDIF\n```\n\n```karel\n--底层调用FANUC的CALC_JPOS_DATA和CALC_KINE_DATA\nfunction calc_jpos_data(pose) {\n // implementation using CALC_JPOS_DATA and CALC_KINE_DATA\n}\n\nfunction calc_kine_data(pose) {\n // implementation using CALC_JPOS_DATA and CALC_KINE_DATA\n}\n```\n\n**2. 四元数运算(避免万向锁)**\n\n```karel\n-- 欧拉角→四元数\nq = quaternion__pose_to_quat(pose)\n\n-- 四元数乘法(旋转组合)\nq", "metrics": { "length": 719, "commands": 1, "command_list": [ "**2. 四元数运算(避免万向锁)**" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "KAREL Pose Library API Reference — IK/FK, Quaternion, Matrix Transforms (fanuc-karel-kl-pose-api-reference)", "condition": "plain", "status": 200, "content": "I don't see any error message in your question. However, I'll provide a general guide on how to troubleshoot and fix common issues with the Karel Pose Library API.\n\nThe Karel Pose Library API is a C++ library used for computer vision and robotics tasks. If you're experiencing an error, it's likely related to one of the following:\n\n1. **Missing dependencies**: Make sure you have all the required dependencies installed, including the Karel Pose Library API.\n2. **Incorrect usage**: Double-check that you're using the API correctly, following the documentation and examples provided.\n3. **Outdated library**: Ensure that you're using the latest version of the Karel Pose Library API.\n\nTo fix the issue, follow these steps:\n\n### Step 1: Update dependencies\n\nIf you're using a package manager like `apt` or `brew`, update your dependencies to the latest version.\n\n```bash\n# Update dependencies (Ubuntu/Debian)\nsudo apt update\nsudo apt upgrade\n\n# Update dependencies (macOS with Homebrew)\nbrew upgrade\n```\n\n### Step 2: Rebuild the Karel Pose Library API\n\nIf you're using a package manager, try rebuilding the Karel Pose Library API.\n\n```bash\n# Rebuild dependencies (Ubuntu/De", "metrics": { "length": 1176, "commands": 3, "command_list": [ "sudo apt update", "sudo apt upgrade", "brew upgrade" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Unit Testing FANUC KAREL Programs with KUnit Framework (fanuc-karel-unit-testing-kunit)", "condition": "with_lesson", "status": 200, "content": "要解决 FANUC KAREL 语言的单元测试问题,需要按照以下步骤进行:\n\n**步骤 1:安装 KUnit**\n\n1. 下载 KUnit 的发布包:https://github.com/fanuc-karel/kunit/releases\n2. 将 `kunit.pc` 和 `vendor/strings.pc` 复制到机器人控制器\n3. 将 `kunit.h.kl` 复制到项目的支持目录或与测试文件同目录\n4. 在测试文件中添加 `%INCLUDE kunit.h`\n5. 翻译并部署 KAREL 语言程序到控制器\n\n**步骤 2:编写测试用例**\n\n1. 在 KAREL 语言中创建一个测试文件(例如 `test_add_int.kl`)\n2. 在测试文件中添加以下代码:\n```karel\nPROGRAM test_add_int\n%NOLOCKGROUP -- 浏览器运行 KAREL 必须\n%INCLUDE kunit.h\n\n-- 被测函数\nROUTINE add_int(l : INTEGER; r : INTEGER) : INTEGER\nBEGIN\n RETURN(l + r)\nEND add_int\n\n-- 测试用例:每个返回", "metrics": { "length": 537, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "UV-to-XYZWPR Pipeline — From 2D Slice Geometry to Robot Motion (fanuc-karel-uv-to-xyzwpr-pipeline)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect import statement in your Python code. Based on the provided information, it seems that the `karel` module is not properly imported.\n\nHere's a step-by-step fix:\n\n1. Open your Python script and locate the line where you're using the `karel` module.\n\n2. Check if the `karel` module is imported correctly. If it's not, add the following line at the top of your script:\n ```python\nimport karel\n```\n\n3. If you're using a specific class or function from the `karel` module, make sure to import it correctly. For example, if you're using the `new` class, you should import it like this:\n ```python\nfrom karel import new\n```\n\n4. If you're still encountering issues, ensure that the `karel` module is installed and available in your Python environment. You can check the installation by running the following command:\n ```bash\npip show karel\n```\n\n5. If the `karel` module is not installed, you can install it using pip:\n ```bash\npip install karel\n```\n\nAfter making these changes, your Python script should be", "metrics": { "length": 1076, "commands": 3, "command_list": [ "3. If you're using a specific class or function from the `karel` module, make sure to import it correctly. For example, if you're using the `new` class, you should import it like this:", "4. If you're still encountering issues, ensure that the `karel` module is installed and available in your Python environment. You can check the installation by running the following command:", "5. If the `karel` module is not installed, you can install it using pip:" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Unit Testing FANUC KAREL Programs with KUnit Framework (fanuc-karel-unit-testing-kunit)", "condition": "plain", "status": 200, "content": "To fix the error when unit testing FANUC KAREL programs with the KUnit framework, you need to install the KUnit framework and its dependencies. Here's a step-by-step guide with exact commands for a Linux system:\n\n**Step 1: Install KUnit and its dependencies**\n\n```bash\nsudo dnf install -y kunit\nsudo dnf install -y klibc\nsudo dnf install -y klibc-utils\n```\n\n**Step 2: Install the FANUC KAREL compiler**\n\nYou'll need to install the FANUC KAREL compiler, which is not a standard package. You can download it from the FANUC website or build it from source.\n\n**Download the FANUC KAREL compiler**\n\n```bash\nwget https://www.fanuc.co.jp/en/products/software/programmer/fk-karelsdk-2.3.0.tar.gz\ntar -xvf fk-karelsdk-2.3.0.tar.gz\n```\n\n**Build the FANUC KAREL compiler**\n\n```bash\ncd fk-karelsdk-2.3.0\n./configure\nmake\n```\n\n**Step 3: Compile your FANUC KAREL program", "metrics": { "length": 856, "commands": 8, "command_list": [ "sudo dnf install -y kunit", "sudo dnf install -y klibc", "sudo dnf install -y klibc-utils", "wget https://www.fanuc.co.jp/en/products/software/programmer/fk-karelsdk-2.3.0.tar.gz", "tar -xvf fk-karelsdk-2.3.0.tar.gz" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "UV-to-XYZWPR Pipeline — From 2D Slice Geometry to Robot Motion (fanuc-karel-uv-to-xyzwpr-pipeline)", "condition": "plain", "status": 200, "content": "I'm happy to help you troubleshoot the issue, but I need more information about the error message. Please provide the exact error message you're seeing.\n\nHowever, based on the error message you provided, it seems like the issue might be related to the fanuc-karel-uv-to-xyzwpr-pipeline library.\n\nHere are some general steps you can take to troubleshoot the issue:\n\n1. Check the library documentation: Make sure you're using the latest version of the library and that you're following the installation instructions correctly.\n2. Check for dependencies: The library might require additional dependencies to be installed. Check the library documentation to see if there are any specific dependencies required.\n3. Check the input data: Make sure the input data is in the correct format and that it's properly validated.\n\nIf you're still having trouble, please provide the exact error message you're seeing, and I'll do my best to help you troubleshoot the issue.\n\nThat being said, here are some general steps you can take to fix the issue:\n\n**Step 1: Update the library**\n\nTry updating the library to the latest version using pip:\n```bash\npip install --upgrade fanuc-karel-uv-to-xyzwpr-pipeline\n```\n**Step ", "metrics": { "length": 1202, "commands": 1, "command_list": [ "pip install --upgrade fanuc-karel-uv-to-xyzwpr-pipeline" ], "has_command_block": true, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: 1086 是代码行号而非错误码 (fanuc-kl-1086-is-line-number-not-error-code)", "condition": "plain", "status": 200, "content": "The error message indicates that the code `1086` is a line number, not an error code. To fix this, you need to replace the line number with the actual error code.\n\nHere's an example of how you can do this using a text editor:\n\n1. Open the file in which the line number is present.\n2. Locate the line number `1086` and replace it with the actual error code.\n\nIf you're using an IDE (Integrated Development Environment), you can also use the following steps:\n\n**For Visual Studio Code (VS Code):**\n\n1. Open the file in VS Code.\n2. Press `Ctrl + Shift + F` to find and replace the line number.\n3. In the Find dialog box, enter `1086` in the \"Find what\" field and leave the \"Replace with\" field blank.\n4. Click \"Find All\" and then click \"Replace All\" to replace all occurrences of the line number.\n\n**For IntelliJ IDEA:**\n\n1. Open the file in IntelliJ IDEA.\n2. Press `Ctrl + Shift + F` to find and replace the line number.\n3. In the Find dialog box, enter `1086` in the \"Find what\" field and leave the \"Replace with\" field blank", "metrics": { "length": 1024, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: 1086 是代码行号而非错误码 (fanuc-kl-1086-is-line-number-not-error-code)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you need to identify the line number in the KTRANS output and remove the incorrect assumption that it's an error code. Here's a step-by-step solution:\n\n1. Find the line number in the KTRANS output:\n```bash\ngrep -i \"1086\" lessons/contrib/fanuc-.md | wc -l\n```\nThis command searches for the line number 1086 in the FANUC documentation and counts the number of occurrences.\n\n2. Verify the line number is in the KTRANS output:\n```bash\ngrep -i \"1086\" lessons/contrib/fanuc-kl-1086-is-line-number-not-error-code.md\n```\nThis command searches for the specific file that contains the correct information about the line number 1086.\n\n3. Remove the incorrect assumption that 1086 is an error code:\n```bash\necho \"1086 is a line number, not an error code\" > lessons/contrib/fanuc-.md\n```\nThis command updates the FANUC documentation to reflect the correct information.\n\n4. Verify the change:\n```bash\ngrep -i \"1086\" lessons/contrib/fanuc-.md\n```\nThis command searches for the updated information in the F", "metrics": { "length": 1008, "commands": 4, "command_list": [ "grep -i \"1086\" lessons/contrib/fanuc-.md | wc -l", "grep -i \"1086\" lessons/contrib/fanuc-kl-1086-is-line-number-not-error-code.md", "echo \"1086 is a line number, not an error code\" > lessons/contrib/fanuc-.md", "grep -i \"1086\" lessons/contrib/fanuc-.md" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: BYTES_AHEAD 是 Karel 内置 Procedure (fanuc-kl-bytes-ahead-is-builtin-procedure)", "condition": "with_lesson", "status": 200, "content": "**解决 FANUC KL BYTES_AHEAD 是 Karel 内置 Procedure 错误的具体步骤**\n\n1. **复制并粘贴 BYTES_AHEAD 调用代码**\n\n ```karel\nkarel\n-- 示例1:轮询等待缓冲区有数据再读取,避免阻塞\nROUTINE wait_for_data(comm_file : FILE)\nVAR\n byte_count : INTEGER\nBEGIN\n REPEAT\n byte_count = BYTES_AHEAD(comm_file)\n -- 若缓冲区为空则短暂等待,避免 CPU 空转\n IF byte_count = 0 THEN\n DELAY 10\n ENDIF\n UNTIL byte_count 0\nEND wait_for_data\n```\n\n ```karel\nkarel\n-- 示例2:在 MM_RCV_NTFY.kl 中判断是否有完整消息帧可读\nVAR\n pending : INTEGER\n msg_buf : STRING[128]\n status : INTEGER\nBEGIN\n pending = BYTES_AHEAD(notify_file)\n IF pending = MIN_MSG_LEN THEN\n READ notify_file(msg_buf::status)\n -- 处理消息...\n END", "metrics": { "length": 641, "commands": 0, "command_list": [], "has_command_block": true, "actionable": false, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: BYTES_AHEAD 是 Karel 内置 Procedure (fanuc-kl-bytes-ahead-is-builtin-procedure)", "condition": "plain", "status": 200, "content": "The error message `FANUC KL: BYTES_AHEAD 是 Karel 内置 Procedure (fanuc-kl-bytes-ahead-is-builtin-procedure)` suggests that the `BYTES_AHEAD` procedure is not a built-in procedure in the FANUC KL programming language.\n\nTo fix this issue, you need to define the `BYTES_AHEAD` procedure yourself. Here's a simple example of how you can define it:\n\n```c\n// Define the BYTES_AHEAD procedure\nPROCEDURE BYTES_AHEAD(X, Y, N)\n VAR\n i: INT;\n BEGIN\n // Loop through the specified number of bytes\n FOR i := 1 TO N DO\n // Your code here to process each byte\n // For example, you can print the byte\n WRITE(X + Y + i);\n END;\n END;\n```\n\nHowever, if you want to use the `BYTES_AHEAD` procedure for reading bytes from a file or memory, you can use the following code:\n\n```c\n// Define the BYTES_AHEAD procedure\nPROCEDURE BYTES_AHEAD(X, Y, N)\n VAR\n buffer: ARRAY[1..N] OF BYTE;\n i: INT;\n BEGIN\n ", "metrics": { "length": 913, "commands": 1, "command_list": [ "However, if you want to use the `BYTES_AHEAD` procedure for reading bytes from a file or memory, you can use the following code:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: ERR_ABORT vs ERR_PAUSE 行为差异 (fanuc-kl-err-abort-vs-err-pause)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to a behavior difference between FANUC KL's ERR_ABORT and ERR_PAUSE commands. The error message indicates that there's a difference in the behavior of these two commands.\n\nTo resolve this issue, you need to understand the differences in the behavior of these two commands and adjust your code accordingly.\n\nERR_ABORT and ERR_PAUSE are both used to stop the program, but they behave differently:\n\n- ERR_ABORT stops the program immediately and resets all variables to their initial values.\n- ERR_PAUSE stops the program temporarily and allows you to resume execution at the point where the pause occurred.\n\nHere's an example of how you can modify your code to fix the issue:\n\n**Before:**\n```c\nERR_PAUSE\n; Your code here\nERR_ABORT\n```\n**After:**\n```c\n; Your code here\nERR_PAUSE\n; Store the current position and variables\nG90 G21\n; Your code here\nERR_ABORT\n; Restore the original values\nG90 G20\n```\nIn this modified code, we're storing the current position and variables before pausing the program. When we resume execution, we restore the original values.\n\nAlternatively, you can use the `ERRABORT` command with the `ABORT` option to stop", "metrics": { "length": 1176, "commands": 1, "command_list": [ "**After:**" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: ERR_ABORT vs ERR_PAUSE 行为差异 (fanuc-kl-err-abort-vs-err-pause)", "condition": "with_lesson", "status": 200, "content": "To fix the error FANUC KL: ERR_ABORT vs ERR_PAUSE 行为差异, you need to change the way you handle IPC timeouts in your FANUC KAREL program. Here's an example of how you can modify the `handle_ipc_timeout` routine to use `ERR_PAUSE` instead of `ERR_ABORT`:\n\n```karel\nROUTINE handle_ipc_timeout\nVAR\n status : INTEGER\nBEGIN\n -- 记录错误日志\n WRITE TPERROR ('IPC timeout, pausing current task only', CR)\n \n -- 仅暂停当前任务,保留程序号和上下文\n status = ERR_PAUSE\n \n -- 等待固定时间后重试(退避策略)\n DELAY 2000 -- 等待 2 秒\n \n -- 尝试重新建立 IPC 连接\n CALL reconnect_ipc(status)\n \n IF status < 0 THEN\n -- 多次重试失败后才考虑上报,但仍不使用 ERR_ABORT\n WRITE TPERROR ('IPC reconnect failed, notify operator', CR)\n ENDIF\nEND handle_ipc_timeout\n```\n\nIn this modified version, we use `ERR_PAUSE` to pause the current task, instead of", "metrics": { "length": 781, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: mm_module_h.kl 禁止 ROUTINE 声明 (fanuc-kl-mm-module-h-no-routine)", "condition": "with_lesson", "status": 200, "content": "解决FANUC KL: mm_module_h.kl 禁止 ROUTINE 声明(fanuc-kl-mm-module-h-no-routine)错误的步骤如下:\n\n1. **删除头文件中 ROUTINE 声明**:在 `mm_module_h.kl` 中删除所有 ROUTINE 声明,例如:\n\n ```kl\nkl\n-- ❌ 错误:头文件中不得出现 ROUTINE 声明\nROUTINE Check_Status(status_code : INTEGER) : BOOLEAN FROM MM_MODULE\nROUTINE Reset_Module FROM MM_MODULE\n```\n\n 变为:\n\n ```kl\nkl\n-- ✅ 正确:头文件只保留 TYPE / VAR / CONST\nTYPE\n MM_STATUS_T = STRUCTURE\n code : INTEGER\n message : STRING[64]\n active : BOOLEAN\n ENDSTRUCTURE\n\nVAR\n mm_status IN CMOS FROM MM_MODULE_H : MM_STATUS_T\n mm_err_cnt IN CMOS FROM MM_MODULE_H : INTEGER\n\nCONST\n MM_MAX_RETRY = 3\n MM_TIMEOUT = 5000\n```\n\n2. **在主程序中保留 ROUTINE 定义**:在 `MM_MODULE.kl`", "metrics": { "length": 675, "commands": 1, "command_list": [ "变为:" ], "has_command_block": true, "actionable": false, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC KL: mm_module_h.kl 禁止 ROUTINE 声明 (fanuc-kl-mm-module-h-no-routine)", "condition": "plain", "status": 200, "content": "The error message \"FANUC KL: mm_module_h.kl 禁止 ROUTINE 声明 (fanuc-kl-mm-module-h-no-routine)\" is indicating that there is a prohibited routine declared in the mm_module_h.kl file of the FANUC KL programming language.\n\nTo fix this issue, you need to remove the prohibited routine from the mm_module_h.kl file. Here are the steps to follow:\n\n**Step 1: Open the mm_module_h.kl file in the FANUC KL editor**\n\nYou can open the mm_module_h.kl file using the FANUC KL editor. The location of the editor may vary depending on your system configuration and the version of the FANUC KL software you are using.\n\n**Step 2: Locate and remove the prohibited routine**\n\nIn the mm_module_h.kl file, navigate to the line that contains the prohibited routine. This line should start with the keyword \"ROUTINE\".\n\nRemove the entire line that contains the prohibited routine. The line should be deleted completely, without leaving any residual code.\n\n**Step 3: Save the mm_module_h.kl file**\n\nAfter removing the prohibited routine, save the mm_module_h.kl file to update the changes.\n\n**Step 4: Compile", "metrics": { "length": 1080, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Payload Estimation — Auto and Manual Load Configuration (fanuc-payload-estimation)", "condition": "plain", "status": 200, "content": "The error you're encountering, `FANUC Payload Estimation — Auto and Manual Load Configuration`, typically occurs when there's an issue with the payload estimation process in FANUC robots. Here's a step-by-step guide to resolve this issue:\n\n**Before you start:**\n\n1. Ensure you have the latest software updates installed on your FANUC robot.\n2. Verify that the robot's configuration files are up-to-date.\n\n**Step 1: Clear the robot's configuration files**\n\n1. Log in to the robot's control panel using a PC or laptop connected to the robot's Ethernet port.\n2. Open the FANUC robot's configuration software (e.g., FANUC's Control Panel or FANUC's RobotStudio).\n3. Navigate to the \"Configuration\" or \"Settings\" menu and select \"Clear Configuration.\"\n4. Confirm that you want to clear the configuration files.\n\n**Step 2: Update the robot's software**\n\n1. Go to the FANUC website and download the latest software update for your robot model.\n2. Follow the instructions provided in the update package to install the new software.\n\n**Step 3: Recalculate the payload**\n\n1. Log in to the robot's control panel using a PC or laptop connected to", "metrics": { "length": 1134, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Profinet 32-bit Real Value Transfer Without KAREL (fanuc-profinet-32bit-real-value-transfer)", "condition": "with_lesson", "status": 200, "content": "To fix the FANUC Profinet 32-bit Real Value Transfer Without KAREL error, you need to modify the code that sends and receives 32-bit real values via Profinet. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Modify the send code (Robot → PLC)**\n\n```bash\n# Modify the send code to pack two 16-bit words into a 32-bit real value\nfanuc\nR[1:real] = 123.456\nR[2:scaled] = ROUND(R[1] 1000)\nR[3:low] = MOD(R[2], 65536)\nR[4:high] = (R[2] - R[3]) / 65536\nGO[1] = R[3]\nGO[2] = R[4]\n```\n\n**Step 2: Modify the receive code (PLC → Robot)**\n\n```bash\n# Modify the receive code to unpack two 16-bit words into a 32-bit real value\nfanuc\nR[3:low] = GI[1]\nR[4:high] = GI[2]\nR[2:scaled] = (R[4]", "metrics": { "length": 692, "commands": 7, "command_list": [ "fanuc", "R[1:real] = 123.456", "R[2:scaled] = ROUND(R[1] 1000)", "R[3:low] = MOD(R[2], 65536)", "R[4:high] = (R[2] - R[3]) / 65536" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Payload Estimation — Auto and Manual Load Configuration (fanuc-payload-estimation)", "condition": "with_lesson", "status": 200, "content": "To fix the FANUC payload estimation error, you need to estimate or manually configure the payload parameters correctly. Here's a step-by-step guide with exact commands:\n\n**Auto Estimation Method:**\n\n1. Install the end effector on the robot.\n2. Navigate to the payload estimation function in the FANUC controller:\n ```\n MENU → Setup → Frames → Payload → Setup Payload Estimation\n ```\n3. Select the estimation method (typically 4-point or 6-point):\n ```\n PAYLOAD ESTIMATION METHOD → 4-POINT or 6-POINT\n ```\n4. Execute the payload estimation:\n ```\n PAYLOAD ESTIMATION → Execute\n ```\n5. Save the results:\n ```\n PAYLOAD ESTIMATION → Save Results\n ```\n\n**Manual Configuration Method:**\n\n1. Navigate to the payload configuration function in the FANUC controller:\n ```\n MENU → Setup → Frames → Payload → Select Payload Number\n ```\n2. Enter the payload parameters:\n ```\n PAYLOAD[1:WeldGun] = Mass (kg) ; Center of gravity (X, Y, Z in mm) ; Inertia (Ix, Iy, Iz in kg·m²)\n ```\n Example:\n", "metrics": { "length": 1002, "commands": 6, "command_list": [ "MENU → Setup → Frames → Payload → Setup Payload Estimation", "PAYLOAD ESTIMATION METHOD → 4-POINT or 6-POINT", "PAYLOAD ESTIMATION → Execute", "PAYLOAD ESTIMATION → Save Results", "MENU → Setup → Frames → Payload → Select Payload Number" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Profinet 32-bit Real Value Transfer Without KAREL (fanuc-profinet-32bit-real-value-transfer)", "condition": "plain", "status": 200, "content": "The error \"FANUC Profinet 32-bit Real Value Transfer Without KAREL\" typically occurs when the FANUC Profinet device is not configured to use KAREL (Kernel Address Register Extension for Linux) or the kernel does not support KAREL.\n\nTo fix this issue, you'll need to update your kernel to a version that supports KAREL. Here's a step-by-step guide:\n\n**Method 1: Update your kernel using the package manager**\n\n1. Check if you're using a Linux distribution that supports KAREL. If not, consider upgrading to a supported distribution.\n2. Update your package manager to the latest version:\n - For Ubuntu/Debian: `sudo apt-get update && sudo apt-get upgrade`\n - For Red Hat/CentOS: `sudo yum update`\n - For Fedora: `sudo dnf update`\n\n3. Install the kernel update package:\n - For Ubuntu/Debian: `sudo apt-get install linux-headers-$(uname -r)`\n - For Red Hat/CentOS: `sudo yum install kernel-headers`\n - For Fedora: `sudo dnf install kernel-headers`\n\n4. Reboot your system: `sudo reboot`\n\n**Method 2", "metrics": { "length": 1005, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot PROFINET IO Configuration with PFN-CT Software (fanuc-profinet-io-software-config)", "condition": "with_lesson", "status": 200, "content": "根据问题描述,错误可能是由于PFN-CT软件无法正确识别FANUC机器人GSD文件,导致配置过程失败。以下是具体的解决方法和命令:\n\n**步骤1:检查PFN-CT软件版本**\n\n1. 打开PFN-CT软件,进入主界面。\n2. 在顶部菜单中选择“帮助”>“关于PFN-CT”。\n3. 检查软件版本,确保版本为V1.0.14或更高。\n\n**步骤2:检查FANUC机器人GSD文件**\n\n1. 将FANUC机器人GSD文件复制到PFN-CT软件的GSD文件夹(通常位于PFN-CT安装目录下的“GSD”文件夹)。\n2. 在PFN-CT主界面中,选择“设备”>“新设备”。\n3. 选择“FANUC”作为设备类型,输入机器人ID和其他相关信息。\n4. 检查设备信息,确保GSD文件被正确加载。\n\n**步骤3:配置IO模块**\n\n1. 在PFN-CT主界", "metrics": { "length": 371, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC PROFINET Communication with Siemens S7-1200 and External Startup (fanuc-profinet-s7-1200-external-startup)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, here's a step-by-step guide to fix the FANUC PROFINET communication with Siemens S7-1200 and external startup issue:\n\n**Hardware Preparation and Network Configuration**\n\n1. Install the PROFINET adapter card on the FANUC robot (e.g., A05B-2600 series PCI card).\n2. Configure the FANUC side PROFINET parameters:\n\t* Open the FANUC menu and navigate to `SETUP` > `Profinet`.\n\t* Set the IP address and device name to match the S7-1200's settings.\n\t* Ensure both devices are on the same network segment.\n\n**TIA Portal Configuration**\n\n1. Import the FANUC GSD file (download from the FANUC website for the correct version) into TIA Portal:\n\t* Open TIA Portal and create a new project.\n\t* Go to `Project` > `Import` > `GSD File`.\n\t* Select the FANUC GSD file and follow the import process.\n2. Add the FANUC device as a PROFINET device in the project:\n\t* In the TIA Portal project window, right-click on the `Devices` folder and select `Add", "metrics": { "length": 966, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC PROFINET Communication with Siemens S7-1200 and External Startup (fanuc-profinet-s7-1200-external-startup)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to the FANUC PROFINET communication with a Siemens S7-1200 controller. Here's a step-by-step solution to resolve the issue:\n\n**Step 1: Check the PROFINET Configuration**\n\n1. Log in to the S7-1200 controller and navigate to the PROFINET configuration menu.\n2. Select \"PROFINET\" and then \"Device Settings\" (or \"Device Configuration\").\n3. Check if the PROFINET communication is enabled and if the device is correctly configured.\n\n**Step 2: Configure the External Startup**\n\n1. Go to the \"Start/Stop\" menu and select \"Start/Stop\" (or \"Start/Stop Device\").\n2. Select \"External Startup\" (or \"External Start\") and configure the following settings:\n\t* Set the \"External Start\" flag to \"Enabled\".\n\t* Set the \"External Start Time\" to the desired time (e.g., 08:00).\n\t* Set the \"External Start Date\" to the desired date (e.g., 2024-02-01).\n3. Save the changes.\n\n**Step 3: Configure the FANUC PROFINET Configuration**\n\n1. Log in to the FANUC", "metrics": { "length": 970, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot Program Inspection Methodology — Systematic Check Guide (fanuc-program-inspection-methodology)", "condition": "with_lesson", "status": 200, "content": "To fix the error, we'll need to identify the specific problem and provide a concrete, actionable fix with exact commands. Since the provided text is a guide, I'll assume a typical FANUC robot program inspection methodology and provide a general fix.\n\n**Assumptions:**\n\n* The robot program is written in FANUC's G-code format.\n* The program contains a signal mapping error, safety violation, or logic bug.\n* The inspection categories are being used to identify the issue.\n\n**Fix:**\n\nLet's assume the issue is with Signal Check (All Robots) and Collision Zone FINE Point Check. We'll focus on fixing the signal mapping error and collision zone safety violation.\n\n**Signal Check (All Robots):**\n\n1. Verify signal number matches configuration standard:\n\n ```gcode\n; Check signal number matches configuration standard\n; Signal ranges:\n; DIDO-PLC: 1-512 (PLC communication)\n; DIDO-Connection: 513-2648 (ISV vision, etc.)\n; DIDO-Tool: 2649-4096 (end effector tools)\n\n; Check signal number\nIF (SI1 == 100) THEN\n MSG(\"Signal 1 is out of range", "metrics": { "length": 1065, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "FANUC Robot PROFINET IO Configuration with PFN-CT Software (fanuc-profinet-io-software-config)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the PFN-CT software not being able to find the PROFINET IO configuration file. Here's a step-by-step guide to fix this issue:\n\n**Step 1: Check if the PROFINET IO configuration file exists**\n\n1. Open a command prompt or terminal window as an administrator.\n2. Navigate to the directory where you installed the PFN-CT software (usually `C:\\Program Files\\FANUC\\PFN-CT` or `C:\\Program Files (x86)\\FANUC\\PFN-CT`).\n3. Run the following command to check if the configuration file exists:\n```bash\ndir /s /b \"PROFINET_IO.config\"\n```\nIf the file is not found, proceed to the next step.\n\n**Step 2: Create the PROFINET IO configuration file**\n\n1. Create a new file named `PROFINET_IO.config` in the same directory where you installed the PFN-CT software.\n2. Open the file in a text editor (such as Notepad or Notepad++).\n3. Add the following configuration settings to the file:\n```xml\n\n{{ document.name }}\n```\n\nIn this example, the `url` field is used directly in the `href` attribute, without manual construction.\n\nBy following these steps, you can ensure that the correct URL is used to access the Feishu document, and avoid", "metrics": { "length": 1103, "commands": 8, "command_list": [ "import requests", "response = requests.get('https://open.feishu.cn/document/api/v1/document/your-document-id')", "if response.status_code == 200:", "document_data = response.json()", "url = document_data['url']" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "cc connect feishu display optimization (feishu-display-optimization-cc-connect)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect dependency in your `pom.xml` file for the Feishu Connect library.\n\nTo fix this issue, you need to add the following dependency to your `pom.xml` file:\n\n```xml\n\n com.alibaba\n feishu-connect\n 1.0.0\n\n```\n\nHere's how you can add it:\n\n1. Open your `pom.xml` file in an editor.\n2. Add the following XML code inside the `` section:\n\n```xml\n\n \n \n com.alibaba\n feishu-connect\n 1.0.0\n \n\n```\n\n3. Save the changes to your `pom.xml` file.\n\nAfter making these changes, you should be able to resolve the error and successfully compile your project.\n\nPlease note that the version number may vary depending on the actual version of the library you're using. Make sure to check the library's documentation or the Maven repository", "metrics": { "length": 1078, "commands": 3, "command_list": [ "Here's how you can add it:", "1. Open your `pom.xml` file in an editor.", "2. Add the following XML code inside the `` section:" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "cc connect feishu display optimization (feishu-display-optimization-cc-connect)", "condition": "with_lesson", "status": 200, "content": "To fix the error `cc connect feishu display optimization (feishu-display-optimization-cc-connect)`, follow these steps:\n\n**Step 1: Stop the running cc-connect instance**\n\n```bash\ncc-connect stop --force\n```\n\n**Step 2: Create a new configuration file for cc-connect**\n\n```bash\nmkdir -p ~/.cc-connect\ntouch ~/.cc-connect/config.toml\n```\n\n**Step 3: Add the display settings to the configuration file**\n\n```toml\n[display]\nmode = \"quiet\"\nthinking_messages = false\nthinking_max_len = 0\ntool_max_len = 0\ntool_messages = false\nshow_context_indicator = false\nreply_footer = false\n```\n\n**Step 4: Restart the cc-connect instance**\n\n```bash\ncc-connect start\n```\n\n**Step 5: Verify the changes**\n\n```bash\ncc-connect logs --force\n```\n\nThis will display the logs, and you should see no tool call messages or context indicators.\n\n**Step 6: Test the changes**\n\n```bash\ncc connect\n```\n\nSend a message in the Feishu chat, and verify that there are no tool call messages or context indicators.\n\nIf everything is set up correctly, you should", "metrics": { "length": 1019, "commands": 7, "command_list": [ "cc-connect stop --force", "mkdir -p ~/.cc-connect", "touch ~/.cc-connect/config.toml", "**Step 4: Restart the cc-connect instance**", "**Step 5: Verify the changes**" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu doc url use api return (feishu-doc-url-use-api-return)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect API key in the Feishu SDK. Here's a step-by-step solution to fix the issue:\n\n**Prerequisites:**\n\n1. Install the Feishu SDK using npm or yarn:\n\n```bash\nnpm install feishu-sdk\n# or\nyarn add feishu-sdk\n```\n\n2. Create a Feishu app and obtain an app ID and app secret.\n\n**Fixing the error:**\n\n1. Import the Feishu SDK and initialize it with your app ID and app secret:\n\n```javascript\nconst Feishu = require('feishu-sdk');\n\nconst appId = 'your_app_id';\nconst appSecret = 'your_app_secret';\n\nFeishu.init({\n appId,\n appSecret,\n});\n```\n\n2. Replace `'your_app_id'` and `'your_app_secret'` with your actual Feishu app ID and app secret.\n\n3. Use the `Feishu` object to create a doc URL using the `docUrlUseApi` method:\n\n```javascript\nFeishu.docUrlUseApi({\n docId: 'your_doc_id',\n docType: 'your_doc_type',\n content: 'your_doc_content',\n ", "metrics": { "length": 900, "commands": 4, "command_list": [ "npm install feishu-sdk", "yarn add feishu-sdk", "2. Replace `'your_app_id'` and `'your_app_secret'` with your actual Feishu app ID and app secret.", "3. Use the `Feishu` object to create a doc URL using the `docUrlUseApi` method:" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DeepSeek TUI — Feishu MCP Server Setup & Permission Boundaries (feishu-mcp-server-deepseek-tui-setup)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fixing the error:\n\n**Step 1: Create a new file `mcp.json` in the root directory of your project**\n\nCreate a new file named `mcp.json` in the root directory of your project. This file will contain the configuration for the MCP server.\n\n```json\n{\n \"servers\": {\n \"feishu\": {\n \"command\": \".venv/bin/python3\",\n \"args\": [\"server.py\"],\n \"env\": {\n \"FEISHU_APP_ID\": \"cli_xxxxx\",\n \"FEISHU_APP_SECRET\": \"xxxxxxxx\"\n }\n }\n }\n}\n```\n\n**Step 2: Update the `server.py` file to read environment variables from `mcp.json`**\n\nUpdate the `server.py` file to read the environment variables from `mcp.json`. Add the following lines at the top of the file:\n\n```python\nimport json\nimport os\n\nwith open('mcp.json') as f:\n mcp_config = json.load(f)\n\nif 'FEISHU_APP_ID' not in os.environ:\n print(\"Error: FEISHU_APP_ID environment variable is not set\")\n exit(1)\n\nif 'FEISHU_APP", "metrics": { "length": 930, "commands": 2, "command_list": [ "**Step 2: Update the `server.py` file to read environment variables from `mcp.json`**", "Update the `server.py` file to read the environment variables from `mcp.json`. Add the following lines at the top of the file:" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DeepSeek TUI — Feishu MCP Server Setup & Permission Boundaries (feishu-mcp-server-deepseek-tui-setup)", "condition": "plain", "status": 200, "content": "The error you're encountering suggests that there's an issue with the setup or permissions of the Feishu MCP Server with DeepSeek TUI. To resolve this, you'll need to make sure that the `feishu-mcp-server-deepseek-tui-setup` command is executed with the correct permissions and environment variables. Here's a step-by-step fix:\n\n**Step 1: Update the Feishu MCP Server**\n\nBefore fixing the permission issue, ensure that the Feishu MCP Server is updated to the latest version. Run the following command:\n\n```bash\ndocker-compose up -d --build\n```\n\n**Step 2: Create a new directory for the DeepSeek TUI**\n\nCreate a new directory for the DeepSeek TUI and navigate into it:\n\n```bash\nmkdir deepseek-tui\ncd deepseek-tui\n```\n\n**Step 3: Copy the DeepSeek TUI configuration files**\n\nCopy the configuration files from the Feishu MCP Server's configuration directory to the new directory:\n\n```bash\ncp -r /path/to/feishu-mcp-server-deepseek-tui-setup/config/* .\n```\n\nReplace `/path/to/feishu-mcp-server-deepseek-tui-setup/config/` with the", "metrics": { "length": 1025, "commands": 4, "command_list": [ "docker-compose up -d --build", "mkdir deepseek-tui", "cd deepseek-tui", "cp -r /path/to/feishu-mcp-server-deepseek-tui-setup/config/* ." ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu upload file type opus (feishu-upload-file-type-opus)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to correct the field name in the `data` dictionary from `file_length` to `file_type`. Here's how you can do it:\n\nFirst, create a new file named `feishu-upload-file-type-opus.py` and add the following code:\n\n```python\nimport io\n\ndef upload_file(file_name, file_type):\n # Define the data dictionary with the correct field name\n data = {'file_type': file_type, 'file_name': file_name}\n \n # Create a bytes buffer for the file data\n files = {'file': (file_name, io.BytesIO(), 'audio/ogg')}\n \n # Return the data and files\n return data, files\n\n# Example usage\nfile_name = 'voice.ogg'\nfile_type = 'opus'\ndata, files = upload_file(file_name, file_type)\n\n# Print the data and files\nprint(data)\nprint(files)\n```\n\nNext, run the following commands in your terminal to verify the fix:\n\n```bash\npython feishu-upload-file-type-opus.py\n\ngrep -i feishu lessons/contrib/feishu-.md 2/dev/null | wc -l\necho Feishu verified\n```\n\nIf everything", "metrics": { "length": 971, "commands": 1, "command_list": [ "Next, run the following commands in your terminal to verify the fix:" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu upload file type opus (feishu-upload-file-type-opus)", "condition": "plain", "status": 200, "content": "The error you're encountering is related to Feishu's API restrictions on file types. By default, Feishu's API does not support uploading Opus files (.opus). \n\nHere's a concrete, actionable fix:\n\n**Solution 1: Convert Opus to WAV**\n\nYou can convert the Opus file to WAV using an online converter or a command-line tool like `ffmpeg`.\n\n**Using FFmpeg (on Linux/macOS):**\n\n```bash\nffmpeg -i input.opus output.wav\n```\n\n**Using FFmpeg (on Windows):**\n\nYou can use the `ffmpeg` executable from the official website.\n\n1. Download the latest version of `ffmpeg` for Windows from the official website.\n2. Extract the downloaded zip file to a folder of your choice (e.g., `C:\\ffmpeg\\bin`).\n3. Open a command prompt and navigate to the folder where `ffmpeg` is located.\n4. Run the following command to convert the Opus file to WAV:\n\n```bash\nffmpeg -i input.opus output.wav\n```\n\n**Solution 2: Use a different file type**\n\nIf you cannot convert the Opus file to WAV, you can try using a different file type that Feishu's API supports. For example, you", "metrics": { "length": 1038, "commands": 2, "command_list": [ "ffmpeg -i input.opus output.wav", "ffmpeg -i input.opus output.wav" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu webhook url env config (feishu-webhook-url-env-config)", "condition": "with_lesson", "status": 200, "content": "Here's a step-by-step guide to fix the error:\n\n**Step 1: Rotate app_secret (飞书开放平台后台操作)**\n\n* Log in to your Feishu developer dashboard and navigate to the \"App Secret\" page.\n* Click on \"Rotate\" to generate a new app secret.\n* Copy the new app secret and save it securely.\n\n**Step 2: Remove config.yaml from git index**\n\n* Run the following command to remove config.yaml from the git index:\n\n ```bash\ngit rm --cached config.yaml\n```\n\n**Step 3: Update config.yaml to use environment variables**\n\n* Open the config.yaml file and replace the app_secret with a placeholder that uses an environment variable. For example:\n\n ```yml\nfeishu-webhook-url: https://open.feishu.cn/open-apis/hook\napp_id: ${FEISHU_APP_ID}\napp_secret: ${FEISHU_APP_SECRET}\n```\n\n**Step 4: Add config.yaml to .gitignore**\n\n* Open the .gitignore file and add the following line:\n\n ```\nconfig.yaml\n```\n\n**Step 5: Store the new app_secret in ~/.bashrc**\n\n* Run the following command", "metrics": { "length": 968, "commands": 3, "command_list": [ "git rm --cached config.yaml", "**Step 4: Add config.yaml to .gitignore**", "* Open the .gitignore file and add the following line:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "feishu webhook url env config (feishu-webhook-url-env-config)", "condition": "plain", "status": 200, "content": "The error message indicates that the `feishu-webhook-url-env-config` configuration is not set. This configuration is used to store the Webhook URL of Feishu in an environment variable.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Install the required package**\n\nIf you haven't installed the `dotenv` package yet, run the following command:\n```bash\nnpm install dotenv\n```\n**Step 2: Create a `.env` file**\n\nCreate a new file named `.env` in the root of your project directory. This file will store the environment variables, including the Feishu Webhook URL.\n\n**Step 3: Configure the Feishu Webhook URL in the `.env` file**\n\nAdd the following line to the `.env` file:\n```makefile\nFEISHU_WEBHOOK_URL=https://openfeishu.cn/api/v1/webhook\n```\nReplace `https://openfeishu.cn/api/v1/webhook` with your actual Feishu Webhook URL.\n\n**Step 4: Update the `feishu-webhook-url-env-config` configuration**\n\nRun the following command to update the `feishu-webhook-url-env-config` configuration:\n```bash\nnpm run", "metrics": { "length": 1017, "commands": 4, "command_list": [ "npm install dotenv", "Replace `https://openfeishu.cn/api/v1/webhook` with your actual Feishu Webhook URL.", "**Step 4: Update the `feishu-webhook-url-env-config` configuration**", "Run the following command to update the `feishu-webhook-url-env-config` configuration:" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu WebSocket 404 Error - HTTP Webhook Required (feishu-websocket-404-error-http-webhook-required)", "condition": "with_lesson", "status": 200, "content": "解决 Feishu WebSocket 404 Error - HTTP Webhook Required 的方法是使用 HTTP Webhook 回调模式来接收消息。下面是一个具体的示例:\n\n**步骤 1:搭建可公网访问的 HTTP 服务**\n\n我们将使用 Flask 来创建一个 HTTP 服务。\n```bash\npip install flask\n```\n**步骤 2:创建 Flask 应用**\n\n```python\nfrom flask import Flask, request, jsonify\nimport hashlib\nimport hmac\n\napp = Flask(__name__)\n\nFEISHU_VERIFICATION_TOKEN = \"your_verification_token\"\nFEISHU_ENCRYPT_KEY = \"your_encrypt_key\"\n```\n**步骤 3:处理飞书 URL 验证请求**\n\n```python\n@app.route(\"/webhook/feishu\", methods=[\"POST\"])\ndef feishu_webhook():\n data = request.json\n\n # 处理飞书 URL 验证请求(首次配置时)\n if data.get(\"type\") == \"url_verification\":\n challenge = data.get(\"challenge\")\n return jsonify({\"challenge\": challenge})\n```\n**步骤 4:处理消息事件**\n\n```python\n # 处理消息事件\n event = data", "metrics": { "length": 758, "commands": 3, "command_list": [ "pip install flask", "**步骤 3:处理飞书 URL 验证请求**", "**步骤 4:处理消息事件**" ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu WebSocket 404 Error - HTTP Webhook Required (feishu-websocket-404-error-http-webhook-required)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to Feishu's WebSocket API requiring an HTTP webhook for authentication. To resolve this issue, you need to set up an HTTP webhook in Feishu's dashboard.\n\nHere are the steps to follow:\n\n1. **Log in to the Feishu dashboard**: Go to the Feishu website ([https://open.feishu.cn/](https://open.feishu.cn/)) and log in with your account credentials.\n\n2. **Create a new webhook**: Navigate to the \"App\" tab, then click on \"Webhooks\" and click the \"+\" button to create a new webhook.\n\n3. **Configure the webhook settings**: In the \"Webhook Settings\" section, you'll need to provide the following details:\n\n * **App ID**: Enter your Feishu App ID.\n * **App Secret**: Enter your Feishu App Secret.\n * **Webhook URL**: Enter the URL where the Feishu WebSocket events will be sent. This can be a local development server, a cloud function, or any other endpoint that can receive HTTP requests.\n * **Event Types**: Select the event types you want to receive from Feishu. Common event types include `", "metrics": { "length": 1046, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu WikiBatch Download:文件类型Handling策略 (feishu-wiki-batch-download)", "condition": "plain", "status": 200, "content": "The error \"Feishu WikiBatch Download:文件类型Handling策略\" typically indicates that the file type handling strategy is not properly configured for the Feishu WikiBatch Download plugin.\n\nTo fix this issue, you'll need to update the `feishu-wiki-batch-download` plugin to the latest version. Here are the steps:\n\n1. Open your terminal and navigate to your project directory.\n2. Run the following command to update the plugin:\n```bash\nnpm install feishu-wiki-batch-download@latest\n```\nor if you are using yarn:\n```bash\nyarn add feishu-wiki-batch-download@latest\n```\n3. After updating the plugin, restart your Node.js application or server.\n4. If the issue persists, try to check the Feishu WikiBatch Download documentation for any updates or changes to the configuration options.\n\nIf none of these steps work, you may need to provide more details about your project setup, such as the version of Node.js and npm you're using, and any other plugins or configurations that might be relevant to the issue.\n\nHere's an example of how to configure the file type handling strategy in the `feishu-wiki-batch-download` plugin:\n\n```javascript\n", "metrics": { "length": 1124, "commands": 2, "command_list": [ "npm install feishu-wiki-batch-download@latest", "yarn add feishu-wiki-batch-download@latest" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Feishu WikiBatch Download:文件类型Handling策略 (feishu-wiki-batch-download)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, here's a concrete, actionable fix for the Feishu WikiBatch Download error:\n\n**Step 1: Install required Python libraries**\n\nTo handle file types and merge single-character lines, you need to install the `python` library. Run the following command:\n\n```bash\npip install python\n```\n\n**Step 2: Create a Python script for handling single-character lines**\n\nCreate a new file named `merge_single_chars.py` with the following content:\n\n```python\ndef merge_single_chars(line):\n if len(line) == 1:\n buffer = line\n else:\n if buffer:\n result.append(buffer)\n buffer = \"\"\n result.append(line)\n\n return result\n\nwith open('output.txt', 'r') as f:\n lines = f.readlines()\n\nresult = []\nfor line in lines:\n line = line.strip()\n merged_line = merge_single_chars(line)\n result.extend(merged_line)\n\nwith open('output.txt', 'w') as f:\n f.writelines(result)\n```\n\nThis script reads a file named `output.txt`, merges single-character lines, and writes the result back to the same file.\n\n**Step 3: Create a Python script for handling PDF files**\n\nTo handle PDF", "metrics": { "length": 1135, "commands": 1, "command_list": [ "pip install python" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ffmpeg audio libopus not ogg (ffmpeg-audio-libopus-not-ogg)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"ffmpeg audio libopus not ogg\" where the output OGG file is 0 bytes, you need to specify the correct audio codec and parameters. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Delete the existing output file (if it exists)**\n\n```bash\nos.remove output.ogg\n```\n\n**Step 2: Run the following command to convert the audio file to OGG using libopus codec**\n\n```bash\nffmpeg -i input.wav -ar 24000 -ac 1 -c:a libopus output.ogg\n```\n\nHere's a breakdown of the command:\n\n* `-i input.wav`: specifies the input audio file\n* `-ar 24000`: sets the audio sampling rate to 24 kHz\n* `-ac 1`: sets the number of audio channels to 1 (mono)\n* `-c:a libopus`: specifies the audio codec as libopus\n* `output.ogg`: specifies the output file name\n\n**Note:**\n\n* Make sure to replace `input.wav` and `output.ogg` with your actual file names.\n* If you want to convert multiple files, you can use a loop or pipe the input files to `ffmpeg`.\n\nExample with multiple files:\n```bash", "metrics": { "length": 986, "commands": 2, "command_list": [ "os.remove output.ogg", "ffmpeg -i input.wav -ar 24000 -ac 1 -c:a libopus output.ogg" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ffmpeg audio libopus not ogg (ffmpeg-audio-libopus-not-ogg)", "condition": "plain", "status": 200, "content": "The error you're encountering, `ffmpeg-audio-libopus-not-ogg`, typically occurs when you're trying to use the Libopus audio codec with FFmpeg, but FFmpeg is not configured to include the OGG container format. Here's a step-by-step solution to fix this issue:\n\n**Step 1: Install FFmpeg with OGG support**\n\nIf you haven't installed FFmpeg yet, you can download the latest version from the official website: https://ffmpeg.org/download.html\n\nFor most Linux distributions, you can install FFmpeg using your package manager. Here are the commands for popular distributions:\n\n* Ubuntu/Debian: `sudo apt-get update && sudo apt-get install ffmpeg`\n* Red Hat/Fedora: `sudo dnf install ffmpeg`\n* Arch Linux: `sudo pacman -S ffmpeg`\n\n**Step 2: Verify OGG support**\n\nTo ensure that FFmpeg is configured to include OGG support, run the following command:\n\n```bash\nffmpeg -version\n```\n\nLook for the line that says \"libopus\" and \"libogg\" in the output. If you don't see them, you might need to reconfigure FFmpeg.\n\n**Step 3: Reconfigure FFmpeg (if necessary)**\n\nIf you", "metrics": { "length": 1059, "commands": 1, "command_list": [ "ffmpeg -version" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "firewall port open not public (firewall-port-open-not-public)", "condition": "with_lesson", "status": 200, "content": "To resolve the error \"firewall port open not public\" when opening port 10086 for WCFerry, you need to understand the difference between a firewall rule and internal network traversal (also known as \"port forwarding\" or \"nat-ping\").\n\nHere are the steps to fix the issue:\n\n**Step 1: Open a command prompt or terminal**\n\nOpen a command prompt or terminal on your Windows machine.\n\n**Step 2: Open the Windows Defender Firewall with Advanced Security console**\n\nType the following command and press Enter:\n```\nnetsh advfirewall firewall\n```\nThis will open the Windows Defender Firewall with Advanced Security console.\n\n**Step 3: Check the current firewall rule**\n\nType the following command and press Enter:\n```\nnetsh advfirewall firewall show rule name=\"WCFerry\" dir=in action=allow protocol=TCP localport=10086\n```\nThis will display the current firewall rule for port 10086. If you don't see any rule, proceed to the next step.\n\n**Step 4: Create a new firewall rule**\n\nType the following command and press Enter:\n```\nnetsh advfirewall firewall add rule name=\"WCFerry\" dir=in action=allow protocol=TCP localport=10086\n", "metrics": { "length": 1114, "commands": 2, "command_list": [ "netsh advfirewall firewall", "netsh advfirewall firewall show rule name=\"WCFerry\" dir=in action=allow protocol=TCP localport=10086" ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fiverr PerimeterX captcha blocks headless seller gig creation (fiverr-perimeterx-blocks-seller-automation)", "condition": "plain", "status": 200, "content": "The error message you're encountering is likely due to a recent change in PerimeterX's CAPTCHA policy that requires a visible browser to verify captchas. Here's a concrete, actionable fix to automate seller gig creation on Fiverr while avoiding the CAPTCHA:\n\n**Step 1: Install the required libraries**\n\nYou'll need to install the `selenium` and `pyperclip` libraries to automate browser interactions and handle CAPTCHAs.\n\n```bash\npip install selenium pyperclip\n```\n\n**Step 2: Set up your browser**\n\nWe'll use a headless browser (Chrome) to automate the process. You can install the ChromeDriver using the following command:\n\n```bash\nwget https://chromedriver.storage.googleapis.com/104.0.5117.44/chromedriver_linux64.zip\nunzip chromedriver_linux64.zip\nmv chromedriver /usr/local/bin/chromedriver\n```\n\n**Step 3: Create a Python script**\n\nCreate a new Python file (e.g., `fiverr_seller_automation.py`) and add the following code:\n\n```python\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom selenium.webdriver.common.by import By\nfrom", "metrics": { "length": 1129, "commands": 4, "command_list": [ "pip install selenium pyperclip", "wget https://chromedriver.storage.googleapis.com/104.0.5117.44/chromedriver_linux64.zip", "unzip chromedriver_linux64.zip", "mv chromedriver /usr/local/bin/chromedriver" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "firewall port open not public (firewall-port-open-not-public)", "condition": "plain", "status": 200, "content": "The error \"firewall port open not public\" typically occurs when a port is open on your firewall, but the firewall doesn't allow incoming connections from the public internet. Here's a step-by-step solution:\n\n**Assumptions:**\n\n* You're using a Linux-based system (e.g., Ubuntu, Debian, CentOS).\n* You have root access to the system.\n\n**Fix:**\n\n1. **Check the firewall rules:**\n Open a terminal and run the following command to check the current firewall rules:\n\n ```bash\nsudo ufw status\n```\n\n If you're using `iptables`, run:\n\n ```bash\nsudo iptables -n --list\n```\n\n This will show you the current firewall rules.\n\n2. **Allow incoming traffic on the specific port:**\n To allow incoming traffic on a specific port, you can use one of the following methods:\n\n **Method 1: Using `ufw` (if available)**\n ```bash\nsudo ufw allow \n```\n\n Replace `` with the port number you want to allow (e.g., `22` for SSH).\n\n **Method 2: Using `iptables`**\n ```bash\nsudo iptables -A INPUT -p tcp", "metrics": { "length": 1005, "commands": 3, "command_list": [ "sudo ufw status", "sudo iptables -n --list", "sudo ufw allow " ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Game MCP: GAME OVER Restart Flow (game-mcp-game-over-restart-flow)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"Game MCP: GAME OVER Restart Flow\", you need to follow the correct sequence of commands as outlined in the verified lesson. Here's a concrete, actionable fix with exact commands:\n\n1. Verify the game state is GAME OVER:\n\n ```bash\n\n```\n\n2. Initialize a new game session:\n\n ```bash\n\n```\n\n3. Wait for confirmation and check the initial state:\n\n ```bash\n\n```\n\n4. Proceed with new game commands:\n\n ```bash\n\n```\n\n5. Verify the new game state:\n\n ```bash\n\n```\n\nHere's the complete command sequence:\n\n```bash\n\n\n\n\n\n```\n\nBy following this sequence, you can ensure that the game state is correctly initialized and that the game can be restarted without errors.\n\nTo verify that the MCP is working correctly, you can check the MCP documentation or the game's official resources to confirm the correct sequence of commands. Additionally, you can use tools like `grep` to search for MCP commands in the documentation or other resources.\n\nFor example, you can use the following `", "metrics": { "length": 1136, "commands": 10, "command_list": [ "", "", "", "", "" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Fiverr PerimeterX captcha blocks headless seller gig creation (fiverr-perimeterx-blocks-seller-automation)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of Fiverr PerimeterX captcha blocks headless seller gig creation, you can follow these steps:\n\n1. **Do not loop on manage_gigs/create in headless**: Modify your script to skip this step when using a headless browser.\n\n```python\n# Before\nawait page.goto('https://www.fiverr.com/manage_gigs/create')\n\n# After\nif not page.url().endswith('/manage_gigs/create'):\n await page.goto('https://www.fiverr.com/manage_gigs')\n```\n\n2. **Use a human-attended browser (same profile) to pass the challenge once**: Create a separate browser instance with the same profile as the headless browser.\n\n```python\n# Before\nbrowser = await playwright.chromium.launch(headless=True)\npage = await browser.newPage()\n\n# After\nheadless_browser = await playwright.chromium.launch(headless=True)\npage = await headless_browser.newPage()\n\nhuman_browser = await playwright.chromium.launch(headless=False)\nhuman_page = await human_browser.newPage()\n```\n\n3. **Keep gig copy offline (title, tags, packages, FAQ)**: Store the gig copy in a file or database before attempting to create the gig.\n\n```python\n# Before\ng", "metrics": { "length": 1096, "commands": 2, "command_list": [ "2. **Use a human-attended browser (same profile) to pass the challenge once**: Create a separate browser instance with the same profile as the headless browser.", "3. **Keep gig copy offline (title, tags, packages, FAQ)**: Store the gig copy in a file or database before attempting to create the gig." ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Game MCP: GAME OVER Restart Flow (game-mcp-game-over-restart-flow)", "condition": "plain", "status": 200, "content": "To fix the error \"Game MCP: GAME OVER Restart Flow (game-mcp-game-over-restart-flow)\", I'll assume you're using Minecraft. Here's a step-by-step guide to resolve the issue:\n\n**Method 1: Using the Minecraft Launcher (Recommended)**\n\n1. Open the Minecraft launcher on your computer.\n2. Click on the \"View\" button next to the game you're playing.\n3. Click on \"Properties\".\n4. In the \"Properties\" window, click on the \"Edit\" button next to \"Launch Options\".\n5. Add the following command to the \"Launch Options\" field:\n\n```\n--game-mcp game-mcp-game-over-restart-flow\n```\n\n Replace `game-mcp-game-over-restart-flow` with the actual game ID you're experiencing issues with.\n\n6. Click \"OK\" to save the changes.\n7. Close the \"Properties\" window and click \"Play\" to launch the game.\n\n**Method 2: Using the Command Line (Alternative)**\n\n1. Open the Command Prompt or Terminal on your computer.\n2. Navigate to the directory where you installed Minecraft.\n3. Type the following command to launch the game with the custom game ID:\n\n```\njava -Xmx1024M -X", "metrics": { "length": 1039, "commands": 1, "command_list": [ "--game-mcp game-mcp-game-over-restart-flow" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "game mcp rare relic freeze (game-mcp-rare-relic-freeze)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you can follow these steps:\n\n1. **Avoid selecting rare relics**: Since the game client freezes when selecting rare relics, it's best to stick to common/standard relic options.\n\n2. **Manually send confirmation**: After selecting a rare relic, you can manually send the confirmation command using the `mcp` command. Here's an example:\n\n ```bash\nmcp \n```\n\n Replace `` with the ID of your game, and `` with the confirmation command:\n\n ```bash\nmcp confirm\n```\n\n This will send the confirmation message and allow the game to proceed.\n\nHere's the complete solution in a single command:\n\n```bash\nmcp confirm\n```\n\nIf you want to verify that the MCP is working correctly, you can use the following command:\n\n```bash\ngrep -i mcp lessons/contrib/mcp-.md 2/dev/null | head -3\necho MCP verified\n```\n\nThis command searches for the MCP verification in the specified file and prints the expected output.", "metrics": { "length": 969, "commands": 5, "command_list": [ "mcp ", "mcp confirm", "mcp confirm", "grep -i mcp lessons/contrib/mcp-.md 2/dev/null | head -3", "echo MCP verified" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "game mcp rare relic freeze (game-mcp-rare-relic-freeze)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a Minecraft Forge mod conflict. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Update Minecraft Forge**\n\n1. Open your Minecraft launcher and select the game you're experiencing the issue with.\n2. Click on the \"Open Mods Folder\" button.\n3. Navigate to the `.minecraft/mods` folder (on Windows) or `~/.minecraft/mods` (on macOS/Linux).\n4. Delete the entire `.minecraft/mods` folder (including any existing files).\n5. Restart your Minecraft launcher.\n6. Install the latest version of Minecraft Forge from the official website.\n\n**Step 2: Update your mods**\n\n1. Open the Minecraft Forge mod manager (usually available in the Forge directory, e.g., `C:\\Users\\YourUsername\\.minecraft\\mods\\forge-1.18.2-32.1.6.2426.1\\bin\\modman.exe`).\n2. Select the `game-mcp-rare-relic-freeze` mod and click the \"Update\" button.\n3. Repeat this process for any other mods that may be causing conflicts.\n\n**Step 3: Disable mods**\n\n1. Open the Minecraft Forge mod manager (as described in", "metrics": { "length": 1023, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GFW TLS SNI Block Pattern — Why Tool-Layer Solutions Fail (gfw-tls-sni-block-pattern)", "condition": "with_lesson", "status": 200, "content": "The issue you're facing is due to the GFW (Great Firewall of China) performing TLS SNI (Server Name Indication) sniffing, which blocks connections to certain domains. To bypass this block, you can use a tool that can bypass the network layer block. One such tool is `burp_suite`, which is a proxy-based tool that can intercept and manipulate HTTP requests.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Step 1: Install Burp Suite**\n\nYou can download Burp Suite from the official website: https://portswigger.net/burp\n\n**Step 2: Configure Burp Suite**\n\n1. Launch Burp Suite and select \"Proxy\" as the tool.\n2. In the \"Proxy Settings\" section, select \"Manual\" as the protocol.\n3. In the \"Manual\" section, select \"HTTP\" as the protocol.\n4. In the \"HTTP\" section, select \"SNI bypass\" as the option.\n\n**Step 3: Use Burp Suite to scrape the domain**\n\n1. Launch Burp Suite and select the domain you want to scrape.\n2. In the \"Proxy\" section, select the domain you want to scrape.\n3. In the \"Request\" section, select the", "metrics": { "length": 1024, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GFW TLS SNI Block Pattern — Why Tool-Layer Solutions Fail (gfw-tls-sni-block-pattern)", "condition": "plain", "status": 200, "content": "The GFW TLS SNI Block Pattern error typically occurs when your application tries to connect to a server that has a blocked SNI (Server Name Indication) record. This is a common issue when trying to connect to a server that uses SSL/TLS encryption.\n\nTo fix this issue, you can try the following steps:\n\n**Step 1: Update your SSL/TLS certificate**\n\nIf you're using a self-signed certificate or a certificate that's not trusted by the GFW (Great Firewall of China), you may need to update it to a trusted one.\n\n**Step 2: Use a VPN or proxy server**\n\nYou can try using a VPN or proxy server that bypasses the GFW's block. Here are some examples:\n\n* **TunnelBear VPN**: You can download the TunnelBear VPN app and create an account. Then, you can connect to their VPN server to bypass the GFW.\n* **ExpressVPN**: You can download the ExpressVPN app and create an account. Then, you can connect to their VPN server to bypass the GFW.\n* **Proxifier**: You can download the Proxifier software and configure it to use a proxy server that bypasses the GFW.\n\n**Step 3: Update your application's", "metrics": { "length": 1088, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Credentials 和 Node ID Setup (git-credentials-and-node-id-setup)", "condition": "with_lesson", "status": 200, "content": "解决 Git Credentials 和 Node ID Setup 错误的步骤如下:\n\n**步骤 1: 使用 gh CLI 认证**\n\n如果你使用的是 GitHub CLI,则可以使用 `github auth login` 命令进行凭证配置。\n\n```bash\n# 登录GitHub\ngithub auth login\n\n# 检查凭证是否正确\ngit config --list | grep -E \"user.(name|email)|credential\"\n```\n\n**步骤 2: 手动配置 credential helper**\n\n如果你不使用 GitHub CLI,则可以手动配置 credential helper。\n\n```bash\n# 保存凭证\ngit config --global credential.helper store\n\n# 设置用户名和Email\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your.email@example.com\"\n\n# 检查凭证是否正确\ngit config --list | grep -E \"user.(name|email)|credential\"\n```\n\n**步骤 3: 使用 PAT**\n\n如果你需要使用 PAT(Personal Access Token),则可以使用以下步骤:\n\n```bash\n# 设置 PAT\nPAT=\"your-PAT\"\n\n# 设置远程仓库 URL\ngit remote set-url origin https://:<", "metrics": { "length": 723, "commands": 6, "command_list": [ "github auth login", "git config --list | grep -E \"user.(name|email)|credential\"", "git config --global credential.helper store", "git config --global user.name \"Your Name\"", "git config --global user.email \"your.email@example.com\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Credentials 和 Node ID Setup (git-credentials-and-node-id-setup)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to Git not being able to authenticate your credentials. To fix this, you'll need to set up your Git credentials and Node ID. Here are the steps:\n\n**Step 1: Set up Git Credentials**\n\n1. Open a terminal or command prompt.\n2. Run the following command to set up your Git credentials:\n ```bash\ngit config --global credential.helper store\n```\n This will store your credentials in a file on your local machine.\n\n3. Run the following command to test your credentials:\n ```bash\ngit config --global credential.helper store --get-token\n```\n This will prompt you to enter your username and password. Enter your credentials, and the command should succeed.\n\n**Step 2: Set up Node ID**\n\n1. Run the following command to set up your Node ID:\n ```bash\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your_email@example.com\"\n```\n Replace \"Your Name\" with your actual name and \"your_email@example.com\" with your actual email address.\n\n2. Run the following command to test your Node ID:\n ```bash\ngit config --global user.name\ngit config --global user.email\n```\n", "metrics": { "length": 1126, "commands": 6, "command_list": [ "git config --global credential.helper store", "git config --global credential.helper store --get-token", "git config --global user.name \"Your Name\"", "git config --global user.email \"your_email@example.com\"", "git config --global user.name" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push 的正确方式 — 在受限 Agent 环境中推送代码 (git-push-without-shell-agent)", "condition": "with_lesson", "status": 200, "content": "解决 Git Push 在受限 Agent 环境中的错误:\n\n**方法一:YOLO task + gh CLI(推荐,已验证通过)**\n\n1. 在项目目录执行以下命令:\n ```bash\ntask_create(\n prompt=\"在项目目录执行... gh repo sync --branch main --force\",\n mode=\"yolo\",\n allow_shell=True,\n auto_approve=True,\n trust_mode=True, # 关键:跳过 shell 审批\n)\n```\n2. 或者使用以下命令:\n ```bash\ntask_create(\n prompt=\"在项目目录执行... git remote set-url origin https://--@github.com//.git\",\n mode=\"yolo\",\n allow_shell=True,\n auto_approve=True,\n trust_mode=True, # 关键:跳过 shell 审批\n)\n```\n 然后执行以下命令:\n ```bash\ngit push origin main\n```\n\n**方法二:YOLO task(无 trust_mode,慢但最终成功)**\n\n1. 确认工作目录中有多个仓库时,操作前必须验证:\n ```bash\ngit remote -v # 确认 remote", "metrics": { "length": 678, "commands": 15, "command_list": [ "task_create(", "prompt=\"在项目目录执行... gh repo sync --branch main --force\",", "mode=\"yolo\",", "allow_shell=True,", "auto_approve=True," ], "has_command_block": true, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push 的正确方式 — 在受限 Agent 环境中推送代码 (git-push-without-shell-agent)", "condition": "plain", "status": 200, "content": "The error message \"git-push-without-shell-agent\" typically occurs when you're trying to push code to a Git repository using a Git client without a shell agent. Here's a concrete, actionable fix with exact commands:\n\n**Solution: Use `git push --mirror` or `git push --set-upstream`**\n\nYou can use one of the following commands to push your code without a shell agent:\n\n1. **Use `git push --mirror`**:\n\n```bash\ngit push --mirror origin \n```\n\nReplace `` with the name of the branch you want to push to.\n\n2. **Use `git push --set-upstream`**:\n\n```bash\ngit push -u origin \n```\n\nReplace `` with the name of the branch you want to push to.\n\n**What's happening behind the scenes?**\n\nWhen you use `git push --mirror` or `git push --set-upstream`, Git will:\n\n* Push all local branches to the remote repository\n* Set up the upstream tracking information for the specified branch\n\n**Why is this solution helpful?**\n\nThis solution is helpful when you're working in a restricted environment where shell access is limited or not allowed. By using `git", "metrics": { "length": 1092, "commands": 2, "command_list": [ "git push --mirror origin ", "git push -u origin " ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "git worktree commit lost after pushing from the wrong directory (git-worktree-dangling-commit-recovery)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of a lost commit after pushing from the wrong directory, follow these steps:\n\n**Step 1: Identify the commit**\n\nUse `git fsck --lost-found` to list dangling commits:\n```bash\ngit fsck --lost-found\n```\nThis will show you a list of dangling objects, including commits. Look for a commit with a date or message that matches the work you were doing.\n\n**Step 2: Verify the commit**\n\nUse `git reflog --all` to show every HEAD movement, including detached-HEAD history:\n```bash\ngit reflog --all\n```\nThis will show you the commit history, including any detached HEADs.\n\n**Step 3: Re-attach the branch**\n\nUse `git branch ` to re-attach a branch to the recovered commit:\n```bash\ngit branch \n```\nReplace `` with the name of the branch you want to re-attach, and `` with the SHA of the recovered commit.\n\n**Step 4: Push from the correct worktree**\n\nPush from the correct worktree (or folder) to update the remote branch:\n```bash\ngit push origin \n", "metrics": { "length": 1025, "commands": 3, "command_list": [ "git fsck --lost-found", "git reflog --all", "git branch " ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "git worktree commit lost after pushing from the wrong directory (git-worktree-dangling-commit-recovery)", "condition": "plain", "status": 200, "content": "The \"git worktree commit lost after pushing from the wrong directory\" error typically occurs when you've pushed a commit from a specific worktree directory to the main branch, but the commit has become dangling because the worktree was not properly cleaned up.\n\nHere's a step-by-step solution to recover the lost commit:\n\n**Step 1: Identify the commit hash and the worktree directory**\n\n1. Run the following command to find the commit hash:\n```bash\ngit log -p --oneline --all --follow\n```\nThis command will show you a list of all commits, including the commit hash, in the current directory.\n\n2. Once you have the commit hash, you can use it to identify the worktree directory where the commit was created.\n\n**Step 2: Create a new branch from the main branch**\n\n1. Create a new branch from the main branch to work on the lost commit:\n```bash\ngit checkout -b lost-commit-branch main\n```\nThis will create a new branch called `lost-commit-branch` that is based on the `main` branch.\n\n**Step 3: Checkout the lost commit**\n\n1. Checkout the lost commit using its hash:\n```bash\ngit checkout \n```\nReplace `" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub API PR Submission Pitfalls (github-api-pr-submission-pitfalls)", "condition": "with_lesson", "status": 200, "content": "根据给出的问题和解决方案,以下是一份完整的解决方案:\n\n1. **Sync fork**:\n\n ```bash\ngh api repos/FORK/REPO/merge-upstream -X POST -f branch=main\n```\n\n2. **创建分支**:\n\n ```bash\nSHA=$(gh api repos/UPSTREAM/REPO/git/refs/heads/main --jq '.object.sha')\ngh api repos/FORK/REPO/git/refs -f ref=\"refs/heads/fix/xxx\" -f sha=\"$SHA\"\n```\n\n3. **获取文件 SHA、修改文件、PUT**:\n\n ```bash\nFILE_SHA=$(gh api \"repos/FORK/REPO/contents/PATH?ref=BRANCH\" --jq '.sha')\nENCODED=$(base64 -i file.py | tr -d '\\n')\n```\n\n4. **修改文件**:\n\n ```bash\necho -e \"\\n @pytest.mark.anyio\" > new.py\n```\n\n5. **检查 diff 干净度**:\n\n ```bash\ngh api \"repos/UPSTREAM/REPO/compare/main...FORK:BRANCH\" \\\n --jq '{ahead_by,", "metrics": { "length": 652, "commands": 6, "command_list": [ "gh api repos/FORK/REPO/merge-upstream -X POST -f branch=main", "SHA=$(gh api repos/UPSTREAM/REPO/git/refs/heads/main --jq '.object.sha')", "gh api repos/FORK/REPO/git/refs -f ref=\"refs/heads/fix/xxx\" -f sha=\"$SHA\"", "FILE_SHA=$(gh api \"repos/FORK/REPO/contents/PATH?ref=BRANCH\" --jq '.sha')", "ENCODED=$(base64 -i file.py | tr -d '\\n')" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub API PR Submission Pitfalls (github-api-pr-submission-pitfalls)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a missing or invalid personal access token in your GitHub API request. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Create a new personal access token**\n\nOpen your GitHub profile page and navigate to your settings. Click on \"Developer settings\" and then click on \"Personal access tokens.\"\n\nClick on \"Generate new token\" and fill in the required information:\n\n* Token name: `github-api-pr-submission-pitfalls`\n* Token description: `API token for GitHub API PR submission`\n* Select `repo` scope\n* Select `read:org` scope\n* Select `write:org` scope\n* Select `delete:org` scope\n\nClick on \"Generate token.\"\n\n**Step 2: Store the personal access token securely**\n\nYou can store the token securely in an environment variable or a secrets manager like GitHub Secrets or Hashicorp Vault.\n\n**Step 3: Update your code with the personal access token**\n\nReplace the `PERSONAL_ACCESS_TOKEN` variable in your code with the actual token value.\n\nFor example, if you're using Python, you can update your code as follows:\n```python\nimport os\n\nPERSONAL_ACCESS_TOKEN = os.environ['PERSONAL_ACCESS_TOKEN']\n\n", "metrics": { "length": 1143, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub contents API edit fails with 422 without the file sha (github-contents-api-sha-required)", "condition": "plain", "status": 200, "content": "The error you're encountering, \"github-contents-api-sha-required\", is caused by the GitHub Contents API requiring a file SHA in the request body when editing a file. Here's a concrete, actionable fix with exact commands to resolve the issue:\n\n**Step 1: Update your `github-contents-api` credentials**\n\nIf you're using a personal access token, ensure it has the `repo` scope. If you're using a GitHub token, you can use the `repo` and `delete_repo` scopes.\n\n```bash\n# Update your GitHub token credentials\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your_email@example.com\"\n\n# If you're using a personal access token, add the following configuration\ngit config --global http.proxy \"https://your_token:your_token@example.com\"\n```\n\n**Step 2: Use the `--content` option with `git push`**\n\nTo update a file in the GitHub repository, use the `--content` option with `git push`. This will overwrite the existing file.\n\n```bash\n# Update a file in the repository\ngit push origin --content \n```\n\nReplace `` with the name of", "metrics": { "length": 1095, "commands": 4, "command_list": [ "git config --global user.name \"Your Name\"", "git config --global user.email \"your_email@example.com\"", "git config --global http.proxy \"https://your_token:your_token@example.com\"", "git push origin --content " ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub contents API edit fails with 422 without the file sha (github-contents-api-sha-required)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to include the file SHA in the PUT request when updating an existing file. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Create a function to fetch the current SHA**\n\nCreate a new file named `fetch_sha.py` with the following code:\n```python\nimport requests\n\ndef fetch_sha(owner, repo, path, ref=None):\n url = f\"https://api.github.com/repos/{owner}/{repo}/contents/{path}\"\n if ref:\n url += f\"?ref={ref}\"\n\n response = requests.get(url)\n response.raise_for_status()\n\n data = response.json()\n sha = data[\"content\"].split(\"base64\")[1].decode(\"base64\")\n return sha\n```\n**Step 2: Update the main script to use the `fetch_sha` function**\n\nUpdate your main script to use the `fetch_sha` function to fetch the current SHA before updating the file. Here's an example:\n```python\nimport requests\n\ndef update(path, content):\n owner = \"your-username\"\n repo = \"your-repo-name\"\n branch = \"main\" # or any other branch you want to use\n\n # Fetch the current SHA\n sha", "metrics": { "length": 1037, "commands": 2, "command_list": [ "**Step 2: Update the main script to use the `fetch_sha` function**", "Update your main script to use the `fetch_sha` function to fetch the current SHA before updating the file. Here's an example:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub rate limiting hitting unauthenticated searches during automation (github-rate-limit-auth)", "condition": "with_lesson", "status": 200, "content": "To fix the GitHub rate limiting issue, you need to authenticate every API call by sending an authorization header with your token. Here's a concrete, actionable fix:\n\n**Step 1: Store your token securely**\n\nFirst, store your GitHub token securely using environment variables. This way, you won't have to hardcode it in your script or logs.\n\n```bash\n# Set the GitHub token as an environment variable\nexport GITHUB_TOKEN=\"your_github_token_here\"\n```\n\n**Step 2: Authenticate every API call**\n\nNow, modify your script to include an authorization header with the token on every request.\n\n```bash\n# Example using curl\ncurl -X GET \\\n https://api.github.com/search/issues \\\n -H 'Authorization: Bearer ${GITHUB_TOKEN}' \\\n -H 'Content-Type: application/json'\n```\n\nOr, if you're using Python:\n\n```python\nimport requests\n\ntoken = \"your_github_token_here\"\nheaders = {\n 'Authorization': f'Bearer {token}',\n 'Content-Type': 'application/json'\n}\n\nresponse = requests.get('https://api.github.com/search/issues', headers=headers)\n```\n\n**Step 3: Tune search call frequency**\n\nTo avoid hitting the rate limit, reduce the frequency of", "metrics": { "length": 1121, "commands": 5, "command_list": [ "export GITHUB_TOKEN=\"your_github_token_here\"", "curl -X GET \\", "https://api.github.com/search/issues \\", "-H 'Authorization: Bearer ${GITHUB_TOKEN}' \\", "-H 'Content-Type: application/json'" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Go dependency vuln bump blocked by wrong-architecture toolchain download (go-toolchain-vuln-bump-wrong-arch)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to a mismatch between the architecture of your system and the architecture of the Go toolchain. Here's a step-by-step solution to resolve this issue:\n\n**Step 1: Identify the architecture of your system**\n\nTo identify the architecture of your system, run the following command:\n```bash\nuname -m\n```\nThis will output the architecture of your system, which should be one of the following:\n- `x86_64` (64-bit)\n- `amd64` (64-bit)\n- `arm64` (64-bit)\n- `arm` (32-bit)\n\n**Step 2: Update your `go.mod` file**\n\nTo fix the issue, you need to update your `go.mod` file to specify the correct architecture for your system. Run the following command:\n```bash\ngo mod tidy\n```\nThis will update your `go.mod` file with the correct architecture.\n\n**Step 3: Update the `go.mod` file manually**\n\nIf the above command doesn't update the `go.mod` file correctly, you can update it manually. Open your `go.mod` file in a text editor and update the `go.mod` file to specify the correct architecture. The format for specifying the architecture", "metrics": { "length": 1055, "commands": 2, "command_list": [ "uname -m", "go mod tidy" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "GitHub rate limiting hitting unauthenticated searches during automation (github-rate-limit-auth)", "condition": "plain", "status": 200, "content": "The GitHub rate limiting error you're experiencing is due to the rate limit being triggered by unauthenticated searches during your automation process. To resolve this issue, you can use the `--no-auth-token` flag when making API requests to GitHub. Here's how you can do it:\n\n**Using `curl`**\n\n1. Open your terminal and navigate to the directory where your script is located.\n2. Run the following command to make a search request without authentication:\n```bash\ncurl -X GET \\\n https://api.github.com/search/repositories \\\n --user YOUR_GITHUB_USERNAME \\\n --no-auth-token \\\n -H 'Accept: application/vnd.github.v3+json'\n```\nReplace `YOUR_GITHUB_USERNAME` with your actual GitHub username.\n\n**Using `jq`**\n\nIf you're using `jq` to parse JSON responses, you can use the following command:\n```bash\ncurl -X GET \\\n https://api.github.com/search/repositories \\\n --user YOUR_GITHUB_USERNAME \\\n --no-auth-token \\\n -H 'Accept: application/vnd.github.v3+json' | jq '.data'\n```\nAgain, replace `YOUR_GITHUB_USERNAME` with your actual GitHub username.\n\n**Using `GitHub API Client Library`**\n\nIf", "metrics": { "length": 1087, "commands": 10, "command_list": [ "curl -X GET \\", "https://api.github.com/search/repositories \\", "--user YOUR_GITHUB_USERNAME \\", "--no-auth-token \\", "-H 'Accept: application/vnd.github.v3+json'" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits hubert 16khz (gpt-sovits-hubert-16khz)", "condition": "plain", "status": 200, "content": "The error message you're encountering suggests that there's a conflict between your current system settings and the settings you're trying to apply. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Check your current settings**\n\n1. Open your terminal and run the following command to check your current system settings:\n```bash\ncat /etc/default/grub\n```\nThis will display the current GRUB settings.\n\n**Step 2: Update the GRUB configuration**\n\n1. Run the following command to update the GRUB configuration:\n```bash\nsudo update-grub\n```\nThis will regenerate the GRUB configuration file based on your current system settings.\n\n**Step 3: Reboot your system**\n\n1. Reboot your system to apply the changes:\n```bash\nsudo reboot\n```\n**Step 4: Check if the issue persists**\n\n1. After rebooting, try running the command again:\n```bash\ngpt sovits hubert 16khz\n```\nIf the issue persists, you may need to investigate further to determine the cause of the conflict.\n\n**Alternative Solution:**\n\nIf the above steps don't resolve the issue, you can try the following alternative solution:\n\n1. Edit the GRUB configuration file directly:\n", "metrics": { "length": 1130, "commands": 4, "command_list": [ "cat /etc/default/grub", "sudo update-grub", "sudo reboot", "gpt sovits hubert 16khz" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Go dependency vuln bump blocked by wrong-architecture toolchain download (go-toolchain-vuln-bump-wrong-arch)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you'll need to download the correct Go toolchain for your host architecture and add it to the PATH. Here are the exact steps:\n\n**Step 1: Confirm the host architecture**\n\nRun the following command to confirm the host architecture:\n```bash\nuname -m\n```\nThis should output `x86_64` or `amd64`, indicating that your host is an x86_64 machine.\n\n**Step 2: Download the matching tarball**\n\nDownload the matching Go toolchain tarball for your host architecture. For example, if your host is an x86_64 machine, you can download the following tarball:\n```bash\ngo1.24.5.darwin-amd64.tar.gz\n```\nYou can download this tarball from the official Go website.\n\n**Step 3: Extract and prepend to PATH**\n\nExtract the downloaded tarball to a temporary directory (`/tmp/gotool` in this example) and prepend the `go/bin` directory to the PATH:\n```bash\ntar -C /tmp/gotool -xzf go1.24.5.darwin-amd64.tar.gz\nexport PATH=/tmp/gotool/go/bin:$PATH\n```\n**Step 4:", "metrics": { "length": 950, "commands": 4, "command_list": [ "uname -m", "go1.24.5.darwin-amd64.tar.gz", "tar -C /tmp/gotool -xzf go1.24.5.darwin-amd64.tar.gz", "export PATH=/tmp/gotool/go/bin:$PATH" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits hubert 16khz (gpt-sovits-hubert-16khz)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to modify your code to match the correct API flow and signature. Here's the corrected code:\n\n```bash\n# Import necessary libraries\nimport inf\n\n# Create a module instance\ncnhubert_mod = inf.cnhubert(\"gpt-sovits-hubert-16khz\")\n\n# Get a single CNHubert model instance\nhmodel = cnhubert_mod.get_model()\n\n# Load a 16kHz audio file using librosa\nimport librosa\nwav, sr = librosa.load(\"path_to_your_audio_file.wav\", sr=16000)\n\n# Get the content features using the model and audio tensor\nfeat = cnhubert_mod.get_content(hmodel, wav_tensor=wav)\n\n# Print the lesson information\necho \"Lesson: gpt sovits hubert 16khz\"\nwc -l lessons/contrib/gpt-sovits-hubert-16khz.md\n```\n\nNote that I've made the following changes:\n\n1. Created a module instance `cnhubert_mod` using the correct module name.\n2. Retrieved a single CNHubert model instance `hmodel` from the module instance.\n3. Loaded a 16kHz audio file using librosa, specifying", "metrics": { "length": 941, "commands": 8, "command_list": [ "import inf", "cnhubert_mod = inf.cnhubert(\"gpt-sovits-hubert-16khz\")", "hmodel = cnhubert_mod.get_model()", "import librosa", "wav, sr = librosa.load(\"path_to_your_audio_file.wav\", sr=16000)" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits name2text arpabet (gpt-sovits-name2text-arpabet)", "condition": "with_lesson", "status": 200, "content": "To fix the error, you need to correct the formatting of the `name2text.txt` file. Here are the steps:\n\n1. Open the `name2text.txt` file in a text editor.\n2. Check each line and make sure the second column (after the tab character `\\t`) only contains ARPABET phonemes, separated by spaces. If there are any Chinese characters, remove them and replace them with the corresponding ARPABET phonemes.\n3. Save the corrected file.\n\nAlternatively, you can use the following command to correct the file:\n\n```bash\nawk -F'\\t' '{if ($2 ~ /^[a-zA-Z0-9 ]$/) {print $0; else {print $0 \" \" gsub(\"[^a-zA-Z0-9 ]\", \"\", $2)}}}' lessons/contrib/gpt-sovits-name2text-arpabet.txt > corrected_name2text.txt\n```\n\nThis command uses `awk` to iterate over each line in the file, and checks if the second column (`$2`) contains only letters, numbers, or spaces. If it does, the line is printed as is. If not, the Chinese characters are removed using `gsub`, and the line is printed with the corrected phon", "metrics": { "length": 976, "commands": 1, "command_list": [ "awk -F'\\t' '{if ($2 ~ /^[a-zA-Z0-9 ]$/) {print $0; else {print $0 \" \" gsub(\"[^a-zA-Z0-9 ]\", \"\", $2)}}}' lessons/contrib/gpt-sovits-name2text-arpabet.txt > corrected_name2text.txt" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits name2text arpabet (gpt-sovits-name2text-arpabet)", "condition": "plain", "status": 200, "content": "The error message you're seeing is likely due to a typo in the package name. Here's a step-by-step guide to fix it:\n\n**Fixing the Error:**\n\n1. **Update the package list**: Run the following command to ensure you have the latest package list:\n ```bash\nsudo apt update\n```\n2. **Install the package**: Try installing the package again using the corrected name:\n ```bash\nsudo apt install gpt-sovits-name2text-arpabet\n```\n If the package is not found, you can try searching for it using:\n ```bash\nsudo apt search gpt-sovits-name2text-arpabet\n```\n This command will display a list of packages that match the search query.\n\n3. **Check the package status**: If the package is not found, you can try checking the package status:\n ```bash\nsudo apt show gpt-sovits-name2text-arpabet\n```\n This command will display information about the package, including its status.\n\n4. **Install the package using pip**: If the package is not available in the official repository, you can try installing it using pip:\n ```bash\npip install gpt-sovits-name2text", "metrics": { "length": 1049, "commands": 4, "command_list": [ "sudo apt update", "sudo apt install gpt-sovits-name2text-arpabet", "sudo apt search gpt-sovits-name2text-arpabet", "sudo apt show gpt-sovits-name2text-arpabet" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits ref free bug (gpt-sovits-ref-free-bug)", "condition": "with_lesson", "status": 200, "content": "To fix the bug, we can modify the condition judgment in the `inference_webui.py` file. Here's a concrete and actionable fix with exact commands:\n\n**Step 1: Backup the original file**\n\n```bash\ncp inference_webui.py lessons/contrib/gpt-sovits-ref-free-bug.md\n```\n\n**Step 2: Edit the `inference_webui.py` file**\n\n```bash\nnano lessons/contrib/gpt-sovits-ref-free-bug.md\n```\n\n**Step 3: Modify the condition judgment**\n\nReplace the lines `if prompt_text is None or len(prompt_text) == 0:` with the following code:\n\n```python\nif prompt_text is None or len(prompt_text) == 0 and 'ref_free' not in locals():\n ref_free = True\n```\n\nThis modification ensures that `ref_free` is only set to `True` when `prompt_text` is empty and `ref_free` is not already defined.\n\n**Step 4: Save the changes**\n\nPress `Ctrl+X`, then `Y`, and finally `Enter` to save the changes.\n\n**Step 5: Verify the fix**\n\nRun the following command to verify that the fix has been applied:\n\n```bash\necho", "metrics": { "length": 962, "commands": 7, "command_list": [ "cp inference_webui.py lessons/contrib/gpt-sovits-ref-free-bug.md", "nano lessons/contrib/gpt-sovits-ref-free-bug.md", "This modification ensures that `ref_free` is only set to `True` when `prompt_text` is empty and `ref_free` is not already defined.", "**Step 4: Save the changes**", "Press `Ctrl+X`, then `Y`, and finally `Enter` to save the changes." ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ccswitch-hermes-switch 踩坑Notes (hermes-model-switch-ccswitch)", "condition": "with_lesson", "status": 200, "content": "Based on the provided information, it seems like the issue is related to the configuration files and proxy channels used by Claude Code (cc) and Hermes Agent. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update configuration files**\n\nFirst, let's update the configuration files for both cc and Hermes Agent:\n\n1. Update the `~/.claude/settings.json` file (WSL side):\n```bash\necho \"{\n \\\"model\\\": \\\"InternalModel-2.5-pro\\\",\n \\\"provider\\\": \\\"internal\\\",\n \\\"base_url\\\": \\\"https://internalgateway.com\\\"}\" > ~/.claude/settings.json\n```\n2. Update the `` file (other side):\n```bash\necho \"{\n \\\"model\\\": \\\"InternalModel-2.5-pro\\\",\n \\\"provider\\\": \\\"internal\\\",\n \\\"base_url\\\": \\\"https://internalgateway.com\\\"}\" > \n```\nReplace `` with the actual path to the configuration file on the other side.\n\n**Step 2: Restart the proxy**\n\nNext, let's restart the proxy to apply the changes:\n```bash\n~/anthropic-openai-proxy.py --restart\n```\n**Step 3:", "metrics": { "length": 982, "commands": 9, "command_list": [ "echo \"{", "\\\"model\\\": \\\"InternalModel-2.5-pro\\\",", "\\\"provider\\\": \\\"internal\\\",", "\\\"base_url\\\": \\\"https://internalgateway.com\\\"}\" > ~/.claude/settings.json", "echo \"{" ], "has_command_block": true, "actionable": false, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gpt sovits ref free bug (gpt-sovits-ref-free-bug)", "condition": "plain", "status": 200, "content": "The error you're encountering, `gpt sovits ref free bug`, is likely related to an issue with the `gpt-sovits-ref-free` package. Here's a step-by-step guide to help you resolve the issue:\n\n**Fixing the gpt-sovits-ref-free bug**\n\n1. **Update the package list**:\n ```bash\nsudo apt update\n```\n This command updates the package list to ensure you have the latest information about available packages.\n\n2. **Upgrade all packages**:\n ```bash\nsudo apt full-upgrade\n```\n This command upgrades all installed packages, including `gpt-sovits-ref-free`, to the latest version.\n\n3. **Check if the package is available**:\n ```bash\nsudo apt install -f\n```\n This command checks if the package is available and if there are any missing dependencies.\n\n4. **Remove and reinstall the package**:\n ```bash\nsudo apt remove gpt-sovits-ref-free\nsudo apt install gpt-sovits-ref-free\n```\n This command removes the package and then reinstalls it to ensure that any issues are resolved.\n\n5. **Verify the package installation**:\n ```bash\ndpkg -", "metrics": { "length": 1031, "commands": 5, "command_list": [ "sudo apt update", "sudo apt full-upgrade", "sudo apt install -f", "sudo apt remove gpt-sovits-ref-free", "sudo apt install gpt-sovits-ref-free" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "ccswitch-hermes-switch 踩坑Notes (hermes-model-switch-ccswitch)", "condition": "plain", "status": 200, "content": "The error \"ccswitch-hermes-switch 踩坑Notes (hermes-model-switch-ccswitch)\" is not a standard error message and seems to be a mix of Chinese characters and a generic error message.\n\nHowever, I can provide you with a general solution to troubleshoot and fix common issues related to the Hermes model switch and Ccswitch.\n\nHere are the steps to troubleshoot and fix the issue:\n\n1. **Check the Hermes model switch documentation**: Ensure that you have the latest documentation for your Hermes model switch. You can check the official website of the manufacturer or search for online tutorials and guides.\n2. **Update the Hermes firmware**: Outdated firmware can cause issues with the switch. Check the manufacturer's website for firmware updates and follow their instructions to update the firmware.\n3. **Reset the Hermes model switch**: Sometimes, a simple reset can resolve the issue. Check the manufacturer's documentation for instructions on how to reset the switch.\n4. **Check the Ccswitch configuration**: Ensure that the Ccswitch configuration is correct and that all settings are properly configured.\n\nTo troubleshoot the issue, you can try the following commands:\n\n**For Linux:**\n\n```bash\n# Check the Hermes firmware version\nsudo apt-get install hermes-firmware", "metrics": { "length": 1265, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "JavaScript 执行链断裂:一个未捕获 TypeError 如何让整个页面静默失效 (js-dead-code-chain-break)", "condition": "plain", "status": 200, "content": "The error you're experiencing is due to a \"dead code chain break\" in JavaScript, which occurs when the JavaScript execution chain is interrupted by an unhandled error. Here's a concrete, actionable fix to help you resolve the issue:\n\n**Step 1: Enable JavaScript Console Logging**\n\nTo identify the source of the error, you need to enable JavaScript console logging on your website. You can do this by adding the following meta tag to your HTML file:\n\n```html\n\n\n\n```\n\n**Step 2: Add Error Handling to Your JavaScript Code**\n\nTo catch and handle errors, you need to add an error listener to your JavaScript code. You can do this by adding the following code to your JavaScript file:\n\n```javascript\nwindow.addEventListener('error', function(event) {\n console.error('Error occurred:', event);\n // Your custom error handling code here\n});\n```\n\n**Step 3: Use a JavaScript Error Handling Library**\n\nTo simplify error handling, you can use a JavaScript error handling library like `error-handler`.", "metrics": { "length": 1190, "commands": 2, "command_list": [ "**Step 2: Add Error Handling to Your JavaScript Code**", "To catch and handle errors, you need to add an error listener to your JavaScript code. You can do this by adding the following code to your JavaScript file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "JavaScript 执行链断裂:一个未捕获 TypeError 如何让整个页面静默失效 (js-dead-code-chain-break)", "condition": "with_lesson", "status": 200, "content": "**修复JavaScript 执行链断裂:一个未捕获 TypeError**\n\n为了修复这个问题,我们需要遵循以下步骤:\n\n### 步骤 1:优先使用可选链操作符\n\n使用可选链操作符 (`?.`) 来防御性地访问可能为 null/undefined 的属性。\n\n```javascript\ndocument.getElementById('btn')?.addEventListener('click', handler);\n```\n\n### 步骤 2:将事件绑定放在 try/catch 中或包裹在 DOMContentLoaded 回调内\n\n将事件绑定放在 try/catch 中或包裹在 DOMContentLoaded 回调内,确保各自独立。\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', function() {\n try {\n document.getElementById('btn')?.addEventListener('click', handler);\n } catch (error) {\n console.error(error);\n }\n});\n```\n\n### 步骤 3:全局错误监听\n\n全局错误监听可以让开发者知道出了问题。\n\n```javascript\nwindow.addEventListener('error', function(error) {\n console.error(error);\n});\n```\n\n### 步骤 4:删除或注释掉不再使用的 DOM 引用代码\n\n删除", "metrics": { "length": 708, "commands": 2, "command_list": [ "将事件绑定放在 try/catch 中或包裹在 DOMContentLoaded 回调内,确保各自独立。", "全局错误监听可以让开发者知道出了问题。" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push to Fork Repo: ''Permission Denied to Other User'' — Wrong PAT Selected (lesson-06-git-push-credential-helper-403)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to using the wrong Personal Access Token (PAT) when pushing to a fork repository on GitHub. Here's a step-by-step fix:\n\n**Step 1: Identify the correct PAT**\n\n* Go to your GitHub account settings.\n* Click on \"Developer settings\" (or \"Developer options\" in older versions).\n* Click on \"Personal access tokens\".\n* Find the PAT you used to authenticate with the wrong repository.\n* Note down the PAT ID and secret.\n\n**Step 2: Create a new PAT for the fork repository**\n\n* Go back to the Personal access tokens page.\n* Click on \"Generate new token\".\n* In the \"Token name\" field, enter a name like \"fork-repo-pat\".\n* In the \"Select scopes\" dropdown, select \"repo\".\n* In the \"Expire token\" field, select a time frame that suits your needs (e.g., \"Never\").\n* Click on \"Generate token\".\n\n**Step 3: Update your Git credentials**\n\n* Open a terminal or command prompt.\n* Run the following command to update your Git credentials with the new PAT:\n```bash\ngit config --global user.password \"your-new-pat-id:your-new-pat-secret\"\n```\nReplace `your", "metrics": { "length": 1068, "commands": 1, "command_list": [ "git config --global user.password \"your-new-pat-id:your-new-pat-secret\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Git Push to Fork Repo: ''Permission Denied to Other User'' — Wrong PAT Selected (lesson-06-git-push-credential-helper-403)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering occurs because Git is using the wrong Personal Access Token (PAT) from `~/.git-credentials` when pushing to a fork repository. Here's a step-by-step solution to resolve this issue:\n\n**Step 1: Identify the correct PAT**\n\nYou need to identify the correct PAT for the repository you're trying to push to. You can do this by checking the repository's settings on GitHub. Look for the \"Repository settings\" link on the left side menu and then click on \"Permissions.\" Find the \"Write\" permission for the correct account (the owner of the repository).\n\n**Step 2: Remove the incorrect PAT from `~/.git-credentials`**\n\nOpen `~/.git-credentials` in a text editor and remove the line that corresponds to the incorrect PAT. You can use a tool like `vim` or `nano` to edit the file.\n\n```bash\nvim ~/.git-credentials\n```\n\nRemove the line that starts with the incorrect PAT (e.g., `ikalus:@github.com`).\n\n**Step 3: Update `~/.git-credentials` with the correct PAT**\n\nAdd a new line to `~/.git-credentials` with the correct PAT for the repository you're trying to push to", "metrics": { "length": 1084, "commands": 1, "command_list": [ "vim ~/.git-credentials" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-Reach v1.5.0 doctor Baseline: 4/15 Channels Available Without Login (lesson-10-agent-reach-doctor-baseline)", "condition": "with_lesson", "status": 200, "content": "The error message indicates that the `yt-dlp` package is installed but not configured to use the Node.js runtime. To fix this, you need to configure `yt-dlp` to use Node.js. Here are the steps:\n\n1. Create a new directory for `yt-dlp` configuration if it doesn't exist:\n```bash\nmkdir -p ~/.config/yt-dlp\n```\n2. Check if the `yt-dlp` configuration file exists. If it doesn't, create it:\n```bash\ntouch ~/.config/yt-dlp/config\n```\n3. Open the `yt-dlp` configuration file in a text editor and add the following line to the end of the file:\n```bash\n--js-runtimes node\n```\nThis line tells `yt-dlp` to use Node.js as the JavaScript runtime.\n\n4. Save the changes to the `yt-dlp` configuration file.\n\nAfter completing these steps, you should see the following output when running `agent-reach doctor`:\n```\nAgent Reach 状态\n========================================\n图例:✅ 可用 [!] 已装但需配置/登录 [X] 未安装\n\n✅ 装好即用:\n ✅ GitHub 仓库", "metrics": { "length": 906, "commands": 3, "command_list": [ "mkdir -p ~/.config/yt-dlp", "touch ~/.config/yt-dlp/config", "--js-runtimes node" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Agent-Reach v1.5.0 doctor Baseline: 4/15 Channels Available Without Login (lesson-10-agent-reach-doctor-baseline)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect configuration in your Agent-Reach environment. Here's a step-by-step guide to resolve the issue:\n\n**Fix 1: Update Agent-Reach Configuration**\n\n1. Open a terminal or command prompt.\n2. Navigate to the Agent-Reach configuration directory (usually `~/.agent-reach` or `C:\\Users\\\\.agent-reach`).\n3. Run the following command to update the configuration:\n ```bash\nagent-reach config update\n```\n This command will apply any available updates to the configuration.\n\n**Fix 2: Set Channel Availability**\n\n1. Open a terminal or command prompt.\n2. Run the following command to set the channel availability:\n ```bash\nagent-reach config set channel_availability 15\n```\n This command will set the available channels to 15, which should resolve the error.\n\n**Fix 3: Run the Doctor Baseline Command**\n\n1. Open a terminal or command prompt.\n2. Run the following command to re-run the doctor baseline:\n ```bash\nagent-reach doctor baseline\n```\n This command will re-run the doctor baseline and update the configuration.\n\n**Verify the Fix**\n\n1. After running", "metrics": { "length": 1134, "commands": 3, "command_list": [ "agent-reach config update", "agent-reach config set channel_availability 15", "agent-reach doctor baseline" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AWS Lambda MicroVMs — 隔离沙箱与 Firecracker (lesson-13-aws-lambda-microvms)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or outdated Firecracker package. Firecracker is a virtualization platform used by AWS Lambda MicroVMs. Here's a step-by-step guide to resolve the issue:\n\n**Fix:**\n\n1. **Update your AWS CLI**: Ensure your AWS CLI is up-to-date. Run the following command:\n\n```bash\naws --version\n```\n\nIf you're using an older version, update it using:\n\n```bash\naws upgrade\n```\n\n2. **Update your package list**: Run the following command to update your package list:\n\n```bash\nsudo apt update\n```\n\nThis command will update the package list for your system.\n\n3. **Install the Firecracker package**: Install the Firecracker package using the following command:\n\n```bash\nsudo apt-get install firecracker\n```\n\nIf you're using a newer version of Ubuntu (20.04 or later), use the following command instead:\n\n```bash\nsudo apt-get install firecracker-system\n```\n\n4. **Verify Firecracker installation**: Run the following command to verify that Firecracker is installed correctly:\n\n```bash\nfirecracker --version\n```\n\nYou should see the version number of Firecracker printed in the", "metrics": { "length": 1107, "commands": 6, "command_list": [ "aws --version", "aws upgrade", "sudo apt update", "sudo apt-get install firecracker", "sudo apt-get install firecracker-system" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "AWS Lambda MicroVMs — 隔离沙箱与 Firecracker (lesson-13-aws-lambda-microvms)", "condition": "with_lesson", "status": 200, "content": "The error message you're experiencing is likely due to the fact that the `MicroVM` feature is not enabled by default for AWS Lambda functions. To fix this, you need to enable `MicroVM` for your function.\n\nHere are the steps to enable `MicroVM` for your Lambda function:\n\n1. Open the AWS Management Console and navigate to the Lambda dashboard.\n2. Select the function that you want to enable `MicroVM` for.\n3. Click on the \"Configuration\" tab.\n4. Scroll down to the \"Advanced\" section.\n5. Click on the \"Edit\" button next to \"Execution role\".\n6. In the \"Execution role\" section, click on the \"Add inline policy\" button.\n7. In the \"Add inline policy\" dialog box, enter the following policy JSON:\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"firecracker:CreateMicroVM\",\n \"Resource\": \"*\"\n }\n ]\n}\n```\n8. Click on the \"Review changes\" button.\n9. Click on the \"Save changes\" button.\n\nAlternatively, you can also enable `MicroVM` using the AWS CLI", "metrics": { "length": 1004, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gRPC vs OpenAPI vs REST — API 协议选择指南 (lesson-19-grpc-openapi-rest-comparison)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing seems to be related to the documentation provided in the lesson. Here are some concrete, actionable fixes with exact commands to troubleshoot and resolve the issue:\n\n1. **Check the HTTP version**: Ensure that the HTTP version used in the `GET` request is correct. You can check the HTTP version by running the following command:\n\n```bash\ncurl -v http://example.com/api/users/123\n```\n\nIf the HTTP version is not HTTP/1.1, update the `Accept` header to use the correct version.\n\n2. **Verify the gRPC-Web library**: If you're using gRPC with the gRPC-Web library, ensure that it's properly installed and configured. You can check the installation by running the following command:\n\n```bash\npip install --upgrade grpcio grpcio-tools\n```\n\nIf you're using a virtual environment, activate it before running the command.\n\n3. **Check the protobuf syntax**: Ensure that the protobuf syntax is correct. You can check the syntax by running the following command:\n\n```bash\nprotoc --version\n```\n\nIf the syntax is not correct, update the protobuf syntax to match the example provided in the lesson.\n\n4. **Verify the OpenAPI schema**: Ensure that the Open", "metrics": { "length": 1169, "commands": 3, "command_list": [ "curl -v http://example.com/api/users/123", "pip install --upgrade grpcio grpcio-tools", "protoc --version" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "gRPC vs OpenAPI vs REST — API 协议选择指南 (lesson-19-grpc-openapi-rest-comparison)", "condition": "plain", "status": 200, "content": "The error you're experiencing is likely due to a missing import or a syntax error in your gRPC code. However, since you're comparing gRPC, OpenAPI, and REST APIs, I'll provide a general solution for setting up a gRPC service with OpenAPI support.\n\n**Step 1: Install the required dependencies**\n\nYou'll need to install the following dependencies:\n\n* `protoc` for compiling the gRPC protocol buffer definitions\n* `protoc-gen-grpc` for generating the gRPC stub code\n* `protoc-gen-openapiv2` for generating OpenAPI definitions\n* `grpc` for running the gRPC service\n\nRun the following commands:\n\n```bash\n# Install protoc\nsudo apt-get update && sudo apt-get install -y libprotoc-dev libprotobuf-dev\n\n# Install protoc-gen-grpc and protoc-gen-openapiv2\ngo get -u github.com/golang/protobuf/protoc-gen-go\ngo get -u github.com/golang/protobuf/protoc-gen-go-grpc\ngo get -u github.com/golang/protobuf/protoc-gen-openapiv2\ngo get -u google.golang.org/grpc/cmd/protoc-gen-grpc\n\n# Install grpc\ngo get", "metrics": { "length": 985, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 设计原则 — 无抽象、一致性、幂等性 (lesson-20-api-design-principles)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect import statement for the `@Api` annotation in your Spring Boot application. Here's a concrete, actionable fix with exact commands:\n\n**Error:**\n\n`java: cannot find symbol`\n\n**Fix:**\n\n1. Open your `pom.xml` file (if you're using Maven) or your `build.gradle` file (if you're using Gradle).\n2. Add the following dependency to your project:\n\nMaven:\n```xml\n\n io.springfox\n springfox-boot-starter\n\n```\n\nGradle:\n```groovy\ndependencies {\n implementation 'io.springfox:springfox-boot-starter:3.0.0'\n}\n```\n\n3. Wait for the dependency to be downloaded and updated in your project.\n4. If you're still encountering issues, ensure that your Spring Boot application is properly configured to include the `@Api` annotation.\n\n**Example:**\n\nSuppose you have a controller class with the following code:\n```java\nimport io.swagger.v3.oas.annotations.Operation;\nimport io.swagger.v3.oas.annotations.media.Content;\nimport io.swagger.v3.oas.annotations.media.Schema", "metrics": { "length": 1089, "commands": 5, "command_list": [ "Gradle:", "3. Wait for the dependency to be downloaded and updated in your project.", "4. If you're still encountering issues, ensure that your Spring Boot application is properly configured to include the `@Api` annotation.", "**Example:**", "Suppose you have a controller class with the following code:" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DevOps Platform Engineering — Golden Paths to Reduce Cognitive Load (lesson-review-3-devops-platform-engineering)", "condition": "with_lesson", "status": 200, "content": "To reduce cognitive load and implement a Platform Engineering with Golden Paths approach, we'll create an Internal Developer Platform (IDP) and set up a pre-configured template for CI/CD, monitoring, and logging. Here's a step-by-step guide:\n\n**Step 1: Create a new GitHub repository for your IDP**\n\nCreate a new repository on GitHub and name it after your organization or project.\n\n```bash\nmkdir my-idp\ncd my-idp\ngit init\ngit add .\ngit commit -m \"Initial commit for my IDP\"\n```\n\n**Step 2: Install the required tools and actions**\n\nInstall the required tools and actions using the following commands:\n\n```bash\n# Install Docker\nsudo apt update\nsudo apt install docker.io -y\n\n# Install Git\nsudo apt update\nsudo apt install git -y\n\n# Install GitHub Actions\nsudo apt update\nsudo apt install git -y\n```\n\n**Step 3: Create a new workflow file for the Golden Path**\n\nCreate a new file named `.github/workflows/golden-path.yml` in your IDP repository with the following content:\n\n```yaml\nname: Golden Path CI/CD\non: [push, pull_request]\n\njobs:\n build:\n runs-on", "metrics": { "length": 1055, "commands": 11, "command_list": [ "mkdir my-idp", "cd my-idp", "git init", "git add .", "git commit -m \"Initial commit for my IDP\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "API 设计原则 — 无抽象、一致性、幂等性 (lesson-20-api-design-principles)", "condition": "with_lesson", "status": 200, "content": "根据问题描述,API 设计不一致导致开发者困惑。因此,我们需要根据给出的解决方案,进行具体的改进。\n\n以下是具体的改进步骤:\n\n1. **无抽象(No Abstractions)**\n\n首先,我们需要将 POST /api/v1/actions 改为 POST /api/v1/users,直接创建用户。\n\n```bash\n# 移动文件\nmv api/v1/actions/api/v1/actions.py api/v1/users/\n\n# 更新代码\ntouch api/v1/users/users.py\n```\n\n2. **一致性**\n\n所有资源使用相同模式:\n\n- GET /api/v1/{resource} -> 列表\n- POST /api/v1/{resource} -> 创建\n- GET /api/v1/{resource}/{id} -> 获取\n- PATCH /api/v1/{resource}/{id} -> 更新\n- DELETE /api/v1/{resource}/{id} -> 删除\n\n```bash\n# 重写 API routes\ntouch api/routes.py\n```\n\n```python\nfrom flask import Flask, request, jsonify\nfrom flask_restful import Api, Resource\n\napp = Flask(__name__)\napi = Api(app)\n\nclass User(Resource):\n def get(self, id):\n", "metrics": { "length": 687, "commands": 3, "command_list": [ "mv api/v1/actions/api/v1/actions.py api/v1/users/", "touch api/v1/users/users.py", "touch api/routes.py" ], "has_command_block": true, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "DevOps Platform Engineering — Golden Paths to Reduce Cognitive Load (lesson-review-3-devops-platform-engineering)", "condition": "plain", "status": 200, "content": "I don't see any error message provided. However, I can guide you through a common issue that might be related to the topic of DevOps Platform Engineering.\n\nLet's assume the issue is related to a deployment or a configuration problem. Here's a step-by-step guide to troubleshoot and fix a common issue:\n\n**Issue:** Deployment failed due to a configuration mismatch.\n\n**Symptoms:** The deployment fails with an error message indicating a configuration mismatch between the source code and the target environment.\n\n**Actionable Fix:**\n\n1. **Check the Git repository**: Ensure that the Git repository is up-to-date and that the latest changes are being pulled.\n\n ```bash\n git pull origin main\n ```\n\n2. **Verify the configuration files**: Check the configuration files (e.g., `docker-compose.yml`, `kubernetes.yaml`) for any typos or incorrect settings.\n\n ```bash\n cat docker-compose.yml\n cat kubernetes.yaml\n ```\n\n3. **Check the Docker images**: Verify that the Docker images are up-to-date and correctly tagged.\n\n ```bash\n docker images\n docker tag /\n ```\n\n4. **Check the Kubernetes manifests**: Verify that the Kubernetes manifests are correctly", "metrics": { "length": 1200, "commands": 5, "command_list": [ "git pull origin main", "cat docker-compose.yml", "cat kubernetes.yaml", "docker images", "docker tag /" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare AI Traffic Options — Content Monetization for the Agentic Internet (lesson-review-8-cloudflare-ai-traffic-options)", "condition": "with_lesson", "status": 200, "content": "Based on the provided lesson, the issue seems to be related to the payment for the crawls via the x402 protocol. Here's a step-by-step fix with exact commands:\n\n**Step 1: Verify the API Token**\n\nBefore proceeding, ensure that you have a valid API token. You can generate a new token in the Cloudflare dashboard:\n\n1. Log in to your Cloudflare account.\n2. Go to the \"Account\" tab and click on \"API Tokens\".\n3. Click on \"Generate\" to create a new token.\n4. Copy the token and store it securely.\n\n**Step 2: Block AI Bots**\n\nTo block AI bots, you can use the following command:\n\n```bash\ncurl -X POST \"https://api.cloudflare.com/client/v4/zones/{zone_id}/ai-crawl\" \\\n -H \"Authorization: Bearer {token}\" \\\n -d '{\n \"action\": \"block_ai_bots\"\n }'\n```\n\nReplace `{zone_id}` with your actual Cloudflare zone ID and `{token}` with the API token you generated earlier.\n\n**Step 3: Enable Pay-Per-Crawl**\n\nTo enable pay-per-crawl, you need to configure the `pay_per_crawl` action in", "metrics": { "length": 971, "commands": 5, "command_list": [ "curl -X POST \"https://api.cloudflare.com/client/v4/zones/{zone_id}/ai-crawl\" \\", "-H \"Authorization: Bearer {token}\" \\", "-d '{", "\"action\": \"block_ai_bots\"", "}'" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "lessons md fix heading block type (lessons-md-fix-heading-block-type)", "condition": "with_lesson", "status": 200, "content": "To fix the error \"lessons md fix heading block type\", you need to update the heading blocks to use the correct block type. Here are the steps:\n\n1. Open the `lessons-md-fix-heading-block-type.md` file in your text editor.\n2. Search for the following lines:\n```\n---\ntype: 4\n---\n```\n```\n---\ntype: 5\n---\n```\n```\n---\ntype: 6\n---\n```\n3. Replace each line with the correct block type, for example:\n```\n---\ntype: 4\nheading1: 'Heading 1'\n---\n```\n```\n---\ntype: 5\nheading2: 'Heading 2'\n---\n```\n```\n---\ntype: 6\nheading3: 'Heading 3'\n---\n```\n4. Save the changes to the file.\n\nYou can also use the following command to update the file:\n```\nsed -i 's/type: 4/type: 4 heading1: \"Heading 1\"/g' lessons/contrib/lessons-md-fix-heading-block-type.md\nsed -i 's/type: 5/type: 5 heading2: \"Heading 2\"/g' lessons/contrib/lessons-md-fix-heading-block-type.md\nsed", "metrics": { "length": 837, "commands": 21, "command_list": [ "---", "type: 4", "---", "---", "type: 5" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "lessons md fix heading block type (lessons-md-fix-heading-block-type)", "condition": "plain", "status": 200, "content": "The error message \"lessons md fix heading block type (lessons-md-fix-heading-block-type)\" typically indicates that there is a heading block type mismatch in your Markdown file.\n\nTo fix this, you can use the following commands in your terminal:\n\n1. Open your Markdown file in a text editor.\n2. Use the following command to fix the heading block type:\n```\ngit rm -f --cached .\ngit add .\ngit commit -m \"Fix heading block type\"\n```\nOr, if you are using a code editor with Git integration, you can simply click on the \"Fix\" button next to the error message.\n\nAlternatively, you can also use the following command to fix the heading block type automatically:\n```\nyarn fix:lessons-md-fix-heading-block-type\n```\nor\n```\nnpm run lessons-md-fix-heading-block-type\n```\nThis command will fix the heading block type for you.\n\nNote: Make sure you have the `lessons-md-fix-heading-block-type` script installed in your project by running `yarn add lessons-md-fix-heading-block-type` or `npm install lessons-md-fix-heading-block-type`", "metrics": { "length": 1016, "commands": 5, "command_list": [ "git rm -f --cached .", "git add .", "git commit -m \"Fix heading block type\"", "yarn fix:lessons-md-fix-heading-block-type", "npm run lessons-md-fix-heading-block-type" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Cloudflare AI Traffic Options — Content Monetization for the Agentic Internet (lesson-review-8-cloudflare-ai-traffic-options)", "condition": "plain", "status": 200, "content": "I don't see any error message provided. However, I'll provide a general solution for the Cloudflare AI Traffic Options error. If you provide the exact error message, I can give you a more specific solution.\n\nThat being said, the Cloudflare AI Traffic Options error is often related to the Cloudflare AI Traffic Options not being enabled or the incorrect configuration. Here are some steps you can take to troubleshoot and fix the issue:\n\n1. Check if Cloudflare AI Traffic Options is enabled:\n\n Log in to your Cloudflare account and go to the \"AI\" tab. Make sure that Cloudflare AI Traffic Options is enabled.\n\n2. Check your content monetization settings:\n\n Go to the \"Content Monetization\" tab and ensure that your content monetization settings are correct. You should have the \"Allow AI traffic\" option enabled.\n\n3. Check your Cloudflare dashboard for any errors:\n\n Go to the \"Dashboard\" tab and check for any errors or warnings related to Cloudflare AI Traffic Options.\n\n4. Try disabling and re-enabling Cloudflare AI Traffic Options:\n\n Go to the \"AI\" tab and disable Cloudflare AI Traffic Options. Wait for a few minutes and then re-enable it.\n\n5. Check for any updates to the Cloudflare dashboard", "metrics": { "length": 1208, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "macOS Homebrew Python: pip install Blocked by PEP 668 externally-managed-environment (macos-homebrew-python-pip-install-blocked-by-pep-668-externa)", "condition": "with_lesson", "status": 200, "content": "To resolve the issue of pip being blocked by PEP 668 on macOS with Homebrew Python, you can follow these steps:\n\n**Step 1: Verify the marker file**\n\nRun the following command to check if the EXTERNALLY-MANAGED marker file exists:\n```bash\npython3 -c \"import sysconfig; print(sysconfig.get_paths()['stdlib'])\"\n```\nThis should print the path to the `stdlib` directory. Look for the `externally-managed-environment` file in that directory.\n\n**Step 2: Install Python packages using a virtual environment**\n\nCreate a new virtual environment and activate it:\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\nThen, install the package using pip:\n```bash\npip install pyyaml\n```\nThis will install the package in the virtual environment, which is not system-wide and should not be affected by the EXTERNALLY-MANAGED marker file.\n\n**Step 3: Install system-wide packages using Homebrew**\n\nIf you need to install system-wide packages, you can use Homebrew to install them. Run the following command to install the package:\n```bash\nbrew install pyyaml\n```\nThis will install the package system-wide", "metrics": { "length": 1093, "commands": 5, "command_list": [ "python3 -c \"import sysconfig; print(sysconfig.get_paths()['stdlib'])\"", "python3 -m venv .venv", "source .venv/bin/activate", "pip install pyyaml", "brew install pyyaml" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "macOS Homebrew Python: pip install Blocked by PEP 668 externally-managed-environment (macos-homebrew-python-pip-install-blocked-by-pep-668-externa)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to a change in pip's behavior, which was introduced in PEP 668. This change blocks installations from environments that are not managed by pip itself. Here's a concrete, actionable fix:\n\n**Step 1: Uninstall Homebrew's Python**\n\n```bash\nbrew uninstall python\n```\n\n**Step 2: Reinstall Homebrew's Python**\n\n```bash\nbrew install python\n```\n\n**Step 3: Install pip using Homebrew's Python**\n\n```bash\npython -m ensurepip\n```\n\nThis command will install pip using Homebrew's Python.\n\n**Step 4: Verify pip installation**\n\n```bash\npip --version\n```\n\nThis command should print the version of pip installed by Homebrew.\n\n**Step 5: Install packages**\n\n```bash\npip install \n```\n\nReplace `` with the name of the package you want to install.\n\nAlternatively, if you want to avoid reinstalling pip, you can try to resolve the issue by running the following commands:\n\n```bash\nbrew link python --force\npip install --upgrade pip\n```\n\nHowever, the first method is generally recommended as it ensures that pip is installed correctly and is compatible with Homebrew's Python.", "metrics": { "length": 1116, "commands": 7, "command_list": [ "brew uninstall python", "brew install python", "python -m ensurepip", "pip --version", "pip install " ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Паттерны тестирования MCP серверов — прямой вызов обработчика (mcp-server-testing-patterns-ru)", "condition": "plain", "status": 200, "content": "Unfortunately, I don't see any code provided, but I can guide you on how to approach this error.\n\nThe error \"Паттерны тестирования MCP.SERVERов — прямой вызов обработчика\" translates to \"Testing patterns for MCP Servers - direct call to handler\" in Russian.\n\nThis error typically occurs when there's a direct call to a handler in a test, which can lead to unexpected behavior.\n\nHere's a concrete, actionable fix with exact commands:\n\n1. **Check your test code**: Review your test code to identify any direct calls to handlers. Look for methods that call other methods directly without any intermediate steps.\n\n2. **Use dependency injection**: If you're using a framework that supports dependency injection, use it to provide the dependencies to your handlers. This will make your code more testable and reduce the likelihood of direct calls.\n\n3. **Use mock objects**: If you can't avoid direct calls, use mock objects to isolate the dependencies and make your tests more reliable.\n\n4. **Use a testing framework**: Consider using a testing framework that provides built-in support for mocking and dependency injection, such as Mockito or Moq.\n\nHere's an example of how you can use Mockito to mock a dependency:\n\nLet's say you have a handler that depends", "metrics": { "length": 1252, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Паттерны тестирования MCP серверов — прямой вызов обработчика (mcp-server-testing-patterns-ru)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix with exact commands to resolve the error.\n\n**Step 1: Create a new file for the rpc function**\n\nCreate a new file named `rpc.py` and add the following code:\n\n```python\nfrom scripts.mcp_server import handle_request\n\ndef rpc(method: str, params: dict = None) -> dict:\n \"\"\"Отправить JSON-RPC запрос обработчику напрямую.\"\"\"\n return handle_request({\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": method,\n \"params\": params or {}\n })\n```\n\n**Step 2: Import the rpc function in your test file**\n\nOpen your test file (e.g., `test_mcp_server.py`) and import the `rpc` function:\n\n```python\nfrom rpc import rpc\n```\n\n**Step 3: Write a test for the rpc function**\n\nAdd the following test code to your test file:\n\n```python\nimport unittest\nimport json\n\nclass TestMCPServer(unittest.TestCase):\n def test_rpc(self):\n result = rpc(\"tools/call\", {\n \"name\": \"misakanet.search\",\n \"arguments\": {\"query\": \"database locked\", \"limit\": 3}\n ", "metrics": { "length": 1016, "commands": 4, "command_list": [ "**Step 2: Import the rpc function in your test file**", "Open your test file (e.g., `test_mcp_server.py`) and import the `rpc` function:", "**Step 3: Write a test for the rpc function**", "Add the following test code to your test file:" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "mergeable_state blocked does not mean failing CI (mergeable-state-blocked-not-red-ci)", "condition": "with_lesson", "status": 200, "content": "To fix the error and understand why your pull request is blocked, follow these steps:\n\n1. Check the mergeable_state: \n - Run the command `curl -X GET 'https://api.github.com/repos/{owner}/{repo}/pulls/{pull_number}/mergeable'` to get the mergeable_state.\n\n2. Check the check-runs:\n - Run the command `curl -X GET 'https://api.github.com/repos/{owner}/{repo}/commits/{commit_hash}/check-runs'` to get the check-runs for the specific commit hash.\n\n3. Enumerate all checks:\n - Run the command `curl -X GET 'https://api.github.com/repos/{owner}/{repo}/commits/{commit_hash}/check-runs'` and look for the \"status\" field to see if any checks have failed.\n\n4. Fix the check-runs:\n - If a check has failed, fix the issue and re-run the check.\n\nHere's an example of how you can use these commands in a shell script:\n\n```bash\n#!/bin/bash\n\n# Replace with your owner and repository name\nOWNER=\"your-owner\"\nREPO=\"your-repo\"\n\n# Replace with the pull request number\nPULL_NUMBER=123", "metrics": { "length": 974, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "mergeable_state blocked does not mean failing CI (mergeable-state-blocked-not-red-ci)", "condition": "plain", "status": 200, "content": "The error you're encountering, \"mergeable_state blocked does not mean failing CI (mergeable-state-blocked-not-red-ci),\" typically occurs when you're trying to merge a branch into the main branch (usually `main` or `master`) in a Git repository, but the merge is blocked due to a specific configuration setting in your Git configuration.\n\nTo resolve this issue, you can try the following steps:\n\n1. Check your Git configuration:\n\n Run the following command in your terminal to check your Git configuration:\n\n ```bash\ngit config --list\n```\n\n Look for the following lines in your configuration:\n\n ```\nmerge.mergemanagement\nmerge.rebase\n```\n\n If you find any lines that start with `merge.mergemanagement` or `merge.rebase`, you'll need to adjust them.\n\n2. Update your Git configuration:\n\n To unblock the merge, you can try the following commands:\n\n ```bash\ngit config --unset merge.mergemanagement\ngit config --unset merge.rebase\n```\n\n If you want to keep these settings, you can modify them to suit your needs.\n\n3. Try to merge the branch again:\n\n Once you've updated your Git configuration, try to merge the branch again:\n\n ", "metrics": { "length": 1141, "commands": 5, "command_list": [ "git config --list", "merge.mergemanagement", "merge.rebase", "git config --unset merge.mergemanagement", "git config --unset merge.rebase" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MisakaNet --heal Engine Bootstrap Workflow (misakanet-heal-engine-bootstrap-workflow)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of the lack of documentation for the 5-step bootstrap workflow in MisakaNet's search_knowledge.py, we can create a new lesson that explains the full workflow. Here's a step-by-step guide to create this lesson:\n\n**Create a new lesson**\n\nCreate a new file `search_knowledge.md` in the `docs` directory of your MisakaNet repository. This file will serve as the new lesson explaining the bootstrap workflow.\n\n**Write the lesson**\n\nAdd the following content to the `search_knowledge.md` file:\n\n---\n\n**MisakaNet --heal Engine Bootstrap Workflow**\n\nThis is the end-to-end error triage pipeline that turns a CLI fatal error into a search against the swarm's shared lesson corpus. The workflow consists of 5 steps:\n\n### Step 1: Signature Extraction\n\n* **Purpose:** Extract all error signatures from the traceback, error message, and exit code.\n* **Process:**\n * `traceback →` extract the traceback lines.\n * `error signature →` extract the error signature from the traceback lines.\n * `exit code →` extract the exit code from the error message.\n * `last N lines →` extract the last N lines of the error", "metrics": { "length": 1134, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "MisakaNet --heal Engine Bootstrap Workflow (misakanet-heal-engine-bootstrap-workflow)", "condition": "plain", "status": 200, "content": "The error message you're seeing is likely due to a missing or incorrect `--heal` flag in your `MisakaNet` command.\n\nTo fix this, you need to specify the `--heal` flag along with the engine and workflow you want to use. Here's a concrete, actionable fix:\n\n1. Open your terminal and navigate to the directory where you're running the `MisakaNet` command.\n2. Check if you have the `MisakaNet` command installed and up-to-date. You can do this by running the following command:\n ```bash\nmiskanet --version\n```\n If you don't have the `MisakaNet` command installed, you can install it using your package manager or by downloading the binary from the official website.\n\n3. If you have the `MisakaNet` command installed, try running the following command to fix the error:\n ```bash\nmiskanet --heal Engine Bootstrap Workflow\n```\n If this command still doesn't work, you might need to specify the engine and workflow separately:\n ```bash\nmiskanet --heal Engine --workflow Bootstrap Workflow\n```\n Replace `Engine` and `Bootstrap Workflow` with the actual engine and workflow", "metrics": { "length": 1075, "commands": 3, "command_list": [ "miskanet --version", "miskanet --heal Engine Bootstrap Workflow", "miskanet --heal Engine --workflow Bootstrap Workflow" ], "has_command_block": true, "actionable": true, "inline_code_count": 14, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "misakanet refactor v2 review (misakanet-refactor-v2-review)", "condition": "with_lesson", "status": 200, "content": "Based on the provided lesson, it appears that the misakanet-refactor-v2-review.md file is not being updated correctly. Here's a concrete, actionable fix with exact commands to update the file:\n\n```bash\necho \"Lesson: misakanet refactor v2 review\n (line count)\" > lessons/contrib/misakanet-refactor-v2-review.md\n```\n\nHowever, this will create a new file instead of updating the existing one. To update the existing file, you can use the following command:\n\n```bash\necho \"Lesson: misakanet refactor v2 review\n (line count)\" >> lessons/contrib/misakanet-refactor-v2-review.md\n```\n\nThis will append the new content to the end of the existing file.\n\nIf you want to update the line count, you can use the following command:\n\n```bash\nwc -l lessons/contrib/misakanet-refactor-v2-review.md > lessons/contrib/misakanet-refactor-v2-review.md\n```\n\nHowever, this will overwrite the existing file. To append the new line count to the end of the existing file, you can use the following command:\n\n```bash\nwc -l lessons/contrib/misakanet-refactor-v2-review.md", "metrics": { "length": 1042, "commands": 5, "command_list": [ "echo \"Lesson: misakanet refactor v2 review", "(line count)\" > lessons/contrib/misakanet-refactor-v2-review.md", "echo \"Lesson: misakanet refactor v2 review", "(line count)\" >> lessons/contrib/misakanet-refactor-v2-review.md", "wc -l lessons/contrib/misakanet-refactor-v2-review.md > lessons/contrib/misakanet-refactor-v2-review.md" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "misakanet refactor v2 review (misakanet-refactor-v2-review)", "condition": "plain", "status": 200, "content": "The error message suggests that there's a problem with the `misakanet-refactor-v2-review` repository. Without more context, it's difficult to provide a precise solution. However, I can offer some general steps to troubleshoot and potentially fix the issue.\n\nHere are some possible causes and solutions:\n\n1. **Incorrect repository URL**:\n\n If the repository URL is incorrect, it can cause the review to fail.\n\n Solution:\n\n Check the repository URL in your `git config` settings or the `review` configuration file. Make sure it's correct.\n\n ```bash\ngit config --get remote.origin.url\n```\n\n If the URL is incorrect, update it using:\n\n ```bash\ngit remote set-url origin \n```\n\n2. **Incorrect branch or commit hash**:\n\n If the branch or commit hash is incorrect, it can cause the review to fail.\n\n Solution:\n\n Check the branch and commit hash in your `review` configuration file or the `git config` settings.\n\n ```bash\ngit config --get branch.review\n```\n\n ```bash\ngit config --get remote.origin.refspecs\n```\n\n If the branch or commit hash is incorrect, update it using:\n\n ```bash\ngit checkout <", "metrics": { "length": 1127, "commands": 4, "command_list": [ "git config --get remote.origin.url", "git remote set-url origin ", "git config --get branch.review", "git config --get remote.origin.refspecs" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "多模型Switch脚本模式 — 双 Agent 模型管理 (model-switch-script-pattern)", "condition": "with_lesson", "status": 200, "content": "The error message you're encountering suggests that there's an issue with model-switching scripts for two agents, A and B. To resolve this, you'll need to create separate scripts for each agent and configure them to manage their respective models, proxies, and configurations.\n\nHere's a step-by-step guide to fixing the issue:\n\n**Step 1: Create a new script for Agent A**\n\nCreate a new file named `switch-agent-a.sh` in the desired location (e.g., `~/switch-agent-a`):\n\n```bash\n#!/bin/bash\n\n# Update Agent A's configuration file\necho \"Updating Agent A's configuration file...\"\nsed -i 's/model-x/model-y/g' ~/agent-a/config.yaml\n\n# Sync configuration to cross-platform paths\necho \"Syncing configuration to cross-platform paths...\"\ncp ~/agent-a/config.yaml ~/agent-b/config.yaml\n\n# Restart local proxy with new upstream\necho \"Restarting local proxy with new upstream...\"\nsystemctl restart proxy-server\n```\n\nMake the script executable:\n\n```bash\nchmod +x ~/switch-agent-a.sh\n```\n\n**Step 2: Create a new script for Agent B**\n\nCreate a new file named `switch-agent-b.sh` in the desired location (e.g., `~/switch-agent", "metrics": { "length": 1111, "commands": 7, "command_list": [ "echo \"Updating Agent A's configuration file...\"", "sed -i 's/model-x/model-y/g' ~/agent-a/config.yaml", "echo \"Syncing configuration to cross-platform paths...\"", "cp ~/agent-a/config.yaml ~/agent-b/config.yaml", "echo \"Restarting local proxy with new upstream...\"" ], "has_command_block": true, "actionable": false, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "多模型Switch脚本模式 — 双 Agent 模型管理 (model-switch-script-pattern)", "condition": "plain", "status": 200, "content": "The error message \"多模型Switch脚本模式 — 双 Agent 模型管理 (model-switch-script-pattern)\" is a translation of the error message \"Multi-model Switch Script Pattern - Dual Agent Model Management\" in English.\n\nThis error typically occurs when you're trying to use a multi-model script pattern with dual agents in a specific context, such as in a machine learning or data science pipeline. To fix this error, you'll need to adjust your script or configuration to ensure that it's compatible with the dual agent model management.\n\nHere's a concrete, actionable fix with exact commands:\n\n**Assuming you're using TensorFlow and Keras**\n\n1. Check your script for the following lines:\n ```python\nfrom tensorflow.keras.layers import Input, Dense\nfrom tensorflow.keras.models import Model\n```\n If you see these lines, replace them with the following code:\n ```python\nfrom tensorflow.keras.layers import Input, Dense\nfrom tensorflow.keras.models import Model, Sequential\n```\n This change will ensure that your script uses the Sequential API, which is compatible with dual agent model management.\n\n2. Check your model architecture for the following lines:\n ```python\nmodel.add(Dense(64, activation='relu'))\nmodel.add(Dense(32, activation='relu'))\nmodel", "metrics": { "length": 1238, "commands": 3, "command_list": [ "If you see these lines, replace them with the following code:", "This change will ensure that your script uses the Sequential API, which is compatible with dual agent model management.", "2. Check your model architecture for the following lines:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "npm install failing on one host but not another (native build arch mismatch) (npm-native-build-arch-mismatch)", "condition": "with_lesson", "status": 200, "content": "To fix the \"native build arch mismatch\" error, follow these steps:\n\n**Step 1: Pin the Node version in CI**\n\nUpdate your `package.json` file with the following configuration:\n\n```json\n{\n \"engines\": {\n \"node\": \">=14.17.0\"\n }\n}\n```\n\n**Step 2: Add native build prerequisites as a CI step**\n\nCreate a new file named `.github/workflows/install.yml` in the root of your repository with the following content:\n\n```yaml\nname: Install\n\non:\n push:\n branches:\n - main\n\njobs:\n install:\n runs-on: ubuntu-latest\n steps:\n - name: Setup Node.js\n uses: actions/setup-node@v2\n with:\n node-version: '14.17.0'\n\n - name: Install dependencies\n run: npm ci\n```\n\n**Step 3: Set the prebuild registry explicitly**\n\nRun the following command in your CI workflow:\n\n```bash\nnpm_config_build_from_source=false npm ci\n```\n\nYou can add this command as a step before the `npm ci` step in your `.github/workflows/install.yml` file:\n\n```yaml\n - name: Set prebuild", "metrics": { "length": 993, "commands": 5, "command_list": [ "**Step 2: Add native build prerequisites as a CI step**", "Create a new file named `.github/workflows/install.yml` in the root of your repository with the following content:", "**Step 3: Set the prebuild registry explicitly**", "Run the following command in your CI workflow:", "You can add this command as a step before the `npm ci` step in your `.github/workflows/install.yml` file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright Chromium launch fails on WSL2 with missing libnss3 / libnspr4 (openclaw-playwright-wsl-libnss3-libnspr4-snap-chromium)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you need to install the `libnss3` and `libnspr4` packages on your WSL2 Ubuntu 24.04 image. Here are the steps:\n\n**Method 1: Using `apt` with `sudo`**\n\n1. Open a terminal in your WSL2 Ubuntu 24.04 image.\n2. Run the following command to install the `libnss3` and `libnspr4` packages using `apt` with `sudo`:\n```bash\nsudo apt update\nsudo apt install -y libnss3 libnspr4\n```\n3. Once the installation is complete, you can try running your Playwright script again.\n\n**Method 2: Using `apt` without `sudo` (for Ubuntu 24.04 minimal images)**\n\n1. Open a terminal in your WSL2 Ubuntu 24.04 image.\n2. Run the following command to install the `libnss3` and `libnspr4` packages using `apt` without `sudo`:\n```bash\napt update\napt install -y libnss3 libnspr4\n```\n3. Note that this method may not work for all Ubuntu 24.04 minimal", "metrics": { "length": 833, "commands": 4, "command_list": [ "sudo apt update", "sudo apt install -y libnss3 libnspr4", "apt update", "apt install -y libnss3 libnspr4" ], "has_command_block": true, "actionable": true, "inline_code_count": 16, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Opire Bounty 实战经验 — 认领、收款与信任分级 (opire-bounty-hunting)", "condition": "plain", "status": 200, "content": "I'm happy to help you with the error, but I don't see any error message provided. The text you provided seems to be a title of a tutorial or a topic, but it doesn't contain any error message.\n\nCould you please provide the actual error message you're encountering? This will allow me to provide a more accurate and actionable fix.\n\nOnce you provide the error message, I'll do my best to assist you in resolving the issue.", "metrics": { "length": 420, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "npm install failing on one host but not another (native build arch mismatch) (npm-native-build-arch-mismatch)", "condition": "plain", "status": 200, "content": "The \"native build arch mismatch\" error occurs when the architecture of the operating system (OS) and the architecture of the package being installed do not match. Here's a concrete, actionable fix with exact commands to resolve this issue:\n\n**Step 1: Check the OS architecture**\n\nRun the following command to check the architecture of your OS:\n```bash\nlscpu\n```\nor\n```bash\nuname -m\n```\nThis will display the architecture of your OS.\n\n**Step 2: Check the package architecture**\n\nRun the following command to check the architecture of the package being installed:\n```bash\nnpm ls \n```\nReplace `` with the actual name of the package you're trying to install.\n\nThis will display the architecture of the package.\n\n**Step 3: Install the package with the correct architecture**\n\nIf the package architecture does not match the OS architecture, you'll need to install the package with the correct architecture. Here are the steps:\n\n**For x86_64 (64-bit) OS**\n\n* If your OS is x86_64, you can install the package with the x86_64 architecture using the following command:\n```bash\nnpm install --arch=x86_64\n``", "metrics": { "length": 1139, "commands": 3, "command_list": [ "lscpu", "uname -m", "npm ls " ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Playwright Chromium launch fails on WSL2 with missing libnss3 / libnspr4 (openclaw-playwright-wsl-libnss3-libnspr4-snap-chromium)", "condition": "plain", "status": 200, "content": "The error you're experiencing is due to missing dependencies required by Playwright Chromium on WSL2. Here's a step-by-step guide to resolve the issue:\n\n**Step 1: Install the necessary dependencies**\n\nYou'll need to install `libnss3` and `libnspr4` packages using the following command:\n\n```bash\nsudo apt-get update\nsudo apt-get install -y libnss3 libnspr4\n```\n\n**Step 2: Install the chromium browser**\n\nYou'll also need to install the Chromium browser, which is required by Playwright Chromium. You can install it using the following command:\n\n```bash\nsudo apt-get install -y chromium-browser\n```\n\n**Step 3: Install the Playwright Chromium browser**\n\nNow, you need to install the Playwright Chromium browser. You can do this by running the following command:\n\n```bash\nsudo snap install playwright --classic\n```\n\nThis command will install Playwright Chromium using the `snap` package manager.\n\n**Step 4: Verify the installation**\n\nAfter installing the dependencies and Playwright Chromium, you can verify that everything is working correctly by running the following command:\n\n```bash\nplaywright launch --headless --no-sandbox --default-browser-chromium\n```\n\n", "metrics": { "length": 1159, "commands": 5, "command_list": [ "sudo apt-get update", "sudo apt-get install -y libnss3 libnspr4", "sudo apt-get install -y chromium-browser", "sudo snap install playwright --classic", "playwright launch --headless --no-sandbox --default-browser-chromium" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "حل مشكلة استنفاد تجميع اتصالات قاعدة البيانات PostgreSQL في بيئات الإنتاج (postgresql-connection-pool-exhaustion-ar)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of PostgreSQL connection pool exhaustion in production environments, you need to address two main causes:\n\n1. **Connection Leaks**: Ensure that all database connections are properly closed and released back to the pool after use.\n2. **Pool Limits**: Set a reasonable maximum number of connections allowed in the pool.\n\nHere's a concrete, actionable fix with exact commands:\n\n### Step 1: Modify Database Connection Code to Ensure Connection Closure\n\nUpdate your database connection code to close connections properly using a `finally` block:\n\n```javascript\nconst { Pool } = require('pg');\n\nconst pool = new Pool({\n host: 'your_host',\n user: 'your_user',\n password: 'your_password',\n database: 'your_database',\n});\n\n// Example usage with a try-catch block\nasync function executeQuery(queryString) {\n try {\n const result = await pool.query(queryString);\n return result.rows;\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Close the connection to release it back to the pool\n await pool.end();\n }\n}\n\n// Call the function\nexecuteQuery('SELECT * FROM your_table');\n```\n\n### Step 2: Set a Reasonable Maximum Number", "metrics": { "length": 1171, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Opire Bounty 实战经验 — 认领、收款与信任分级 (opire-bounty-hunting)", "condition": "with_lesson", "status": 200, "content": "The issue lies in the fact that the `jq` command is not handling the case where the API response is empty. When there are no tasks available, the `length` function will return 0, but the `jq` command is expecting a non-zero value.\n\nTo fix this, you can modify the `jq` command to check if the length is greater than or equal to 0, and only then print \"Verification passed\". Here's the updated command:\n\n```bash\ncurl -s \"https://api.opire.dev/rewards?page=1&limit=5\" | jq 'length > 0' && echo \"Verification passed: Opire API reachable, rewards listed\"\n```\n\nThis command will check if the length of the JSON array is greater than 0, and only if it is, will it print \"Verification passed\".\n\nAlternatively, you can use the following command, which will print \"Verification passed\" regardless of the length of the JSON array:\n\n```bash\ncurl -s \"https://api.opire.dev/rewards?page=1&limit=5\" | jq 'length' && echo \"Verification passed: Opire API reachable, rewards listed\"\n```\n\nHowever, this command will print the length of the JSON array, which might not", "metrics": { "length": 1049, "commands": 2, "command_list": [ "curl -s \"https://api.opire.dev/rewards?page=1&limit=5\" | jq 'length > 0' && echo \"Verification passed: Opire API reachable, rewards listed\"", "curl -s \"https://api.opire.dev/rewards?page=1&limit=5\" | jq 'length' && echo \"Verification passed: Opire API reachable, rewards listed\"" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "External PR Strategy via pr-genius (pr-strategy)", "condition": "with_lesson", "status": 200, "content": "It seems like the issue is with the `wc -l` command not being able to count the lines in the `lessons/contrib/pr-strategy.md` file. This could be due to various reasons such as the file being empty, or the file not being in the correct location.\n\nHere's a concrete, actionable fix with exact commands:\n\n1. Check if the file exists and is not empty:\n ```bash\nls lessons/contrib/pr-strategy.md\n```\n If the file does not exist or is empty, create it.\n\n2. If the file exists but is empty, create it with a placeholder message:\n ```bash\ntouch lessons/contrib/pr-strategy.md\necho \"Lesson: External PR Strategy via pr-genius\" > lessons/contrib/pr-strategy.md\n```\n\n3. If the file exists but is not empty, try running the `wc -l` command again:\n ```bash\nwc -l lessons/contrib/pr-strategy.md\n```\n\nHowever, if the file is not empty and still not being counted, there might be an issue with the permissions or the file's ownership.\n\nHere is a more robust solution that checks the file's existence and permissions before running `wc -l`:\n```bash\nif", "metrics": { "length": 1043, "commands": 4, "command_list": [ "ls lessons/contrib/pr-strategy.md", "touch lessons/contrib/pr-strategy.md", "echo \"Lesson: External PR Strategy via pr-genius\" > lessons/contrib/pr-strategy.md", "wc -l lessons/contrib/pr-strategy.md" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "حل مشكلة استنفاد تجميع اتصالات قاعدة البيانات PostgreSQL في بيئات الإنتاج (postgresql-connection-pool-exhaustion-ar)", "condition": "plain", "status": 200, "content": "The error you're experiencing, `postgresql-connection-pool-exhaustion-ar`, occurs when the connection pool in PostgreSQL is exhausted, meaning that all available connections are being used up. This can happen due to a variety of reasons such as a high volume of concurrent connections, inefficient query optimization, or inadequate connection pool settings.\n\nHere's a concrete, actionable fix with exact commands to resolve this issue:\n\n### 1. Increase the Connection Pool Size\n\nIncrease the connection pool size to ensure there are enough connections available for your application to use.\n\n```sql\nALTER SYSTEM SET shared_buffers TO 1024MB;\nALTER SYSTEM SET effective_cache_size TO 512MB;\nALTER SYSTEM SET work_mem TO 16MB;\nALTER SYSTEM SET maintenance_work_mem TO 64MB;\nALTER SYSTEM SET max_connections TO 1000;\n```\n\n### 2. Adjust the Idle Connection Timeout\n\nAdjust the idle connection timeout to ensure connections are released back to the pool when not in use.\n\n```sql\nALTER SYSTEM SET idle_in_transaction_session_timeout TO 300; # 5 minutes\nALTER SYSTEM SET idle_in_transaction_session_timeout_max TO 300; # 5 minutes\nALTER SYSTEM SET idle_in_transaction_session_timeout_min TO 10; # 10 seconds\n```\n\n", "metrics": { "length": 1209, "commands": 1, "command_list": [ "Adjust the idle connection timeout to ensure connections are released back to the pool when not in use." ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "External PR Strategy via pr-genius (pr-strategy)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incorrect configuration in your `pr-genius.yml` file. Here's a step-by-step guide to fix the issue:\n\n**Step 1: Update your `pr-genius.yml` file**\n\nOpen your `pr-genius.yml` file in a text editor and update the `strategy` section to include the `name` and `url` properties:\n```yml\npr-genius:\n strategy:\n name: pr-strategy\n url: https://github.com/pr-genius/pr-genius\n```\n**Step 2: Add the `token` property (optional)**\n\nIf you're using GitHub Personal Access Tokens, you need to add the `token` property to authenticate with the `pr-genius` API:\n```yml\npr-genius:\n strategy:\n name: pr-strategy\n url: https://github.com/pr-genius/pr-genius\n token: YOUR_GITHUB_TOKEN_HERE\n```\nReplace `YOUR_GITHUB_TOKEN_HERE` with your actual GitHub Personal Access Token.\n\n**Step 3: Save and restart your workflow**\n\nSave the updated `pr-genius.yml` file and restart your GitHub Actions workflow. You can do this by clicking the \"", "metrics": { "length": 988, "commands": 2, "command_list": [ "**Step 2: Add the `token` property (optional)**", "If you're using GitHub Personal Access Tokens, you need to add the `token` property to authenticate with the `pr-genius` API:" ], "has_command_block": true, "actionable": false, "inline_code_count": 14, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "The Private Agent Memory Fallacy — Why Portable Memory Wallets Fail (private-agent-memory-fallacy)", "condition": "plain", "status": 200, "content": "The Private Agent Memory Fallacy is a common issue in cryptography and programming, where a private key is stored in memory and then used to sign a message. This can lead to a vulnerability known as a timing attack.\n\nTo fix this issue, you can use a Hardware Security Module (HSM) or a secure key storage solution. However, if you're looking for a software-based solution, here's a concrete, actionable fix:\n\n**Solution: Use a secure random number generator and a key derivation function**\n\nHere's an example of how you can implement this fix in Python:\n\n```python\nimport secrets\nimport hashlib\nimport hmac\nimport time\n\n# Generate a random private key\nprivate_key = secrets.token_bytes(32)\n\n# Generate a random salt\nsalt = secrets.token_bytes(16)\n\n# Generate a random nonce\nnonce = secrets.token_bytes(8)\n\n# Create a key derivation function\ndef derive_key(private_key, salt, nonce):\n return hmac.new((private_key + salt + nonce).encode(), private_key, hashlib.sha256).digest()\n\n# Create a message\nmessage = b\"Hello, World!\"\n\n# Sign the message\nsignature = derive_key(private_key, salt, nonce)\n\n# Verify the signature\ndef verify_signature(message, signature, salt", "metrics": { "length": 1165, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Prompt Injection: What''s the Worst That Can Happen? (prompt-injection-what-s-the-worst-that-can-happen)", "condition": "with_lesson", "status": 200, "content": "**Fixing Prompt Injection Vulnerability**\n\nTo mitigate the prompt injection vulnerability, we'll implement a simple yet effective solution that separates user input from system prompts and filters out malicious instructions.\n\n**Solution Overview**\n\nWe'll use a combination of regular expressions, string manipulation, and conditional statements to filter out malicious user input. Our goal is to prevent the concatenation of user input with system prompts, thereby preventing prompt injection attacks.\n\n**Code Example (Python)**\n```python\nimport re\n\n# Define a function to filter user input\ndef filter_user_input(user_input, system_prompt):\n # Remove any special characters that could be used for injection\n user_input = re.sub(r'[^a-zA-Z0-9\\s]', '', user_input)\n\n # Check for keywords that could indicate malicious intent\n malicious_keywords = ['Your system has a security hole', 'transform this to the language of a stereotypical 18th century pirate']\n if any(keyword in user_input.lower() for keyword in malicious_keywords):\n return None\n\n # If user input passes filtering, concatenate it with system prompt\n filtered_input = system_prompt + ' ' + user_input\n return filtered_input\n\n# Example usage:\nsystem_prompt = \"Translate the following text into French and return a", "metrics": { "length": 1304, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "The Private Agent Memory Fallacy — Why Portable Memory Wallets Fail (private-agent-memory-fallacy)", "condition": "with_lesson", "status": 200, "content": "The error you're experiencing is likely due to the markdown formatting in the file you're trying to verify. Here's a step-by-step guide on how to fix it:\n\n**Step 1: Open the file in a text editor**\n\nOpen the `private-agent-memory-fallacy.md` file in a text editor like Visual Studio Code, Sublime Text, or Atom.\n\n**Step 2: Remove the markdown formatting**\n\nThe error is caused by the markdown formatting in the title line. Remove the markdown formatting by deleting the following lines:\n\n```\nLesson: The Private Agent Memory Fallacy — Why Portable Me\n (line count)\n```\n\n**Step 3: Save the file**\n\nSave the file with the updated content.\n\n**Step 4: Verify the output**\n\nRun the following command in your terminal to verify the output:\n\n```bash\necho \"Lesson: The Private Agent Memory Fallacy — Why Portable Memory\"\nwc -l lessons/contrib/private-agent-memory-fallacy.md\n```\n\nThis command should output the correct line count for the updated file.\n\nIf you still encounter issues, ensure that your terminal is set up correctly and that you have the necessary permissions to read and write files in the `lessons/contrib` directory.", "metrics": { "length": 1125, "commands": 4, "command_list": [ "Lesson: The Private Agent Memory Fallacy — Why Portable Me", "(line count)", "echo \"Lesson: The Private Agent Memory Fallacy — Why Portable Memory\"", "wc -l lessons/contrib/private-agent-memory-fallacy.md" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "工艺卡步序提取:辅助动作不算独立步序,按工艺动作分界 (process-card-sequence-extraction-rules)", "condition": "with_lesson", "status": 200, "content": "Based on the error message and the provided verified lesson, it seems that the issue is related to the extraction of process card sequence from a Time Chart. The error message indicates that auxiliary actions are not being treated as independent steps, but rather are being included in the previous step's time.\n\nTo fix this issue, you can try the following steps:\n\n1. Review your Time Chart and identify the auxiliary actions that are not being treated as independent steps.\n2. Modify your Time Chart to include these auxiliary actions as separate steps.\n3. Use the \"辅助动作归入下一个工艺动作的步序\" rule to group the auxiliary actions with the previous step's action.\n\nHere is an example of how you can modify your Time Chart using the `fanuc` command-line tool:\n\n```bash\n# Define the Time Chart\ntime_chart=\"1s ┐ 2s ┐ 3s ┐ 4s ┐ 5s ┐ 6s ┐ 7s ┐\"\n\n# Use the \"辅助动作归入下一个工艺动作的步序\" rule\ntime_chart=$(echo \"$time_chart\" | sed -e 's/ ┐/ 1s/ 2s/ ", "metrics": { "length": 922, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Prompt Injection: What''s the Worst That Can Happen? (prompt-injection-what-s-the-worst-that-can-happen)", "condition": "plain", "status": 200, "content": "The error you're encountering is a result of a prompt injection vulnerability in your program. Prompt injection attacks occur when an attacker injects malicious input into a program's input prompt, potentially leading to code execution or other security breaches.\n\nTo fix this issue, you'll need to validate and sanitize all user input, especially those that are intended to be used as prompts. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update your package.json file**\n\nOpen your project's `package.json` file and update the `scripts` section to include a script that validates and sanitizes user input:\n```json\n\"scripts\": {\n \"start\": \"node index.js\",\n \"validate-input\": \"node validate-input.js\"\n}\n```\n**Step 2: Create a validate-input.js file**\n\nCreate a new file named `validate-input.js` in the root of your project:\n```javascript\nconst readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('What is the user input? ', (input) => {\n const sanitizedInput = sanitizeInput(input);\n console.log(`Sanitized input: ${sanitizedInput}`);\n rl.close();\n});\n\nfunction sanitize", "metrics": { "length": 1180, "commands": 2, "command_list": [ "**Step 2: Create a validate-input.js file**", "Create a new file named `validate-input.js` in the root of your project:" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Brand Filter Three Pitfalls (rag-brand-filter-three-pitfalls)", "condition": "plain", "status": 200, "content": "I'd be happy to help you resolve the issue. However, I don't see any error message or code provided. Could you please provide more context or details about the error you're experiencing, such as:\n\n* The programming language you're using\n* The relevant code snippet that's causing the error\n* Any error messages you're seeing\n\nOnce I have this information, I'll do my best to provide a concrete and actionable fix with exact commands.", "metrics": { "length": 433, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "工艺卡步序提取:辅助动作不算独立步序,按工艺动作分界 (process-card-sequence-extraction-rules)", "condition": "plain", "status": 200, "content": "To fix the error, you can use the following commands to update the process card sequence extraction rules:\n\n**Note:** These commands are for the Alfresco process modeler. Please adjust them according to your specific version or tool.\n\n**Update process card sequence extraction rules:**\n\n1. Open the Alfresco process modeler and navigate to the process definition that contains the process card.\n2. Click on the \"Process\" tab in the top navigation bar.\n3. Click on the \"Process Card\" button in the right-hand Actions panel.\n4. In the Process Card editor, click on the \"Sequence\" tab.\n5. In the Sequence tab, click on the \"Extraction Rules\" button.\n6. In the Extraction Rules panel, click on the \"Add Rule\" button.\n7. Select the \"Process Card\" rule and click \"OK\".\n8. In the Process Card rule, select the \"Include auxiliary actions\" option and click \"OK\".\n9. Repeat steps 6-8 for each process card that needs to be updated.\n\nAlternatively, you can also use the Alfresco REST API to update the process card sequence extraction rules. Here's an example command:\n\n**Update process card sequence extraction rules using Alfresco REST API:**\n\n```bash\ncurl -X", "metrics": { "length": 1150, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Brand Filter Three Pitfalls (rag-brand-filter-three-pitfalls)", "condition": "with_lesson", "status": 200, "content": "Here are concrete, actionable fixes for each of the three pitfalls:\n\n**Pitfall 1: Conditionally Triggered Brand Filtering**\n\nTo fix this pitfall, we need to always enable brand filtering and exclude non-target-brand documents directly at the retrieval layer.\n\nAssuming you're using a search engine like Elasticsearch, here's how you can modify your mapping to always enable brand filtering:\n\n```python\n# mapping.py\n{\n \"properties\": {\n \"title\": {\"type\": \"text\"},\n \"description\": {\"type\": \"text\"},\n \"content\": {\"type\": \"text\"},\n \"filename\": {\"type\": \"text\"}\n },\n \"mappings\": {\n \"properties\": {\n \"filename\": {\n \"type\": \"text\",\n \"analyzer\": {\n \"brand_filter_analyzer\": {\n \"type\": \"custom\",\n \"tokenizer\": \"standard\",\n \"filter\": [\"lowercase\", \"ngram\", \"brand_filter\"]\n }\n },\n \"filter\": [\"brand_filter\"]\n }\n }\n }\n}\n```\n\nIn the above code, we've added a custom analyzer called `brand_filter_analyzer` that includes a `brand_filter` filter. This filter will be applied to the `filename", "metrics": { "length": 1219, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Build Strategy Batch (rag-build-strategy-batch)", "condition": "with_lesson", "status": 200, "content": "To fix the error, we need to process the embeddings in batches that fit within the available VRAM/WSL memory. Here's a concrete, actionable fix:\n\n**Step 1: Verify the RAG config and ingestion log**\n\nRun the following command to verify the RAG config and ingestion log:\n```bash\ngrep -i 'bm25\\|chunk\\|embed' lessons/contrib/rag-.md 2/dev/null | head -3\necho Search verified\n```\nThis command checks if the RAG config and ingestion log contain any relevant information.\n\n**Step 2: Check the cache status**\n\nRun the following command to check the cache status:\n```bash\ngrep -i 'cache' lessons/contrib/rag-.md 2/dev/null | head -3\necho Cache status verified\n```\nThis command checks if the cache status is relevant to the issue.\n\n**Step 3: Update the RAG build strategy batch**\n\nUpdate the RAG build strategy batch to process embeddings in batches that fit within the available VRAM/WSL memory. You can do this by adding the following configuration to your `rag-build-strategy-batch` YAML file:\n```yml\nbatch_size: 1000\n```\nThis sets the batch", "metrics": { "length": 1035, "commands": 4, "command_list": [ "grep -i 'bm25\\|chunk\\|embed' lessons/contrib/rag-.md 2/dev/null | head -3", "echo Search verified", "grep -i 'cache' lessons/contrib/rag-.md 2/dev/null | head -3", "echo Cache status verified" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Knowledge Base Quality Flywheel Self Loop (rag-kb-quality-flywheel-self-loop)", "condition": "plain", "status": 200, "content": "I'm not able to provide a fix for the error you mentioned as it's not a standard programming error. The error message \"RAG Knowledge Base Quality Flywheel Self Loop\" appears to be a custom error message, possibly related to a specific application or system.\n\nHowever, I can suggest some steps to troubleshoot and potentially resolve the issue:\n\n1. Check the application documentation: Look for the official documentation of the application or system that is causing the error. This should provide information on how to resolve the issue.\n2. Check for updates: Make sure that the application or system is up-to-date, as updates often include bug fixes and patches that can resolve issues like this.\n3. Check for configuration issues: Ensure that the application or system is configured correctly. This may involve checking settings, options, or parameters that are related to the error.\n4. Check for dependencies: If the application or system relies on other components or libraries, ensure that these dependencies are installed and up-to-date.\n\nIf you can provide more context or information about the error, such as the application or system that is causing the error, I may be able to provide a more specific solution.", "metrics": { "length": 1220, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Build Strategy Batch (rag-build-strategy-batch)", "condition": "plain", "status": 200, "content": "It seems like you're experiencing an issue with the RAG Build Strategy Batch command. Unfortunately, without more information about the specific error message you're receiving, it's difficult to provide a precise solution.\n\nHowever, I can offer some general troubleshooting steps and potential fixes for common issues related to the RAG Build Strategy Batch command:\n\n1. **Check the command syntax**: Ensure that the command is spelled correctly and that all parameters are in the correct order.\n\n2. **Verify the input parameters**: Double-check that the input parameters are valid and correctly formatted.\n\n3. **Check the output**: Verify that the output is as expected.\n\nHere's a basic example of how to run the RAG Build Strategy Batch command using PowerShell:\n\n```powershell\nrag-build-strategy-batch -command \"your_command_here\" -parameters @{\"param1\"=\"value1\",\"param2\"=\"value2\"}\n```\n\nReplace `\"your_command_here\"` with the actual command you want to execute, and `\"value1\"` and `\"value2\"` with the actual values you want to pass as parameters.\n\nIf you're still experiencing issues, please provide more details about the error message you're receiving, and I'll do my best to help you troubleshoot the problem.", "metrics": { "length": 1215, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "RAG Knowledge Base Quality Flywheel Self Loop (rag-kb-quality-flywheel-self-loop)", "condition": "with_lesson", "status": 200, "content": "To implement the fix, we need to create a synonyms.json file and update the rag_core.py file. Here's a step-by-step guide:\n\n**Step 1: Create synonyms.json file**\n\nCreate a new file called `synonyms.json` in the root directory of your project. This file will contain 32 groups of vertical-domain synonyms.\n\nHere's an example of what the file might look like:\n```json\n{\n \"alarms\": [\"alarm1\", \"alarm2\", \"alarm3\"],\n \"servo\": [\"servo1\", \"servo2\", \"servo3\"],\n \"zero calibration\": [\"zero1\", \"zero2\", \"zero3\"],\n \"encoder\": [\"encoder1\", \"encoder2\", \"encoder3\"],\n // Add more groups as needed\n}\n```\n**Step 2: Update rag_core.py**\n\nUpdate the `rag_core.py` file to import the `synonyms.json` file and use it for synonym expansion.\n\nAdd the following lines at the top of the file:\n```python\nimport json\nimport os\nimport sys\nimport time\n\n# Load synonyms from JSON file\ndef _load_synonyms():\n synonyms_file = 'synonyms.json'\n if not os.path.exists(syn", "metrics": { "length": 958, "commands": 3, "command_list": [ "**Step 2: Update rag_core.py**", "Update the `rag_core.py` file to import the `synonyms.json` file and use it for synonym expansion.", "Add the following lines at the top of the file:" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "开源项目 README Optimization — 7 个常见Pitfalls与Fix Checklist (readme-seven-traps-fix-checklist)", "condition": "with_lesson", "status": 200, "content": "根据提供的信息,修复 MisakaNet README 的 7 个问题的解决方案如下:\n\n1. 信息架构反人类\n\n * 问题:README 顶部放的是 FOR AI AGENTS 提示框 → Demo → CLI参考 → 然后才出现 \"What is MisakaNet?\"。\n * 修复:将\"What is MisakaNet?\"置顶,紧接标题和 badges。一句话说清项目本质。Demo 和 CLI 放在后面。\n\n ```markdown\n# What is MisakaNet?\n\nA decentralized swarm-knowledge network for AI agents...\n\n# Try it out\n## Demo\n[Demo Link](Demo Link)\n## CLI\n[CLI Reference](CLI Reference)\n```\n\n2. \"Zero-Dep\" 宣称不精确\n\n * 问题:项目声称 zero-dep,但 --semantic 参数依赖 sentence-transformers(~2GB 模型)。被用户发现后可信度直接打折。\n * 修复:明确区分 Core 和 Advanced 依赖。在 README 中加入清晰的依赖说明:\n\n ```markdown\n# Dependencies — core vs advanced:\n## Core search is zero-dep — pure Python", "metrics": { "length": 669, "commands": 3, "command_list": [ "2. \"Zero-Dep\" 宣称不精确", "* 问题:项目声称 zero-dep,但 --semantic 参数依赖 sentence-transformers(~2GB 模型)。被用户发现后可信度直接打折。", "* 修复:明确区分 Core 和 Advanced 依赖。在 README 中加入清晰的依赖说明:" ], "has_command_block": true, "actionable": false, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "开源项目 README Optimization — 7 个常见Pitfalls与Fix Checklist (readme-seven-traps-fix-checklist)", "condition": "plain", "status": 200, "content": "The error you're referring to is likely related to the \"Optimization — 7 个常见Pitfalls与Fix Checklist\" section in the README file of an open-source project. The checklist lists common pitfalls and their fixes. Here's a concrete, actionable fix with exact commands for each point:\n\n**1. Use a consistent naming convention for files and directories**\n\n* Fix: Replace inconsistent naming conventions with a consistent one, such as using underscores instead of spaces or camelCase.\n\n ```bash\n# Before\nmy_file.txt\nMyFile.txt\nMY_FILE.TXT\n\n# After\nmy_file.txt\nmy_file.txt\nmy_file.txt\n```\n\n**2. Use a consistent formatting style for code blocks**\n\n* Fix: Use a consistent formatting style, such as using four spaces for indentation or the `prettier` tool.\n\n ```bash\n# Before\nif (true) {\n console.log('Hello World');\n}\n\n# After\nif (true) {\n console.log('Hello World');\n}\n```\n\n ```bash\n# Install prettier\nnpm install prettier --save-dev\n\n# Configure prettier\nnpx prettier --write src/\n\n# Format code with prettier\nnpx prettier --print-pre", "metrics": { "length": 1042, "commands": 12, "command_list": [ "my_file.txt", "MyFile.txt", "MY_FILE.TXT", "my_file.txt", "my_file.txt" ], "has_command_block": true, "actionable": true, "inline_code_count": 5, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "注册链路设计 — Worker 只创建 Issue,其余交给 Workflow (registration-chain-worker-fallback)", "condition": "plain", "status": 200, "content": "The error message you're seeing suggests that the worker is only creating issues, but it's not passing them to the workflow as expected. This can be a common issue in workflow management systems, especially when there are complex business logic involved.\n\nHere's a concrete, actionable fix with exact commands to resolve the issue:\n\n**Step 1: Check the workflow definition**\n\nEnsure that the workflow definition is correctly defined to accept issues from the worker. Check the workflow's `input` and `output` properties to ensure they match the expected input and output types.\n\n**Step 2: Update the worker code**\n\nUpdate the worker code to pass the created issues to the workflow. You can do this by adding a `postCreateIssue` method to the worker that sends the issue to the workflow.\n\n```javascript\n// registration-chain-worker-fallback.js\nconst { createWorker } = require('amqplib');\n\nasync function postCreateIssue(issue) {\n const connection = await createWorker('amqplib://localhost:5672', 'registration-chain-worker-fallback');\n const channel = await connection.createChannel();\n const queue = await channel.assertQueue('registration-chain-workflow', { durable: true });\n await channel.sendToQueue(queue.queue, Buffer.from(JSON.stringify({ type:", "metrics": { "length": 1256, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "注册链路设计 — Worker 只创建 Issue,其余交给 Workflow (registration-chain-worker-fallback)", "condition": "with_lesson", "status": 200, "content": "根据给出的解决方案,以下是具体的修复步骤:\n\n**1. Worker代码改动**\n\n在 Worker 代码中,移除对 `counter.json` 的读写操作:\n\n```bash\n// worker.js\nconst express = require('express');\nconst app = express();\n\napp.post('/register', async (req, res) => {\n const issue = await createIssue(req.body);\n const issueUrl = `https://github.com/${issue.user}/issues/${issue.number}`;\n res.json({ issueUrl, issueNumber: issue.number });\n});\n\nasync function createIssue(body) {\n const response = await fetch('https://api.github.com/issues', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,\n },\n body: JSON.stringify(body),\n });\n const issue = await response.json();\n return issue;\n}\n```\n\n**2. register.yml 文件改动**\n\n在 `register.yml` 文件中,添加 `trigger` 条件,覆盖 `join` 和 `register` 前缀:\n\n```yaml\ntrigger:\n - github.event.issue.title\n contains:\n - join\n - register\n", "metrics": { "length": 913, "commands": 20, "command_list": [ "// worker.js", "const express = require('express');", "const app = express();", "app.post('/register', async (req, res) => {", "const issue = await createIssue(req.body);" ], "has_command_block": true, "actionable": false, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Schemas coupled across repos break CI until the counterpart PR merges (schema-coupled-cross-repo-ci)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Identify the validator repository and its branch**\n\nRun the following command to identify the validator repository and its branch:\n```bash\ngit remote -v\n```\nThis will show you the remote repository URL and its branch. Look for the branch that contains the validator.\n\n**Step 2: Open the two PRs as a pair and note the coupling**\n\nOpen the two PRs (data repository and validator repository) and add a comment to both PRs indicating that they are schema-coupled and need to be merged together:\n```bash\ngit pull origin main\ngit config user.name \"Your Name\"\ngit config user.email \"your@email.com\"\n\n# In data repository PR\ngit add .git/COMMIT_EDITMSG\ngit commit -m \"Merge schema-coupled PR\"\ngit note -c \"schema-coupled: merge data PR with validator PR\"\n\n# In validator repository PR\ngit add .git/COMMIT_EDITMSG\ngit commit -m \"Merge schema-coupled PR\"\ngit note -c \"schema-coupled: merge data PR with validator PR\"\n```\n**Step 3: Merge the validator repository PR first, then rebase the data repository", "metrics": { "length": 1060, "commands": 10, "command_list": [ "git remote -v", "git pull origin main", "git config user.name \"Your Name\"", "git config user.email \"your@email.com\"", "git add .git/COMMIT_EDITMSG" ], "has_command_block": true, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Content Quality Scoring System — Automated Lesson Evaluation (session-lesson-1-content-quality-scoring)", "condition": "with_lesson", "status": 200, "content": "The main issue with your code is that you're trying to access the `title` and `created` fields of the JSON metadata, but you're not correctly parsing the JSON. Here's a fixed version of your code:\n\n```python\nimport json\nimport re\n\ndef score_lesson(filepath: str) -> dict:\n with open(filepath) as f:\n content = f.read()\n \n score = 0\n breakdown = {}\n \n # Metadata (20)\n meta_score = 0\n json_match = re.search(r'\\{[^}]\"title\":\\s*\"[^}]\\}', content)\n if json_match:\n try:\n meta = json.loads(json_match.group().replace('\"title\":', '').replace('\"', '').replace('}', ''))\n meta_score += 4\n if len(meta.get(\"tags\", [])) == 3: meta_score += 3\n if meta.get(\"source\"): meta_score += 2\n if re.match(r'\\d{4}-\\d{2}-\\d{2}', meta.get(\"created\", \"\")): meta_score += 2\n except: \n pass\n breakdown[\"metadata\"] = min(meta_score, 20)\n score +=", "metrics": { "length": 940, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Schemas coupled across repos break CI until the counterpart PR merges (schema-coupled-cross-repo-ci)", "condition": "plain", "status": 200, "content": "The error \"schema-coupled-cross-repo-ci\" typically occurs when there are schema changes in one repository that affect another repository, causing the CI build to fail until the counterpart PR is merged. Here's a concrete, actionable fix with exact commands:\n\n**Step 1: Update dependencies in both repositories**\n\nIn both repositories, run the following command to update their dependencies:\n```bash\ngit pull origin main\n```\nThis will fetch the latest changes from the remote repository.\n\n**Step 2: Run `npm install` or `yarn install`**\n\nIn both repositories, run the following command to install the updated dependencies:\n```bash\nnpm install\n# or\nyarn install\n```\n**Step 3: Run `npm run build` or `yarn build`**\n\nIn both repositories, run the following command to build the project:\n```bash\nnpm run build\n# or\nyarn build\n```\n**Step 4: Run `npm test` or `yarn test`**\n\nIn both repositories, run the following command to run the tests:\n```bash\nnpm test\n# or\nyarn test\n```\n**Step 5: Verify the CI build passes**\n\nAfter running the above commands, verify that the CI build", "metrics": { "length": 1068, "commands": 7, "command_list": [ "git pull origin main", "npm install", "yarn install", "npm run build", "yarn build" ], "has_command_block": true, "actionable": true, "inline_code_count": 13, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Content Quality Scoring System — Automated Lesson Evaluation (session-lesson-1-content-quality-scoring)", "condition": "plain", "status": 200, "content": "I don't see any error code or information about the specific error you're experiencing. However, I'll provide a general troubleshooting approach for a Content Quality Scoring System issue.\n\nAssuming the error is related to the Automated Lesson Evaluation (ALE) system, here are some steps to help you troubleshoot and fix the issue:\n\n**Step 1: Check the ALE System Status**\n\n1. Log in to the ALE system as an administrator or a designated user.\n2. Check the system status by looking for a \"Status\" or \"System Status\" section.\n3. If the system is down or experiencing issues, contact the system administrator or IT support for assistance.\n\n**Step 2: Verify the Lesson and Content**\n\n1. Review the lesson plan and content to ensure that it aligns with the ALE system's requirements.\n2. Check the content for any errors, inaccuracies, or missing information.\n3. If necessary, update the content to meet the ALE system's requirements.\n\n**Step 3: Check for Technical Issues**\n\n1. Ensure that your browser is up-to-date and compatible with the ALE system.\n2. Clear your browser cache and cookies to resolve any potential issues.\n3. Check your internet connection to ensure it's stable and working", "metrics": { "length": 1190, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "slugify path traversal deep coverage (slugify-path-traversal-deep-coverage)", "condition": "with_lesson", "status": 200, "content": "To fix the `slugify-path-traversal-deep-coverage` error, we need to add explicit test cases for the new task acceptance criteria. Here's a step-by-step guide to fixing the issue:\n\n**Step 1: Update the test suite**\n\nCreate a new test file `test_slugify_path_traversal.py` with the following content:\n```python\nimport pytest\nfrom slugify import slugify\n\n@pytest.mark.parametrize(\"input_str, expected\", [\n # ../ and ..\\ path traversal characters\n (\"../etc/passwd\", \"etc-passwd\"),\n (\"\\\\\\\\etc\\\\passwd\", \"etc-passwd\"),\n (\"..\\\\etc\\\\passwd\", \"etc-passwd\"),\n # Null bytes (\\x00) and control characters\n (\"\\x00\", \"\"),\n (\"\\x7F\", \"\"),\n # Trailing dots and spaces (Windows silently strips these, causing filename collisions)\n (\"foo .bar\", \"foo-bar\"),\n (\"foo .bar .baz\", \"foo-bar\"),\n # All 14 Windows reserved names (AUX, LPT1-LPT9, mixed case)\n (\"AUX\", \"aux\"),\n (\"LPT1\", \"lpt1\"),\n (\"LPT2\", \"l", "metrics": { "length": 921, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "slugify path traversal deep coverage (slugify-path-traversal-deep-coverage)", "condition": "plain", "status": 200, "content": "The error \"slugify path traversal deep coverage (slugify-path-traversal-deep-coverage)\" typically occurs when there's a potential path traversal vulnerability in the slugify function. This can happen when the function is not properly sanitized, allowing an attacker to inject arbitrary directory paths.\n\nHere's a concrete, actionable fix using the `slugify` library and `path` module:\n\n**Step 1: Install required packages**\n\nRun the following command in your terminal:\n\n```bash\nnpm install slugify path\n```\n\n**Step 2: Update your slugify function**\n\nHere's an updated version of the slugify function that uses the `path` module to sanitize the input:\n\n```javascript\nconst slugify = require('slugify');\nconst path = require('path');\n\nconst sanitizePath = (path) => {\n return path.normalize(path).replace(/\\/+/g, '/').replace(/\\/\\./g, '.');\n};\n\nconst slugifyPath = (path) => {\n return slugify(sanitizePath(path), {\n replacement: '-',\n remove: /[^a-zA-Z0-9-]/g,\n });\n};\n\nmodule.exports = slugifyPath;\n```\n\n**Step 3: Use the updated slugify function**\n\nIn your code", "metrics": { "length": 1070, "commands": 1, "command_list": [ "npm install slugify path" ], "has_command_block": true, "actionable": true, "inline_code_count": 6, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "slugify windows path sanitation (slugify-windows-path-sanitation)", "condition": "plain", "status": 200, "content": "The error \"slugify-windows-path-sanitation\" typically occurs when you're trying to slugify a Windows path that contains special characters, such as backslashes (\\) or colons (:). To fix this issue, you can use the `slugify` function from the `slugify` library, which includes a custom sanitizer for Windows paths.\n\nHere's an example of how to fix the error:\n\n**Install required libraries:**\n```bash\nnpm install slugify\n```\n\n**Use the `slugify` function with the `sanitize` option set to `true` for Windows paths:**\n```javascript\nconst slugify = require('slugify');\n\nconst windowsPath = 'C:\\\\Users\\\\username\\\\Documents\\\\example.txt';\nconst sanitizedSlug = slugify(windowsPath, { sanitize: true });\n\nconsole.log(sanitizedSlug); // Output: \"c-users-username-documents-example.txt\"\n```\n\nAlternatively, you can use the `path` module to normalize the Windows path before slugifying it:\n```javascript\nconst path = require('path');\nconst slugify = require('slugify');\n\nconst windowsPath = 'C:\\\\Users\\\\username\\\\Documents\\\\example.txt';\nconst normalizedPath = path.normalize(windowsPath);\nconst sanitizedSlug = slug", "metrics": { "length": 1106, "commands": 2, "command_list": [ "npm install slugify", "Alternatively, you can use the `path` module to normalize the Windows path before slugifying it:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Squash-rebase rewrites the patch base and breaks force-push expectations (squash-rebase-force-push-lease)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you'll need to squash the rebase, verify the diff, and then force-push with a specific option to avoid rewriting the base commit. Here are the steps:\n\n1. **Capture the current remote head**:\n\n ```bash\ngit rev-parse origin/\n```\n\n This will give you the SHA of the current remote branch.\n\n2. **Squash the rebase**:\n\n ```bash\ngit rebase -i HEAD~n\n```\n\n Replace `n` with the number of commits you want to squash. For example, if you want to squash the last 3 commits, use `git rebase -i HEAD~3`.\n\n In the interactive rebase menu, change `pick` to `s` for each commit you want to squash, and then save and close the file.\n\n3. **Verify the diff**:\n\n ```bash\ngit diff origin/main..HEAD\n```\n\n This will show you the intended net change. If the output is not as expected, you may need to make adjustments to the squash rebase.\n\n4. **Force-push with --force-with-lease**:\n\n ```bash\ngit push origin --force-with", "metrics": { "length": 968, "commands": 3, "command_list": [ "git rev-parse origin/", "git rebase -i HEAD~n", "git diff origin/main..HEAD" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "slugify windows path sanitation (slugify-windows-path-sanitation)", "condition": "with_lesson", "status": 200, "content": "To fix the slugify logic in `scripts/new_lesson.py`, you can use the following code:\n\n```python\nimport unicodedata\nimport re\n\ndef slugify_windows_path_sanitation(title):\n \"\"\"\n Sanitizes a Windows path title for slugification.\n \"\"\"\n # Normalize Unicode characters\n normalized_title = unicodedata.normalize('NFKD', title)\n \n # Replace slashes with hyphens\n title = normalized_title.replace('/', '-').replace('\\\\', '-')\n \n # Normalize Windows reserved names\n reserved_names = ['CON', 'PRN', 'AUX', 'NUL']\n for name in reserved_names:\n title = title.replace(name, '')\n \n # Remove leading and trailing whitespace\n title = title.strip()\n \n # Remove non-alphanumeric characters (except hyphens)\n title = re.sub(r'[^a-zA-Z0-9-]', '', title)\n \n # Collapse multiple hyphens\n title = re.sub(r'-+', '-', title)\n \n # Remove leading and trailing hyphens\n title = title.strip('-')\n \n # Remove empty strings\n if not title:\n title = 'default-slug'\n \n return title\n\n# Example", "metrics": { "length": 1058, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Squash-rebase rewrites the patch base and breaks force-push expectations (squash-rebase-force-push-lease)", "condition": "plain", "status": 200, "content": "The error you're encountering is due to the fact that Squash-rebase rewrites the patch base, which can break force-push expectations. To fix this issue, you can use the following steps:\n\n**Step 1: Force-push without squashing the rebase**\n\n```bash\ngit push origin --force-with-lease\n```\n\nThis command will force-push your changes to the remote repository without squashing the rebase. This should resolve the issue without rewriting the patch base.\n\n**Step 2: Force-push with squashing the rebase**\n\nIf you want to squash the rebase before force-pushing, you can use the following command:\n\n```bash\ngit rebase -i \n```\n\nThen, squash the rebase by editing the `rebase-apply` line to `pick`. After squashing the rebase, you can force-push:\n\n```bash\ngit push origin --force-with-lease\n```\n\n**Note:** Be cautious when squashing the rebase, as this can rewrite the patch base and break force-push expectations.\n\n**Alternative Solution:**\n\nIf you're using Git version 2.27 or later, you can use the `--squash` option with `git push", "metrics": { "length": 1065, "commands": 3, "command_list": [ "git push origin --force-with-lease", "git rebase -i ", "git push origin --force-with-lease" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "static page github api 403 rate limit (static-page-github-api-403-rate-limit)", "condition": "with_lesson", "status": 200, "content": "为了解决静态页面GitHub API 403率限问题,我们需要在您的GitHub Pages项目中添加一个后端代理来缓解率限问题。\n\n步骤1:创建一个Node.js服务\n\n首先,我们需要创建一个Node.js服务来代理GitHub API。我们将使用`express`框架来创建服务。\n\n```bash\nnpm init -y\nnpm install express\n```\n\n创建一个新文件(例如`server.js`)并添加以下代码:\n\n```javascript\nconst express = require('express');\nconst app = express();\n\nconst githubApiUrl = 'https://api.github.com';\nconst proxyUrl = 'https://cors-anywhere.herokuapp.com/'; // 为了解决 CORS 问题,我们使用一个 CORS 代理\n\napp.use(express.json());\n\nconst fetchWithTimeout = async (url, timeoutMs = 8000) => {\n const ctrl = new AbortController();\n const timer = setTimeout(() => ctrl.abort(), timeoutMs);\n try {\n const r = await fetch(url, { signal: ctrl.signal });\n clearTimeout(timer);\n if (!r.ok) throw new Error(r.status);\n return r.json();\n } catch (e) {\n clearTimeout(timer);\n throw e;\n }\n};\n\nconst apiCall", "metrics": { "length": 842, "commands": 2, "command_list": [ "npm init -y", "npm install express" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "static page github api 403 rate limit (static-page-github-api-403-rate-limit)", "condition": "plain", "status": 200, "content": "The 403 rate limit error on the GitHub API is usually caused by exceeding the daily rate limit for your GitHub account. Here's a step-by-step guide to help you resolve this issue:\n\n**Step 1: Check your rate limit**\n\n Run the following command to check your rate limit:\n```bash\ncurl -X GET https://api.github.com/rate_limit\n```\nThis will display your current rate limit, which is divided into three categories:\n\n* `remaining`: The number of requests you can make before hitting the limit.\n* `limit`: The total number of requests you can make within the 60-minute window.\n* `reset`: The time when the limit will reset.\n\n**Step 2: Reduce your requests**\n\nTo avoid hitting the rate limit, you can reduce the number of requests you make to the GitHub API. Here are a few ways to do this:\n\n* **Batch your requests**: Instead of making multiple requests in quick succession, batch them together to spread out the requests over time.\n* **Use pagination**: If you're making requests to a large dataset, use pagination to limit the number of requests you make at once.\n* **Cache your requests**: If you're making the same requests repeatedly, consider caching the results", "metrics": { "length": 1173, "commands": 1, "command_list": [ "curl -X GET https://api.github.com/rate_limit" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "static page width consistency (static-page-width-consistency)", "condition": "with_lesson", "status": 200, "content": "To fix the static page width consistency error, we'll make the following changes:\n\n1. Remove the `max-width` property from the search bar, content cards, and form elements, and set them to inherit the container's width.\n2. Remove the `max-width` property from the content cards and form elements, as they should automatically take up the full width of the container.\n3. Update the container's width to 100% to ensure all content areas are aligned.\n\nHere are the exact commands to make these changes:\n\n**Step 1: Update the search bar**\n\n```bash\necho \"Updating search bar styles\" >> lessons/static-page-width-consistency.md\n\n# Update the search bar styles in your CSS file\n.search-bar {\n padding: 0 20px; /* keep the existing padding */\n width: 100%; /* inherit the container's width */\n}\n```\n\n**Step 2: Update the content cards**\n\n```bash\necho \"Updating content card styles\" >> lessons/static-page-width-consistency.md\n\n# Update the content card styles in your CSS file\n.content-card {\n width: 100%; /* automatically take up the full width of the container */\n max-width: none; /* remove the max-width property */\n min-width", "metrics": { "length": 1128, "commands": 5, "command_list": [ "echo \"Updating search bar styles\" >> lessons/static-page-width-consistency.md", ".search-bar {", "padding: 0 20px; /* keep the existing padding */", "width: 100%; /* inherit the container's width */", "}" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "static page width consistency (static-page-width-consistency)", "condition": "plain", "status": 200, "content": "The \"static-page-width-consistency\" error typically occurs when the width of a static page (usually a layout or template) is not consistent across different devices or screen sizes.\n\nTo fix this issue, you can use a CSS media query to define different widths for your static page based on the device's screen size. Here's an example of how you can fix this issue using CSS:\n\n**Method 1: Using a CSS Reset**\n\nYou can use a CSS reset file (e.g., Normalize.css or Reset.css) to reset the default box-sizing property and set the width of your static page. If you're using a CSS framework like Bootstrap, you can use their built-in CSS classes to achieve this.\n\nFor example, if you're using Bootstrap 5, you can add the following code to your HTML:\n```html\n\n
\n \n
\n```\nThis will set the width of the container to 80% of the parent element's width, with a margin of 4 units on both sides.\n\n**Method 2: Using a CSS Media Query**\n\n", "metrics": { "length": 1104, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Supabase capacity constraints caused project operation failures (supabase-capacity-constraints-project-operations)", "condition": "with_lesson", "status": 200, "content": "To resolve the \"Supabase capacity constraints\" issue, follow these steps:\n\n**Step 1: Check your current capacity settings**\n\nRun the following command to check your current capacity settings:\n```bash\nsupabase project info --project-id \n```\nReplace `` with your actual project ID.\n\nLook for the \"Capacity\" section in the output. If your project is running low on capacity, you'll see a message indicating the available capacity.\n\n**Step 2: Increase your project's capacity**\n\nTo increase your project's capacity, run the following command:\n```bash\nsupabase project update --project-id --capacity \n```\nReplace `` with your actual project ID and `` with the desired new capacity (e.g., 1000).\n\nFor example:\n```bash\nsupabase project update --project-id my-project --capacity 1000\n```\n**Step 3: Wait for the changes to take effect**\n\nAfter updating your project's capacity, wait for the changes to take effect. This may take a few minutes.\n\n**Step 4: Verify that the issue is resolved**\n\nTry to create a new project, resize an existing project, or perform other operations that were previously", "metrics": { "length": 1165, "commands": 3, "command_list": [ "supabase project info --project-id ", "supabase project update --project-id --capacity ", "supabase project update --project-id my-project --capacity 1000" ], "has_command_block": true, "actionable": true, "inline_code_count": 8, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Supabase capacity constraints caused project operation failures (supabase-capacity-constraints-project-operations)", "condition": "plain", "status": 200, "content": "The \"Supabase capacity constraints caused project operation failures\" error typically occurs when you exceed the capacity limits set for your Supabase project. Here's a step-by-step guide to help you resolve this issue:\n\n**Step 1: Check your current usage**\n\nRun the following command in your terminal to check your current usage:\n```bash\nsupabase db info --format json\n```\nThis will display your current usage statistics, including the number of queries, rows, and storage used.\n\n**Step 2: Identify the resource that's exceeding the limit**\n\nBased on the output of the previous command, identify the resource (e.g., queries, rows, or storage) that's exceeding the limit.\n\n**Step 3: Reduce your usage**\n\nTo reduce your usage, you can try the following:\n\n* Optimize your queries: Review your SQL queries and optimize them to reduce the number of rows being retrieved or updated.\n* Limit the number of rows: If you're retrieving a large number of rows, consider limiting the number of rows returned using pagination or filtering.\n* Reduce storage usage: If you're storing large amounts of data, consider reducing the size of your data or using a more efficient storage solution.\n\n**Step 4: Update your configuration (if necessary)**\n\nIf", "metrics": { "length": 1234, "commands": 1, "command_list": [ "supabase db info --format json" ], "has_command_block": true, "actionable": true, "inline_code_count": 1, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Swarm PR Battle Playbook — Shipping env-var error hooks through AI-reviewed (swarm-pr-battle-playbook)", "condition": "with_lesson", "status": 200, "content": "The error message indicates that there's an issue with shipping error handler environment variables (env-vars) through AI-reviewed upstreams. To fix this, you'll need to make some changes to your CI/CD pipeline and ensure that the error handler is properly configured and reviewed.\n\nHere's a step-by-step guide to help you fix the issue:\n\n**Step 1: Enable GitHub Actions in Forked Repos**\n\nIf your forked repository has GitHub Actions disabled by default, you'll need to enable them manually via the web UI.\n\n1. Go to your forked repository on GitHub.\n2. Click on the \"Settings\" icon (gear icon) in the top-right corner.\n3. Scroll down to the \"Actions\" section.\n4. Click on \"Edit\" next to \"GitHub Actions\".\n5. Toggle the switch to enable GitHub Actions.\n\n**Step 2: Update the `error-handler` Env Var**\n\nUpdate the `error-handler` environment variable to include the necessary information for the AI review process.\n\n1. Create a new file named `.github/workflows/error-handler.yml` in the root of your repository with the following content:\n```yaml\nname: Error Handler\n\non:\n push:\n branches:\n - main\n\njobs:\n error-handler:\n runs", "metrics": { "length": 1140, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 3, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Swarm PR Battle Playbook — Shipping env-var error hooks through AI-reviewed (swarm-pr-battle-playbook)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing environment variable in your Docker container or Kubernetes pod. To fix this issue, you'll need to create or update an environment variable in your `docker-compose.yml` or Kubernetes configuration file.\n\nHere's a step-by-step guide to help you resolve the issue:\n\n**For Docker Compose (docker-compose.yml):**\n\n1. Open your `docker-compose.yml` file in a text editor.\n2. Locate the `environment` section, which should contain the environment variables for your application.\n3. Add or update the environment variable that's missing. For example, if the error message mentions `shipping`, you might need to add the following line:\n\n```yml\nenvironment:\n - SHIPPING=true\n```\n\nReplace `true` with the actual value you want to set for the `shipping` environment variable.\n\n4. Save the changes to your `docker-compose.yml` file.\n\n**For Kubernetes (deployment.yaml or pod.yaml):**\n\n1. Open your Kubernetes configuration file in a text editor.\n2. Locate the `spec.containers[0].env` section, which should contain the environment variables for your application.\n3. Add or update the environment variable that's missing. For example, if the error message mentions `shipping", "metrics": { "length": 1219, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Testimonio: MisakaNet me ayudo a resolver ModuleNotFoundError (testimonio-misakanet)", "condition": "with_lesson", "status": 200, "content": "To fix the `ModuleNotFoundError` caused by missing `cv2` module, follow these steps:\n\n**Step 1: Install OpenCV using pip**\n\nOpen a terminal or command prompt and run the following command:\n\n```bash\npip install opencv-python\n```\n\n**Step 2: Verify the installation**\n\nAfter installation, you can verify that OpenCV is installed correctly by running the following command:\n\n```bash\npython -c \"import cv2; print(cv2.__version__)\"\n```\n\nThis command will print the version of OpenCV installed on your system.\n\n**Step 3: Update the test case on MisakaNet**\n\nTo update the test case on MisakaNet, you can follow these steps:\n\n1. Open the test case file `testimonio-misakanet.md` in a text editor.\n2. Replace the existing search query with the updated query:\n\n```bash\npython search_knowledge.py 'ModuleNotFoundError: No module named '\n```\n\nwith:\n\n```bash\npython search_knowledge.py 'ModuleNotFoundError: No module named cv2'\n```\n\n3. Save the changes to the file.\n\n**Step 4: Verify the test case on MisakaNet**\n\nAfter updating the test case, you can verify that it's working correctly", "metrics": { "length": 1074, "commands": 4, "command_list": [ "pip install opencv-python", "python -c \"import cv2; print(cv2.__version__)\"", "python search_knowledge.py 'ModuleNotFoundError: No module named '", "python search_knowledge.py 'ModuleNotFoundError: No module named cv2'" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Testimonio: MisakaNet me ayudo a resolver ModuleNotFoundError (testimonio-misakanet)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to a missing or incompatible package. Here's a step-by-step guide to resolve the `ModuleNotFoundError`:\n\n**Step 1: Update pip**\n\nBefore installing any packages, ensure that `pip` is up-to-date. Run the following command in your terminal:\n\n```bash\npython -m pip install --upgrade pip\n```\n\n**Step 2: Install the required package**\n\nThe error mentions `MisakaNet`, which is a Python library. You'll need to install it using pip. Run the following command:\n\n```bash\npip install MisakaNet\n```\n\nIf the package is not available on PyPI (Python Package Index), you may need to install it from another source. You can try installing it from GitHub or the original repository.\n\n**Step 3: Verify the installation**\n\nAfter installing the package, verify that it's working correctly by running a simple script:\n\n```python\nfrom misakanet import MisakaNet\n\nmisaka = MisakaNet()\nprint(misaka)\n```\n\nIf you encounter any issues during this step, you may need to reinstall the package or check the documentation for any specific requirements.\n\n**Step 4: Update your project**\n\nIf you're working on a project that uses `", "metrics": { "length": 1144, "commands": 2, "command_list": [ "python -m pip install --upgrade pip", "pip install MisakaNet" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "React Native uygulamasında Orbot (Tor) ile gizlilik akışı (tor-orbot-privacy-in-react-native-tr)", "condition": "with_lesson", "status": 200, "content": "Here's a concrete, actionable fix with exact commands to implement Tor usage in a React Native application:\n\n**Step 1: Install required dependencies**\n\nRun the following command in your terminal:\n```bash\nnpm install @react-native-async-storage/async-storage\n```\n**Step 2: Create a new file for Orbot control**\n\nCreate a new file named `OrbotController.js` in your project's root directory:\n```bash\nmkdir src\ntouch src/OrbotController.js\n```\nAdd the following code to `OrbotController.js`:\n```javascript\nimport { Linking, Platform } from 'react-native';\n\nconst ORBOT_URI = 'orbot://';\n\nasync function isOrbotInstalled() {\n if (Platform.OS !== 'android') return false;\n try { return await Linking.canOpenURL(ORBOT_URI); } catch { return false; }\n}\n\nexport { isOrbotInstalled };\n```\n**Step 3: Create a new file for user preference storage**\n\nCreate a new file named `PrivacyPreferences.js` in your project's root directory:\n```bash\nmkdir src\ntouch src/PrivacyPreferences.js\n```\nAdd the following code to `PrivacyPreferences.js`:\n```javascript\nimport AsyncStorage from '@react", "metrics": { "length": 1074, "commands": 6, "command_list": [ "npm install @react-native-async-storage/async-storage", "mkdir src", "touch src/OrbotController.js", "**Step 3: Create a new file for user preference storage**", "Create a new file named `PrivacyPreferences.js` in your project's root directory:" ], "has_command_block": true, "actionable": true, "inline_code_count": 10, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "React Native uygulamasında Orbot (Tor) ile gizlilik akışı (tor-orbot-privacy-in-react-native-tr)", "condition": "plain", "status": 200, "content": "To fix the error \"tor-orbot-privacy-in-react-native-tr\" in a React Native application, you need to install the `react-native-tor` package and configure it properly.\n\nHere's a step-by-step guide to fix the issue:\n\n**Step 1: Install the required packages**\n\nOpen your terminal and navigate to your React Native project directory. Run the following command to install the required packages:\n\n```bash\nnpm install react-native-tor\nnpm install react-native-tor-bridge\n```\n\n**Step 2: Link the packages**\n\nAfter installation, link the packages using the following command:\n\n```bash\nnpx react-native link react-native-tor\nnpx react-native link react-native-tor-bridge\n```\n\n**Step 3: Configure Orbot**\n\nOrbot requires a configuration file to function properly. Create a new file named `orbot.json` in the root of your project with the following content:\n\n```json\n{\n \"orbot\": {\n \"port\": 443,\n \"address\": \"127.0.0.1\"\n }\n}\n```\n\nThis configuration sets the Orbot port to 443 and the address to localhost.\n\n**Step 4: Import the Tor module**\n\nIn your React Native component", "metrics": { "length": 1065, "commands": 4, "command_list": [ "npm install react-native-tor", "npm install react-native-tor-bridge", "npx react-native link react-native-tor", "npx react-native link react-native-tor-bridge" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "tts chinese encoding powershell (tts-chinese-encoding-powershell)", "condition": "with_lesson", "status": 200, "content": "To fix the issue, you need to ensure that the text is read from a UTF-8 encoded file, and then pass it to the mmx CLI. Here's a concrete, actionable fix with exact commands:\n\n```powershell\n# Create a new .txt file with the Chinese text\n\"早安愚者\" | Out-File -FilePath \"input.txt\" -Encoding UTF8\n\n# Read the text from the UTF-8 encoded file\n$text = [System.IO.File]::ReadAllText(\"input.txt\", [System.Text.Encoding]::UTF8)\n\n# Pass the text to the mmx CLI\nnode mmx.mjs speech synthesize --text \"$text\" --voice Japanese_CalmLady --out \"out.mp3\"\n\n# Verify that the command completed successfully\nif (Get-Command mmx.mjs -ErrorAction SilentlyContinue) {\n $result = & \"mmx.mjs\" speech synthesize --text \"$text\" --voice Japanese_CalmLady --out \"out.mp3\"\n if ($result.ExitCode -eq 0) {\n Write-Host \"Verification passed: fix command exited 0\"\n } else {\n Write-Host \"Verification failed: fix command exited $result.ExitCode\"\n", "metrics": { "length": 933, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "tts chinese encoding powershell (tts-chinese-encoding-powershell)", "condition": "plain", "status": 200, "content": "The error you're encountering is likely due to the fact that the `tts-chinese-encoding-powershell` module doesn't support Chinese text encoding by default. Here's a step-by-step solution to resolve the issue:\n\n**Step 1: Install the required module**\n\nYou need to install the `tts-chinese-encoding-powershell` module from the PowerShell Gallery. Run the following command:\n\n```powershell\nInstall-Module -Name tts-chinese-encoding-powershell\n```\n\n**Step 2: Import the module**\n\nAfter installing the module, import it into your PowerShell session:\n\n```powershell\nImport-Module tts-chinese-encoding-powershell\n```\n\n**Step 3: Set the encoding**\n\nTo set the Chinese encoding, use the `Set-TTSChineseEncoding` function:\n\n```powershell\nSet-TTSChineseEncoding -Encoding GBK\n```\n\nAlternatively, you can set the encoding using the `tts-chinese-encoding` parameter when creating a text-to-speech object:\n\n```powershell\n$voice = New-TTSChineseVoice -Language \"zh-CN\"\n$voice | Set-TTSChineseEncoding -Encoding GBK\n```\n\n**Example Use Case:**\n\nHere's an example of how", "metrics": { "length": 1052, "commands": 5, "command_list": [ "**Step 2: Import the module**", "After installing the module, import it into your PowerShell session:", "**Step 3: Set the encoding**", "To set the Chinese encoding, use the `Set-TTSChineseEncoding` function:", "Alternatively, you can set the encoding using the `tts-chinese-encoding` parameter when creating a text-to-speech object:" ], "has_command_block": true, "actionable": true, "inline_code_count": 11, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Vertical KB Question Bank Strategy — FANUC Robot KB Case Study (vertical-kb-question-bank-strategy)", "condition": "with_lesson", "status": 200, "content": "The error you're encountering is likely due to the fact that the `word/comments.xml` file is not being properly parsed by the `ET.parse()` function. This could be caused by the XML file not being in the correct format or by there being issues with the `zipfile` and `ET` libraries.\n\nHere's a concrete, actionable fix with exact commands:\n\n1. **Check the XML file format:**\n\n * Make sure the `word/comments.xml` file is in the correct format. You can use an XML editor like Notepad++ or Visual Studio Code to inspect the file.\n2. **Update the `zipfile` library:**\n\n * If you're using Python 3.x, make sure you have the latest version of the `zipfile` library installed. You can update it using pip:\n\n ```bash\npip install --upgrade zipfile\n```\n3. **Update the `ET` library:**\n\n * If you're using Python 3.x, make sure you have the latest version of the `ET` library installed. You can update it using pip:\n\n ```bash\npip install --upgrade xml.etree.ElementTree\n```\n4. **Modify the Python script:**\n\n *", "metrics": { "length": 1034, "commands": 2, "command_list": [ "pip install --upgrade zipfile", "pip install --upgrade xml.etree.ElementTree" ], "has_command_block": true, "actionable": true, "inline_code_count": 12, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Two Evidence Loops for Failure Lessons (two-evidence-loops-for-failure-lessons)", "condition": "with_lesson", "status": 200, "content": "To fix the Two Evidence Loops for Failure Lessons issue, you can follow these steps:\n\n**Step 1: Add source evidence when a lesson is ingested**\n\nUpdate your YAML configuration to include source evidence when a lesson is ingested. This will ensure that you track both public and private evidence.\n\n```yaml\nevidence:\n level: \"pre_ingest_reused\"\n source_type: \"maintainer_reuse\"\n verified_by: \"maintainer\"\n public_quote_allowed: false\n```\n\n**Step 2: Keep public usefulness metrics separate**\n\nCreate a new YAML configuration to keep public usefulness metrics separate from source evidence.\n\n```yaml\npublic_usefulness:\n level: \"post_public_feedback\"\n source_type: \"public\"\n verified_by: \"public\"\n public_quote_allowed: true\n```\n\n**Step 3: Update your lesson ingestion process**\n\nUpdate your lesson ingestion process to track both source evidence and public usefulness metrics separately.\n\n```bash\n# Ingest a new lesson\n# ...\n\n# Add source evidence\necho \"maintainer_reuse\" > evidence.json\n\n# Add public usefulness metrics\necho \"public\" > public_usefulness.json\necho \"helpful_vote\" > public_usefulness.json\n# ...\n\n# Verify the lesson", "metrics": { "length": 1135, "commands": 4, "command_list": [ "**Step 2: Keep public usefulness metrics separate**", "Create a new YAML configuration to keep public usefulness metrics separate from source evidence.", "**Step 3: Update your lesson ingestion process**", "Update your lesson ingestion process to track both source evidence and public usefulness metrics separately." ], "has_command_block": true, "actionable": false, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Two Evidence Loops for Failure Lessons (two-evidence-loops-for-failure-lessons)", "condition": "plain", "status": 200, "content": "To fix the \"Two Evidence Loops for Failure Lessons\" error, we'll need to identify and correct the duplicate evidence loops in your code. Here's a step-by-step guide with exact commands to help you resolve the issue.\n\nAssuming you're using Python, here's an example code snippet with duplicate evidence loops:\n\n```python\n# Evidence Loop 1\ndef evidence_loop_1():\n # Code for evidence loop 1\n pass\n\n# Evidence Loop 2\ndef evidence_loop_2():\n # Code for evidence loop 2 (Duplicate of evidence loop 1)\n pass\n\n# Failure Lesson\ndef failure_lesson():\n evidence_loop_1()\n evidence_loop_2()\n```\n\nTo fix the error, you can remove the duplicate evidence loop and use the original one:\n\n```python\n# Evidence Loop 1\ndef evidence_loop_1():\n # Code for evidence loop 1\n pass\n\n# Failure Lesson\ndef failure_lesson():\n evidence_loop_1()\n```\n\nAlternatively, if you need to use both evidence loops in the failure lesson, you can refactor the code to avoid duplication:\n\n```python\n# Evidence Loop 1\ndef evidence_loop_1():\n # Code for evidence loop 1\n ", "metrics": { "length": 1060, "commands": 2, "command_list": [ "To fix the error, you can remove the duplicate evidence loop and use the original one:", "Alternatively, if you need to use both evidence loops in the failure lesson, you can refactor the code to avoid duplication:" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "Vertical KB Question Bank Strategy — FANUC Robot KB Case Study (vertical-kb-question-bank-strategy)", "condition": "plain", "status": 200, "content": "I don't see any code or error message provided. However, I can provide a general solution for a common error that might be related to this topic.\n\nThe error \"Vertical KB Question Bank Strategy\" is likely a message from a FANUC robot, indicating that there is an issue with the vertical keyboarding strategy.\n\nHere's a potential fix:\n\n**Check the robot's configuration and settings**\n\n1. Open the FANUC robot's configuration software (e.g., FANUC PC-based system).\n2. Go to the \"System Settings\" or \"Configuration\" section.\n3. Check if the \"Vertical KB Question Bank Strategy\" is enabled or disabled.\n4. If it's disabled, enable it and save the changes.\n\n**Check the robot's keyboard settings**\n\n1. Go to the \"Keyboard Settings\" or \"Input Device Settings\" section.\n2. Ensure that the keyboard settings are correct and configured for vertical keyboarding.\n3. Check if the keyboard's \"Vertical KB\" or \"Vertical Mode\" is enabled.\n\n**Check the robot's program and code**\n\n1. Check the robot's program or code for any errors or inconsistencies related to the vertical keyboarding strategy.\n2. Ensure that the program is using the correct keyboard settings and configuration.\n\nIf none of", "metrics": { "length": 1180, "commands": 0, "command_list": [], "has_command_block": false, "actionable": false, "inline_code_count": 0, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL NTFS SQLite UPDATE 100x slower than ext4 (wsl-ntfs-sqlite-update-100x-slower)", "condition": "plain", "status": 200, "content": "The issue you're experiencing is due to the NTFS file system being slower than ext4 for SQLite updates. Here's a step-by-step guide to fix this issue:\n\n**Step 1: Enable NTFS File System Support**\n\nYou need to enable NTFS file system support in WSL. Run the following command:\n\n```bash\nwsl --set-filesystem ntfs\n```\n\n**Step 2: Update SQLite**\n\nUpdate SQLite to the latest version:\n\n```bash\nsudo apt update\nsudo apt install sqlite3\n```\n\n**Step 3: Create a new SQLite database**\n\nCreate a new SQLite database file in a directory you have write access to:\n\n```bash\nsqlite3 example.db\n```\n\n**Step 4: Create a table and insert data**\n\nCreate a table and insert some data:\n\n```sql\nCREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT);\nINSERT INTO test (value) VALUES ('Hello, World!');\n```\n\n**Step 5: Run the benchmark test**\n\nRun the benchmark test to verify that the update is working correctly:\n\n```bash\nsqlite3 example.db \"UPDATE test SET value = 'Hello, Universe!' WHERE id = 1\"\n```\n\nIf the update is working correctly, you should see the value of the", "metrics": { "length": 1051, "commands": 6, "command_list": [ "wsl --set-filesystem ntfs", "sudo apt update", "sudo apt install sqlite3", "sqlite3 example.db", "**Step 5: Run the benchmark test**" ], "has_command_block": true, "actionable": true, "inline_code_count": 9, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "WSL NTFS SQLite UPDATE 100x slower than ext4 (wsl-ntfs-sqlite-update-100x-slower)", "condition": "with_lesson", "status": 200, "content": "To fix the issue of WSL NTFS SQLite UPDATE being 100x slower than ext4, you can follow these steps:\n\n**Step 1: Copy the database to a Linux-native filesystem (ext4)**\n\n```bash\n# Copy the database to /tmp\ncp /mnt/d/project/data.db /tmp/data.db\n```\n\n**Step 2: Run UPDATE on the local copy (using ext4)**\n\n```bash\n# Run the UPDATE command using ext4\npython3 -c \"\nimport sqlite3\nconn = sqlite3.connect('/tmp/data.db')\nconn.execute('UPDATE table SET col = ... WHERE ...')\nconn.commit()\nconn.close()\n\"\n```\n\n**Step 3: Copy back to NTFS**\n\n```bash\n# Copy the updated database back to /mnt/d\ncp /tmp/data.db /mnt/d/project/data.db\n```\n\n**Verification**\n\n```bash\n# Verify that the database has been updated successfully\ncp /mnt/d/project/data.db /tmp/data.db\necho \"Verification passed: fix command executed\"\n```\n\nBy following these steps, you can ensure that your SQLite UPDATE operations are performed on a Linux-native filesystem (ext4), which should significantly improve performance compared to using WSL NTFS.", "metrics": { "length": 1004, "commands": 11, "command_list": [ "cp /mnt/d/project/data.db /tmp/data.db", "python3 -c \"", "import sqlite3", "conn = sqlite3.connect('/tmp/data.db')", "conn.execute('UPDATE table SET col = ... WHERE ...')" ], "has_command_block": true, "actionable": true, "inline_code_count": 7, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "IM 机器人反馈收集与 JSONL 队列审核模式 (wxauto-im-feedback-collection-jsonl-queue)", "condition": "plain", "status": 200, "content": "To fix the error, we need to identify the specific issue. However, without more context or information about the error message, I'll provide a general solution for a common issue related to JSONL files in Apache Airflow.\n\nAssuming the error is related to parsing a JSONL file, you can try the following steps:\n\n1. **Check the JSONL file format**: Ensure that the JSONL file is correctly formatted, with each line containing a JSON object separated by a newline character (`\\n`).\n\n2. **Verify the file path**: Double-check that the file path is correct and the file exists in the specified location.\n\n3. **Check the Airflow connection**: Ensure that the Airflow connection to the JSONL file is correct. You can check this by looking at the Airflow UI or by running the following command in your terminal:\n```bash\nairflow db upgrade\nairflow connections list\n```\n4. **Update the Airflow DAG**: If the issue persists, try updating the Airflow DAG that is using the JSONL file. You can do this by running the following command:\n```bash\nairflow db upgrade\nairflow dags update\n```\n5. **Try parsing the JSONL file manually**: If the issue is still", "metrics": { "length": 1139, "commands": 4, "command_list": [ "airflow db upgrade", "airflow connections list", "airflow db upgrade", "airflow dags update" ], "has_command_block": true, "actionable": true, "inline_code_count": 4, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null }, { "model": "@cf/meta/llama-3.2-3b-instruct", "scenario": "IM 机器人反馈收集与 JSONL 队列审核模式 (wxauto-im-feedback-collection-jsonl-queue)", "condition": "with_lesson", "status": 200, "content": "To fix the error, we need to make the following changes:\n\n1. **Modify the feedback key words**: Currently, the code checks for positive and negative feedback keywords separately. However, it does not exclude normal query words that might trigger the negative feedback. For example, the word \"错了\" (which means \"wrong\" in Chinese) might be used in a normal query like \"哪里错了\" (meaning \"where is the problem?\"). To fix this, we need to modify the feedback key words to exclude normal query words.\n\n2. **Implement session-level context tracking**: The code does not track the conversation context between user queries. To fix this, we need to maintain a dictionary `_last_question[sender]` to record each user's previous question.\n\n3. **Modify the JSONL file writing**: The code writes feedback to the `badcase_pending.jsonl` file, but it does not handle the case where the file is not writable.\n\nHere's the updated code:\n\n```python\nimport json\nimport os\n\n# Define the feedback key words\nFB_GOOD = {\"好评\", \"👍\", \"good\", \"好用\", \"准确\", \"正确\", \"赞\"}\nFB_BAD = {\"差评\", \"", "metrics": { "length": 1056, "commands": 0, "command_list": [], "has_command_block": false, "actionable": true, "inline_code_count": 2, "lesson_hits": 0, "lesson_hit_rate": 0.0 }, "error": null } ] }