Skip to content

bug: provider shortcut string does not resolve preset base_url #183

Closed

Description

@ajianaz

Description

PR #178 added shortcut format for provider config (provider: zai instead of nested object). However, the shortcut format does not resolve default_base_url from the provider preset table. This causes the model to use the OpenAI default URL instead of the ZAI URL.

Impact

  • Users configure provider: zai in .cora.yaml but get OpenAI base_url
  • Only workaround is to always use nested format with explicit base_url

Expected Behavior

# This should resolve to:
# provider: zai, model: glm-5.1, base_url: https://api.z.ai/api/coding/paas/v4
provider: zai
model: glm-5.1

Actual Behavior

provider: zai
model: glm-5.1
# base_url resolves to https://api.openai.com/v1 (wrong!)

Fix

merge_top_level_provider_shortcuts() in src/config/schema.rs needs to look up the preset table and fill default_base_url when provider is a bare string.

Activity

  1. added
    bug
    on Jun 6, 2026
  2. ajianaz commented on Jun 7, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed by existing code in merge_into() (src/config/schema.rs). The preset resolution already works for bare string providers — provider: zai correctly resolves to model: glm-5.1, base_url: https://api.z.ai/api/coding/paas/v4. Verified with test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions