Skip to content

Conversation

@killbus
Copy link
Contributor

@killbus killbus commented Nov 19, 2025

What

Add enabled status check to model resolution in routing logic.

Why

Disabled models were being selected during routing, causing requests to be sent to models that administrators had explicitly disabled.

How

  • Add m.enabled === 1 condition to model filtering in resolveSmartRouting()
  • Add m.enabled === 1 condition to model filtering in resolveExpertRouting()
  • Ensure only enabled models are considered during routing resolution

Impact

  • Respects model enable/disable configuration
  • Prevents routing to disabled models
  • No breaking changes to existing API

@killbus killbus marked this pull request as draft November 20, 2025 00:29
@killbus
Copy link
Contributor Author

killbus commented Nov 20, 2025

这里简单添加 enabled 过滤并不能完全达到预期,

如果没有 enabled 结果,resolveSmartRouting 应该返回 null 吗?那它的下游应该如何处理?

@sxueck
Copy link
Owner

sxueck commented Nov 20, 2025

这里简单添加 enabled 过滤并不能完全达到预期,

如果没有 enabled 结果,resolveSmartRouting 应该返回 null 吗?那它的下游应该如何处理?

直接 disabled 会导致权重计算异常,不过如果直接返回 null 倒也不会产生致命错误,超过三次重试会自动触发熔断器,对整体用户请求流程不会造成完全中断,可以使用 “占位模型" 角色?当命中该模型视为已经被触发熔断了自动选择下一个,这部分逻辑会比较难写

@sxueck sxueck force-pushed the main branch 2 times, most recently from 989aba2 to cd6c776 Compare December 1, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants