#Tg

1 messages · Page 1 of 1 (latest)

weary pike
#

Restarted systemd service: openclaw-gateway.
Error: Config validation failed: channels.te legram-programming: unknown channel id: tele gram-programming
[root@VM-0-11-opencloudos ~]#

celest haloBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

main bisonBOT
#

That error means your config has a channel entry under channels with the id telegram-programming (your paste wrapped it as te legram-programming). OpenClaw only recognizes real channel IDs there (e.g. telegram, discord, whatsapp, …), so telegram-programming is rejected and the gateway won’t start.

Fix

Change something like:

{
  channels: {
    "telegram-programming": { ... }
  }
}

to:

#
{
  channels: {
    telegram: {
      enabled: true,
      botToken: "...",
      // ...
    }
  }
}

If your goal was “the programming Telegram group should behave differently”, keep the channel as channels.telegram and configure the group under:

  • channels.telegram.groups["<chatId>"] (group-specific settings), and/or
  • bindings (route that Telegram group to a different agentId)
weary pike
#

如何設定 多個ai Deepseek, Glm 4.7 flash x, Glm 5, 讓Openclaw 發揮得更好又可以節省token

main bisonBOT
#

可以,把「多個模型」用得又省 token,核心做法是:

  1. 日常用便宜/快的當主模型
  2. 遇到難題才自動切到更強的 fallback
  3. 把不同用途拆成不同 agent(可選,但很有效)
  4. 把「長對話成本」用 compaction / pruning / reset 壓下來

下面給你一套最常見、最穩的配置方式(不需要我猜 Deepseek / GLM 的實際 model id,你用 CLI 查到的 provider/model 填進去就行)。


A) 一個 agent,多模型:primary + fallbacks(最簡單)

  1. 先在機器上看你目前可用的模型字串(重點是精確的 provider/model):
openclaw models status
openclaw models list --all
#
  1. ~/.openclaw/openclaw.json 設定(JSON5):
{
  agents: {
    defaults: {
      models: {
        // 把你要用的幾個模型都放進 allowlist + 取 alias(自己命名)
        "PROVIDER/FLASH_MODEL": { alias: "fast" },
        "PROVIDER/STRONG_MODEL": { alias: "strong" },
        "PROVIDER/ALT_STRONG_MODEL": { alias: "strong2" },
      },

      model: {
        primary: "PROVIDER/FLASH_MODEL",          // 日常:便宜快(你說的 flash 類)
        fallbacks: ["PROVIDER/STRONG_MODEL"],     // 困難:才用大模型(例如 GLM 5 類)
#
      },

      // 省 token 的關鍵之一:預設思考/verbose 別開太高
      thinkingDefault: "low",
      verboseDefault: "off",
    },
  },
}

這樣平常用「flash」,遇到 provider 掛了/限流/不支援某些能力才會掉到 fallback(省錢又保底)。


B) 拆成多個 agent:聊天用省、寫程式/工具用強(更進階但更划算)

你可以做兩個 agent,例如:

#
  • chat:默認用 flash(省 token)
  • work:默認用強模型(需要工具/寫程式時再用)
{
  agents: {
    list: [
      { id: "chat", default: true,  workspace: "~/.openclaw/ws-chat", model: "PROVIDER/FLASH_MODEL" },
      { id: "work",               workspace: "~/.openclaw/ws-work", model: "PROVIDER/STRONG_MODEL" },
    ],
  },

  bindings: [
    // 例:把某個 Telegram 群/頻道綁到 work agent(填你的 peer id)
    // { agentId: "work", match: { channel: "telegram", peer: { kind: "group", id: "-100123..." } } },
  ],
#
}

好處:不同工作流分開記憶/上下文,不會「聊天聊很長」把寫程式的 context 也拖肥 → 直接省 token


C) 省 token 的 3 個超有感開關(不改模型也有效)

在 config reference 這幾個都很實用:

  1. Heartbeat 用便宜模型(最常見燒錢點)
{
  agents: {
    defaults: {
#
      heartbeat: {
        model: "PROVIDER/CHEAP_MODEL"
      }
    }
  }
}
  1. Context pruning:把很久以前的工具輸出裁掉(不影響硬碟上的歷史,只影響送進 LLM 的上下文)
{
  agents: {
    defaults: {
      contextPruning: { mode: "cache-ttl", ttl: "1h" }
    }
#
  }
}
  1. Session reset:閒置多久就自動新開一段,避免永遠累積
{
  session: {
    reset: { mode: "idle", idleMinutes: 120 }
  }
}

你下一步給我兩個輸出,我就能幫你對症下藥(不需要貼 token)

#

請貼:

openclaw --version
openclaw models status

另外你現在是想要:

  • (1) Telegram 群聊日常省錢但偶爾要變強
    還是
  • (2) 主要用來寫程式/工具,自動在「快 vs 強」之間切換?

(如果你要「Deepseek / GLM 哪個更適合什麼任務」這種最新體感比較,建議也去 Discord 的 #models 問,大家的實測比較新。)