闲社服务运行正常AI智能体自动化平台
m

模型路由修复

技能标识:model-route-guard

Diagnose and fix model routing conflicts. Ensure primary model uses correct provider endpoint without duplicate overrides.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

模型路由修复

模型路由防护

修复模型路由与提供商端点冲突。

问题

模型路由问题会导致:

  • - 使用错误的提供商端点
  • 重复的提供商定义
  • 代理覆盖与全局配置冲突
  • 静默回退到错误模型

工作流程

1. 路由审计

powershell

检查全局配置


$cfg = Get-Content $HOME/.openclaw/openclaw.json -Raw | ConvertFrom-Json
$globalBase = $cfg.models.providers.bailian.baseUrl
$globalModel = $cfg.agents.defaults.model.primary

检查代理覆盖

$agentCfgPath = $HOME/.openclaw/agents/main/agent/models.json if (Test-Path $agentCfgPath) { $agentCfg = Get-Content $agentCfgPath -Raw | ConvertFrom-Json $agentBase = $agentCfg.providers.bailian.baseUrl }

全局 baseUrl = $globalBase
全局 model = $globalModel
代理 baseUrl = $agentBase

检测冲突

if ($globalBase -ne $agentBase) { Write-Warning 全局配置与代理配置的提供商URL不匹配 }

2. 修复冲突

powershell

正确的端点(coding.dashscope,而非 coding-intl)


$correctUrl = https://coding.dashscope.aliyuncs.com/v1

更新全局配置

$cfg.models.providers.bailian.baseUrl = $correctUrl $cfg | ConvertTo-Json -Depth 10 | Out-File $HOME/.openclaw/openclaw.json -Encoding UTF8

移除冲突的代理覆盖

if (Test-Path $agentCfgPath) { Remove-Item $agentCfgPath -Force }

重启

openclaw gateway restart

3. 验证

powershell

测试模型调用


openclaw models list

检查活动路由

openclaw status

可执行完成标准

标准验证方式
单一提供商URL配置中仅有一个 bailian.baseUrl
正确端点
URL 为 coding.dashscope.aliyuncs.com | | 无重复覆盖 | models.json 已移除或对齐 | | 模型调用成功 | openclaw models list 正常工作 |

隐私/安全

  • - 审计输出中不包含API密钥
  • 对密钥值进行脱敏处理(仅显示前4个字符)
  • 仅涉及配置文件,无外部日志记录

自我触发条件

在以下情况使用:

  • - 模型调用因端点错误失败
  • 配置显示多个提供商定义
  • 网关重启后出现模型问题
  • 检测到静默回退到错误模型



一条路由。唯一真相来源。

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 model-route-guard-1776287497 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 model-route-guard-1776287497 技能

通过命令行安装

skillhub install model-route-guard-1776287497

下载

⬇ 下载 model-route-guard v1.0.0(免费)

文件大小: 2.06 KB | 发布时间: 2026-4-16 16:18

v1.0.0 最新 2026-4-16 16:18
- Initial release of model-route-guard.
- Diagnose and fix model routing conflicts for Openclaw.
- Audit and resolve duplicate provider overrides and endpoint mismatches.
- Ensures primary model uses correct provider endpoint (coding.dashscope.aliyuncs.com).
- Provides step-by-step workflow for route auditing, conflict fixing, and verification.
- Safeguards privacy by not exposing API keys in output.
返回顶部