Skip to content

Poor UX setting up pre-commit hook: model/provider/base_url not picked up from .cora.yaml #176

Closed

Description

@ajianaz

Summary

Setting up cora hook install with a custom LLM model (glm-5.1 via Z.AI proxy) was frustrating. The pre-commit hook kept defaulting to gpt-4o-mini + OpenAI despite having model config in .cora.yaml.

Steps to Reproduce

  1. cora init — creates .cora.yaml with no model/provider/base_url fields
  2. Manually add model: glm-5.1 to top-level of .cora.yaml
  3. cora hook install
  4. Make a commit → hook runs but uses gpt-4o-mini (ignored YAML config)
  5. Hook fails with API error because gpt-4o-mini doesn't exist on Z.AI endpoint

Expected Behavior

  • cora init should ask for or detect model/provider/base_url, or at minimum document how to set them
  • .cora.yaml top-level model: key should be read by the hook
  • cora config show should reflect .cora.yaml values without needing cora config set

Actual Behavior

  • cora init creates a bare config with no provider info
  • Top-level model: in YAML is silently ignored
  • Only cora config set model glm-5.1 + cora config set base_url ... + cora config set provider openai actually writes the correct keys
  • Had to run cora config show to discover the resolved config was still gpt-4o-mini
  • Hook fails with exit code 1 on "No changes to review" which is confusing (error vs no-op)

Specific Pain Points

1. cora init doesn't set provider info

Running cora init creates:

language: dart
auto_review: true
rules: [...]

No provider, model, or base_url anywhere. A new user has no idea they need to add these.

2. YAML top-level model: is ignored

Adding this to .cora.yaml does nothing:

model: glm-5.1

Only cora config set model glm-5.1 works, which rewrites the YAML into a different format.

3. No validation on init

cora init should validate that the configured model/provider is reachable, or at least warn if defaults won't work.

4. Hook error on empty diff

When --staged has no changes, cora exits with code 1 (error) instead of 0 (success/no-op). The hook interprets this as an error and shows ⚠️ cora review encountered an error which is misleading.

Environment

  • cora v0.3.0
  • OS: Linux ARM64 (Debian)
  • Provider: openai-compatible (Z.AI proxy at custom base_url)
  • Model: glm-5.1

Suggested Improvements

  1. cora init should be interactive — ask for provider, model, base_url, and API key setup
  2. .cora.yaml should have a provider: section that the hook reads:
    provider:
      name: openai
      model: glm-5.1
      base_url: https://api.z.ai/api/coding/paas/v4
  3. Validate config after init — cora config validate or built-in check
  4. Empty diff should exit 0 — --staged with no changes is not an error
  5. Better error messages — if model not found, say "model X not found at base_url Y" instead of generic error

Great tool btw — the review quality with glm-5.1 is excellent. Just the setup flow needs love.

Activity

  1. added
    bug
    enhancement
    good first issue
    on Jun 6, 2026
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

    bugenhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions