{
  "schemaVersion": "1.0",
  "item": {
    "slug": "task-persistence",
    "name": "Task Persistence",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/yangdaowan/task-persistence",
    "canonicalUrl": "https://clawhub.ai/yangdaowan/task-persistence",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/task-persistence",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=task-persistence",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "_meta.json",
      "config.json",
      "dist/SKILL.md",
      "dist/config.json",
      "dist/scripts/__init__.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/task-persistence"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/task-persistence",
    "agentPageUrl": "https://openagent3.xyz/skills/task-persistence/agent",
    "manifestUrl": "https://openagent3.xyz/skills/task-persistence/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/task-persistence/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Task Persistence",
        "body": "会话状态管理、任务持久化和网关重启恢复。"
      },
      {
        "title": "核心场景",
        "body": "触发条件动作网关刚重启运行 check-restart，汇报恢复状态开始长时间任务用 task_manager.py add 注册任务用户问\"有没有未完成的任务\"运行 task_manager.py list任务完成运行 task_manager.py complete任务被中断运行 task_manager.py recover"
      },
      {
        "title": "变量说明",
        "body": "所有脚本中的 {baseDir} = 本技能的目录路径（SKILL.md 所在目录）。\n工作区路径从环境变量 OPENCLAW_WORKSPACE 读取，默认 /workspace。"
      },
      {
        "title": "网关重启后检查（每次重启后必须执行）",
        "body": "python3 {baseDir}/scripts/main.py --mode check-restart --workspace /workspace"
      },
      {
        "title": "查看所有活跃任务",
        "body": "python3 {baseDir}/scripts/task_manager.py --action list --workspace /workspace"
      },
      {
        "title": "注册新任务（开始长时间操作前）",
        "body": "python3 {baseDir}/scripts/task_manager.py \\\n  --action add \\\n  --task-id \"task_$(date +%s)\" \\\n  --task-type \"file_processing\" \\\n  --description \"处理大量文件\" \\\n  --priority normal \\\n  --workspace /workspace"
      },
      {
        "title": "标记任务完成",
        "body": "python3 {baseDir}/scripts/task_manager.py \\\n  --action complete \\\n  --task-id <task_id> \\\n  --workspace /workspace"
      },
      {
        "title": "从崩溃/重启中恢复任务",
        "body": "python3 {baseDir}/scripts/task_manager.py \\\n  --action recover \\\n  --workspace /workspace"
      },
      {
        "title": "任务队列状态",
        "body": "python3 {baseDir}/scripts/task_manager.py --action status --workspace /workspace"
      },
      {
        "title": "会话快照（保存当前状态）",
        "body": "python3 {baseDir}/scripts/session_snapshot.py \\\n  --workspace /workspace \\\n  --action list"
      },
      {
        "title": "网关监控状态",
        "body": "python3 {baseDir}/scripts/main.py --mode status --workspace /workspace"
      },
      {
        "title": "重启后工作流",
        "body": "当 heartbeat 或用户提到\"网关重启\"时，执行：\n\npython3 {baseDir}/scripts/main.py --mode check-restart --workspace /workspace\n解析输出中的 active_tasks 和 recovered_tasks\n向用户汇报：哪些任务被恢复、哪些需要手动继续"
      },
      {
        "title": "文件结构",
        "body": "/workspace/\n  tasks/\n    task_queue.json       # 任务队列\n    completed/            # 已完成任务\n    failed/               # 失败任务\n  memory/\n    session_snapshots/    # 会话快照\n  persistence/\n    active_tasks.json     # 持久化任务\n    gateway_state.json    # 网关状态"
      },
      {
        "title": "注意事项",
        "body": "脚本使用标准库，无需额外安装依赖\n所有数据持久化在 workspace 目录下，重启后不会丢失\ntask_manager.py 是统一入口，推荐优先使用\ngateway_monitor.py 的后台监控模式（full mode）在沙箱中不适用，用 check-restart 代替"
      }
    ],
    "body": "Task Persistence\n\n会话状态管理、任务持久化和网关重启恢复。\n\n核心场景\n触发条件\t动作\n网关刚重启\t运行 check-restart，汇报恢复状态\n开始长时间任务\t用 task_manager.py add 注册任务\n用户问\"有没有未完成的任务\"\t运行 task_manager.py list\n任务完成\t运行 task_manager.py complete\n任务被中断\t运行 task_manager.py recover\n变量说明\n\n所有脚本中的 {baseDir} = 本技能的目录路径（SKILL.md 所在目录）。 工作区路径从环境变量 OPENCLAW_WORKSPACE 读取，默认 /workspace。\n\n快速命令\n网关重启后检查（每次重启后必须执行）\npython3 {baseDir}/scripts/main.py --mode check-restart --workspace /workspace\n\n查看所有活跃任务\npython3 {baseDir}/scripts/task_manager.py --action list --workspace /workspace\n\n注册新任务（开始长时间操作前）\npython3 {baseDir}/scripts/task_manager.py \\\n  --action add \\\n  --task-id \"task_$(date +%s)\" \\\n  --task-type \"file_processing\" \\\n  --description \"处理大量文件\" \\\n  --priority normal \\\n  --workspace /workspace\n\n标记任务完成\npython3 {baseDir}/scripts/task_manager.py \\\n  --action complete \\\n  --task-id <task_id> \\\n  --workspace /workspace\n\n从崩溃/重启中恢复任务\npython3 {baseDir}/scripts/task_manager.py \\\n  --action recover \\\n  --workspace /workspace\n\n任务队列状态\npython3 {baseDir}/scripts/task_manager.py --action status --workspace /workspace\n\n会话快照（保存当前状态）\npython3 {baseDir}/scripts/session_snapshot.py \\\n  --workspace /workspace \\\n  --action list\n\n网关监控状态\npython3 {baseDir}/scripts/main.py --mode status --workspace /workspace\n\n重启后工作流\n\n当 heartbeat 或用户提到\"网关重启\"时，执行：\n\npython3 {baseDir}/scripts/main.py --mode check-restart --workspace /workspace\n解析输出中的 active_tasks 和 recovered_tasks\n向用户汇报：哪些任务被恢复、哪些需要手动继续\n文件结构\n/workspace/\n  tasks/\n    task_queue.json       # 任务队列\n    completed/            # 已完成任务\n    failed/               # 失败任务\n  memory/\n    session_snapshots/    # 会话快照\n  persistence/\n    active_tasks.json     # 持久化任务\n    gateway_state.json    # 网关状态\n\n注意事项\n脚本使用标准库，无需额外安装依赖\n所有数据持久化在 workspace 目录下，重启后不会丢失\ntask_manager.py 是统一入口，推荐优先使用\ngateway_monitor.py 的后台监控模式（full mode）在沙箱中不适用，用 check-restart 代替"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/yangdaowan/task-persistence",
    "publisherUrl": "https://clawhub.ai/yangdaowan/task-persistence",
    "owner": "yangdaowan",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/task-persistence",
    "downloadUrl": "https://openagent3.xyz/downloads/task-persistence",
    "agentUrl": "https://openagent3.xyz/skills/task-persistence/agent",
    "manifestUrl": "https://openagent3.xyz/skills/task-persistence/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/task-persistence/agent.md"
  }
}