返回顶部
k

kilocode-model-sync代码模型同步

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
96
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

kilocode-model-sync

----- 此技能已弃用 - 请勿运行 -----

----- KILOCODE 网关现已内置于 OPENCLAW 中 -----

Kilocode 模型同步

工作空间: ~/.openclaw/workspace-steve/
脚本: ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/
快照/差异/补丁: ~/.openclaw/workspace/kilocode-models/
Telegram 投递: 使用 message 工具,设置 channel=telegram,目标为 Guillaume 的聊天。



步骤 1 — 运行同步脚本

bash
source ~/.openclaw/.env && python3 ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/sync_models.py

解析 stdout 中的 JSON 结果。它包含:

字段含义
statuschanged \nochange \error
totalmodels
从 API 获取的模型总数 |
| diff.added | 上一快照中不存在的新模型 |
| diff.removed | 已消失的模型 |
| diff.updated | 字段发生变化的模型 |
| snapshot_path | 今日快照的保存路径 |
| patch_path | .patch.json 文件的路径(仅在发生变化时存在) |
| diff_path | .diff.json 文件的路径(仅在发生变化时存在) |


步骤 2 — 如果 status == no_change

写入一条简短的内存记录并停止。无需通知。

memory/YYYY-MM-DD.md 条目:

Kilocode 模型同步 — YYYY-MM-DD

  • - 状态:无变化
  • 模型总数:X
  • 无需操作。

步骤 3 — 如果 status == changed,通过 Telegram 通知 Guillaume

使用 message 工具发送到 Guillaume 的 Telegram:

🤖 Kilocode 模型同步 — {日期}

在 Kilocode 模型列表中发现变化:
✅ 新增:{N} 个模型
❌ 移除:{N} 个模型
🔄 更新:{N} 个模型

新模型:
{对于每个新增:• id — 名称(上下文:Xk tokens,成本:输入 $Y/输出 $Z 每 1k)}

移除的模型:
{对于每个移除:• id — 名称}

回复 Grog:@steve approve 以应用,或 @steve skip 以忽略。

成本格式化为 $0.001/1k(将原始每 token 值 × 1000)。
对于输入和输出成本均为 0 的模型,使用 free。



步骤 4 — 等待 Grog 的批准信号

Grog 将向您的会话转发一条 sessions_send 消息,其中包含:

  • - approve — 继续应用
  • skip — 记录并停止



步骤 5 — 如果批准,应用补丁

bash
python3 ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/applypatch.py path>

该脚本:

  1. 1. 使用时间戳备份 openclaw.json
  2. 将 models.providers.kilocode.models 替换为新列表
  3. 运行 openclaw gateway restart
  4. 轮询 openclaw gateway status 直到 RPC probe: ok(最长 30 秒)

结果字段:

  • - status:ok \| appliedrestartfailed
  • backup_path:备份的保存路径
  • gateway.ok:true/false
  • gateway.error:失败时的错误消息



步骤 6 — 写入任务控制条目

追加到 ~/.openclaw/workspace/memory/YYYY-MM-DD.md:

markdown

Kilocode 模型同步 — YYYY-MM-DD


  • - 状态: 已应用 ✅
  • 新增: N 个模型 — 列出 ID
  • 移除: N 个模型 — 列出 ID
  • 更新: N 个模型 — 列出 ID
  • 备份: backup_path
  • 网关重启: 成功 / 失败(错误消息)
  • 批准人: Guillaume(通过 Telegram)



步骤 7 — 发送 Telegram 确认

Kilocode 模型同步 — 已应用

{N} 个新模型已添加到 openclaw.json。
{N} 个模型已移除。
网关重启成功。 ✅

备份保存于:{backup_path}

如果网关重启失败:

⚠️ Kilocode 模型同步 — 补丁已应用,网关重启失败

模型已写入 openclaw.json,但网关未干净重启。
错误:{error}
请手动重启:openclaw gateway restart



步骤 8 — 向 Grog 报告摘要(sessions_send 到主会话)

完成后,向主代理会话发送一份简洁摘要,以便 Grog 在需要时转发给 Guillaume。
使用 sessions_send,设置 label=main 或 sessionKey=agent:main:main。



错误处理

  • - 如果 syncmodels.py 退出状态为 error:通过 Telegram 通知 Guillaume 错误信息,停止。
  • 如果 applypatch.py 无法写入配置:脚本会自动从备份恢复;报告失败。
  • 如果网关未恢复:在 Telegram 中报告,告知 Guillaume 手动重启。
  • 即使失败,也始终写入内存记录。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 kilocode-model-sync-1776030982 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 kilocode-model-sync-1776030982 技能

通过命令行安装

skillhub install kilocode-model-sync-1776030982

下载

⬇ 下载 kilocode-model-sync v1.0.0(免费)

文件大小: 6.81 KB | 发布时间: 2026-4-13 10:45

v1.0.0 最新 2026-4-13 10:45
**This version officially deprecates the kilocode-model-sync skill.**

- Added prominent deprecation notice: Kilocode Gateway is now built-in to OpenClaw; do not run this skill.
- Documentation updated to reflect end-of-life status and recommend against use.
- All previous operational steps and usage details retained for reference, but strictly marked as deprecated.
- No functional or code changes; this release is a documentation and process update only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部