Skip to content

[Feature] Add GLM (ZhipuAI) as first-class auxiliary provider #26880

@zccyman

Description

@zccyman

Feature Description

Add GLM (ZhipuAI) as a first-class built-in provider in the auxiliary client's PROVIDER_REGISTRY, alongside OpenRouter, Nous, xAI, etc.

Current Behavior

Users must configure GLM through the custom endpoint path:

auxiliary:
  vision:
    provider: glm
    model: glm-4v-flash
    base_url: "https://open.bigmodel.cn/api/paas/v4/"
    api_key: "<key>"

This triggers the "custom" provider branch in _resolve_task_provider_model (line 3985-3987), which:

  1. Strips the provider identity, breaking all provider-specific logic downstream
  2. Requires manual base_url and api_key configuration
  3. Bypasses the ZAI/GLM-specific vision handling in resolve_vision_provider_client

Proposed Behavior

auxiliary:
  vision:
    provider: glm    # or "zhipu" or "zhipuai"
    model: glm-4v-flash
    # base_url and api_key auto-resolved from ZHIPU_API_KEY env var

This would require:

  1. Add "glm" / "zhipu" / "zhipuai" to PROVIDER_REGISTRY with:

    • api_key_env_vars: ["ZHIPU_API_KEY", "ZHIPUAI_API_KEY", "GLM_API_KEY"]
    • inference_base_url: "https://open.bigmodel.cn/api/paas/v4"
    • default_auxiliary_model: "glm-4v-flash" (for vision)
  2. Extend ZAI vision logic to also cover GLM provider:

    # In resolve_vision_provider_client, line 3566:
    if requested in ("zai", "glm") and not resolved_base_url:
  3. Extend _build_call_kwargs ZAI vision max_tokens skip to also match GLM:

    _skip_max_tokens = (
        provider in ("zai", "glm")
        and ("4v" in _model_lower or "5v" in _model_lower or "-v" in _model_lower)
    )

Motivation

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt builderprovider/zaiZAI providertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions