fix(provider): follow-up CN/global consistency for Z.AI and aliases (#554)
* fix(provider): harden CN/global routing consistency for Chinese vendors * fix(agent): migrate CLI channel send to SendMessage * fix(onboard): deduplicate Z.AI key URL match arms
This commit is contained in:
parent
cd0dd13476
commit
fc6e8eb521
5 changed files with 97 additions and 13 deletions
|
|
@ -377,7 +377,10 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
|
|||
description: "Z.AI inference",
|
||||
category: IntegrationCategory::AiModel,
|
||||
status_fn: |c| {
|
||||
if c.default_provider.as_deref() == Some("zai") {
|
||||
if matches!(
|
||||
c.default_provider.as_deref(),
|
||||
Some("zai" | "z.ai" | "zai-global" | "z.ai-global" | "zai-cn" | "z.ai-cn")
|
||||
) {
|
||||
IntegrationStatus::Active
|
||||
} else {
|
||||
IntegrationStatus::Available
|
||||
|
|
@ -472,7 +475,7 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
|
|||
description: "Baidu AI models",
|
||||
category: IntegrationCategory::AiModel,
|
||||
status_fn: |c| {
|
||||
if c.default_provider.as_deref() == Some("qianfan") {
|
||||
if matches!(c.default_provider.as_deref(), Some("qianfan" | "baidu")) {
|
||||
IntegrationStatus::Active
|
||||
} else {
|
||||
IntegrationStatus::Available
|
||||
|
|
@ -1011,5 +1014,19 @@ mod tests {
|
|||
(qwen.status_fn)(&config),
|
||||
IntegrationStatus::Active
|
||||
));
|
||||
|
||||
config.default_provider = Some("zai-cn".to_string());
|
||||
let zai = entries.iter().find(|e| e.name == "Z.AI").unwrap();
|
||||
assert!(matches!(
|
||||
(zai.status_fn)(&config),
|
||||
IntegrationStatus::Active
|
||||
));
|
||||
|
||||
config.default_provider = Some("baidu".to_string());
|
||||
let qianfan = entries.iter().find(|e| e.name == "Qianfan").unwrap();
|
||||
assert!(matches!(
|
||||
(qianfan.status_fn)(&config),
|
||||
IntegrationStatus::Active
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue