A DingTalk bot that can switch models sounds like a “nice-to-have” until your team starts using it for real work. Suddenly you need two modes: a fast, cheap model for everyday Q&A, and a stronger model for deeper tasks — without making the bot confusing or fragile.
OpenClaw makes model switching a policy decision rather than a code fork, and Tencent Cloud Lighthouse gives you a stable home where the bot runs 24/7 with simple ops, high performance, and cost-effective reliability.
Model switching should be:
If switching is global and silent, someone will break everyone’s experience.
Start from a standardized environment, then add switching policies.
Now model switching is a routing layer on top of a stable bot runtime.
Two complementary mechanisms work best.
If the message looks like “generate a report,” route to strong. If it’s a quick “what’s the status?”, route to fast.
Admins can override for a session or group:
/model fast/model strong/model autoOpenClaw can parse these commands and update session state.
# dingtalk-model-switch.yaml
models:
fast:
kind: openai_compatible
base_url: ${FAST_MODEL_BASE_URL}
api_key: ${FAST_MODEL_API_KEY}
model: fast-chat
timeout_ms: 8000
strong:
kind: openai_compatible
base_url: ${STRONG_MODEL_BASE_URL}
api_key: ${STRONG_MODEL_API_KEY}
model: strong-chat
timeout_ms: 20000
routing:
defaults:
model: fast
rules:
- match:
contains_any: ["/model strong", "#deep"]
use:
model: strong
- match:
contains_any: ["/model fast"]
use:
model: fast
- match:
intent: "report"
use:
model: strong
session:
scope: "group"
admin_roles: ["owner", "admin"]
audit:
log_switch_events: true
The key is the scope. Group scope prevents one team’s preferences from affecting another.
Make switching safe with guardrails:
clawdbot onboard --channel dingtalk --config /etc/openclaw/dingtalk.yaml
clawdbot daemon start --name dingtalk-bot --log /var/log/openclaw/dingtalk-bot.log
clawdbot healthcheck --name dingtalk-bot
When the model changes, acknowledge it succinctly:
For non-admins, keep it invisible. They care about results, not settings.
Model switching is a power feature. In a corporate DingTalk workspace, you want it to feel safe by default:
A lightweight approach is to make switching a policy decision that evaluates the caller’s role before applying changes.
# switch-policy.yaml
switching:
allowed_roles: ["owner", "admin"]
scope: "group" # group/session/user
default_mode: "auto" # auto/fast/strong
notify_on_change: true
cooldown_seconds: 30 # prevent flip-flopping
The cooldown is underrated: it prevents “model thrash” in busy groups where multiple people try commands at once.
Even if switching is a chat command, the impact is real. The safest workflow:
If you want extra safety, add a “dry-run” command (admin-only) that reports what would happen without changing the active model.
If you want model switching that stays maintainable, don’t bake it into handlers.
Once switching is policy-based and observable, you can add new models without rewriting your DingTalk robot — and your teams get the best of both speed and quality.