/telegram-routing — Telegram Message Routing Manager
Manage how Telegram messages are routed between different Claude model backends in OpenClaw.
Usage
CODEBLOCK0
Config Location
All settings live in ~/.openclaw/openclaw.json under agents.defaults.
Key fields:
- -
model.primary — The primary model/provider reference - INLINECODE3 — Ordered fallback chain when primary is unavailable
Commands
status
Read the OpenClaw config and display current routing settings including:
- - Active primary model
- Configured fallback models
- Whether CLI backend is active
model
Switch the primary model. Valid shorthand references:
| Shorthand | Resolves to |
|---|
| INLINECODE4 | INLINECODE5 |
| INLINECODE6 |
claude-cli/sonnet |
|
haiku |
anthropic/claude-haiku-4-5 |
Steps:
- 1. Read INLINECODE10
- Update
agents.defaults.model.primary to the resolved model reference - Write the updated config
- Restart the gateway service
- Verify via gateway logs
logs
Show recent Telegram message processing activity from the gateway log.
fallback
Quick switch to API-only mode for faster, lightweight responses.
restore
Restore the default CLI-based routing configuration.
Architecture
Messages flow through the OpenClaw Gateway, which reads the configured model provider and dispatches to the appropriate backend. CLI-based providers use the local Claude Code installation, while API providers make direct API calls.
Troubleshooting
| Issue | Fix |
|---|
| Config errors on restart | Run openclaw doctor to validate config |
| Slow responses |
Try switching to
sonnet for faster responses |
| Gateway issues | Check
~/.openclaw/logs/gateway.log for details |
| Falling back to secondary model | Primary backend may be unavailable — check logs |
技能名称: claude-code-switchboard
详细描述:
/telegram-routing — Telegram消息路由管理器
管理Telegram消息如何在OpenClaw中不同的Claude模型后端之间路由。
使用方法
/telegram-routing status # 显示当前路由配置
/telegram-routing model [ # 切换主模型(例如:opus、sonnet、haiku)]
/telegram-routing logs # 显示最近的消息处理日志
/telegram-routing fallback # 切换到轻量级API模式
/telegram-routing restore # 恢复默认的基于CLI的路由配置
配置位置
所有设置均位于~/.openclaw/openclaw.json中的agents.defaults下。
关键字段:
- - model.primary — 主模型/提供者引用
- model.fallbacks — 当主模型不可用时的有序回退链
命令
status
读取OpenClaw配置并显示当前路由设置,包括:
- - 活跃的主模型
- 已配置的回退模型
- CLI后端是否处于活跃状态
model
切换主模型。有效的简写引用:
| 简写 | 解析为 |
|---|
| opus | claude-cli/opus |
| sonnet |
claude-cli/sonnet |
| haiku | anthropic/claude-haiku-4-5 |
步骤:
- 1. 读取~/.openclaw/openclaw.json
- 将agents.defaults.model.primary更新为解析后的模型引用
- 写入更新后的配置
- 重启网关服务
- 通过网关日志验证
logs
显示网关日志中最近的Telegram消息处理活动。
fallback
快速切换到仅API模式,以获得更快、更轻量的响应。
restore
恢复默认的基于CLI的路由配置。
架构
消息流经OpenClaw网关,该网关读取配置的模型提供者并分派到相应的后端。基于CLI的提供者使用本地Claude Code安装,而API提供者则直接进行API调用。
故障排除
| 问题 | 解决方法 |
|---|
| 重启时配置错误 | 运行openclaw doctor验证配置 |
| 响应缓慢 |
尝试切换到sonnet以获得更快的响应 |
| 网关问题 | 查看~/.openclaw/logs/gateway.log了解详情 |
| 回退到次要模型 | 主后端可能不可用——检查日志 |