Skip to content

fix model/provider mismatch#209

Open
SegFault42 wants to merge 5 commits intosipeed:mainfrom
SegFault42:fix-conflict
Open

fix model/provider mismatch#209
SegFault42 wants to merge 5 commits intosipeed:mainfrom
SegFault42:fix-conflict

Conversation

@SegFault42
Copy link

Mismatch in the readme config section.

glm-4.7 is not available in openRouter.

It leads to an error and this kind of issues #199

@Leeaandrob
Copy link
Collaborator

@Zepan Fixes model/provider mismatch — a 1-line change that ensures the correct provider is selected for a given model.

Recommendation: Merge. Trivial fix, high impact.

@pamdla
Copy link

pamdla commented Feb 17, 2026

whatever you change the provider, it always points to openrouter. that is ridiculous.

Error creating provider: no API key configured for model: qwen3-coder-plus

My version: 0.1.1 (for aarm apk)

u0_a403@Droiclaw ~ $ picoclaw version
🦞 picoclaw v0.1.1
  Build: 2026-02-13T02:48:04+0000
  Go: go1.25.7
{
  "agents": {
    "defaults": {
      "workspace": "~/.picoclaw/workspace",
      "restrict_to_workspace": true,
      "provider": "bailian",
      "model": "qwen3-coder-plus",
      "max_tokens": 8192,
      "temperature": 0.7,
      "max_tool_iterations": 20
    }
....


  "providers": {
    "anthropic": {
      "api_key": "",
      "api_base": ""
    },
    "bailian": {
      "api_key": "sk-xxxxxx",
      "api_base": "https://coding.dashscope.aliyuncs.com/v1"
    },
    "openai": {
      "api_key": "",
      "api_base": ""
    },
    "openrouter": {
      "api_key": "sk-xxxxxx",
      "api_base": "https://openrouter.ai/api/v1"
....

Copy link
Collaborator

@Leeaandrob Leeaandrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #209 Deep Review — @SegFault42

Hey @SegFault42, thanks for catching this. The diagnosis is correct — glm-4.7 is a Zhipu-specific model that doesn't exist on OpenRouter, and the README Quick Start example was misleading users into a 400 error (issue #199).

However, this PR only fixes 1 of 5 places where this mismatch exists. The most critical one — the programmatic default in config.go — is not touched.


Verification

  • Checked out branch locally: SegFault42/main
  • go vet ./... — clean
  • go test ./pkg/... — all passing
  • Searched codebase for all glm-4.7 occurrences — found 8 total across 6 files

Full Audit of glm-4.7 Occurrences

File Line Context Action Needed?
README.md:195 Quick Start (OpenRouter) Fixed by this PR
README.md:679 Zhipu provider section Correct for Zhipu — leave as-is
README.zh.md:202 Quick Start (OpenRouter) Same bug — needs fix
README.zh.md:551 Zhipu section Correct for Zhipu — leave as-is
README.ja.md:180 Quick Start (OpenRouter) Same bug — needs fix
config/config.example.json:6 Example config (no provider) Misleading — needs fix
pkg/config/config.go:224 DefaultConfig() runtime default CRITICAL — root cause
pkg/migrate/migrate_test.go:296 Migration test assertion Follows config.go — update if config changes

Summary of Findings

HIGH (Should Fix)

  • H1: pkg/config/config.go:224DefaultConfig() still returns "glm-4.7". This is the actual default used by picoclaw onboard. Even after this PR merges, new users running picoclaw onboard will get glm-4.7 in their generated config.
  • H2: Chinese README (README.zh.md:202) and Japanese README (README.ja.md:180) have the same Quick Start bug — showing glm-4.7 with OpenRouter provider.

MEDIUM

  • M1: config/config.example.json:6 still has glm-4.7 without specifying a provider — misleading for users who copy this template.

POSITIVE

  1. Correct root cause identification — glm-4.7 is Zhipu-only, not available on OpenRouter
  2. The model change to deepseek/deepseek-chat is a good default — widely available on OpenRouter
  3. Directly addresses issue #199

RE: @pamdla's comment — The provider routing issue they describe (always pointing to OpenRouter) appears to be a separate bug in the fallback logic of CreateProvider() (http_provider.go). The model name auto-detection at line 380 requires the corresponding provider API key to be set; if it's not, the fallback logic may incorrectly route to OpenRouter. This should be tracked as a separate issue.


Verdict: REQUEST CHANGES

What needs to change before merge:

  • Fix pkg/config/config.go:224 — change DefaultConfig() model to "deepseek/deepseek-chat" (or a provider-agnostic model) — see H1
  • Fix README.zh.md:202 and README.ja.md:180 — same Quick Start mismatch — see H2
  • Update pkg/migrate/migrate_test.go:296-297 if config.go default changes
  • Optionally fix config/config.example.json:6 — see M1

Estimated effort: ~30 minutes. Happy to re-review.

README.md Outdated
"defaults": {
"workspace": "~/.picoclaw/workspace",
"model": "glm-4.7",
"model": "deepseek/deepseek-chat",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Positive] @SegFault42 — Correct fix for the Quick Start section. deepseek/deepseek-chat is a valid and widely available model on OpenRouter. This directly addresses the 400 error in issue #199 for users following this specific example.

README.md Outdated
"defaults": {
"workspace": "~/.picoclaw/workspace",
"model": "glm-4.7",
"model": "deepseek/deepseek-chat",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[H1 — HIGH: Root Cause Not Fixed] @SegFault42 — This README change is cosmetic. The actual default that users get when running picoclaw onboard comes from pkg/config/config.go:224:

func DefaultConfig() *Config {
    return &Config{
        Agents: AgentsConfig{
            Defaults: AgentDefaults{
                Model: "glm-4.7",  // ← still here
            },
        },
    }
}

picoclaw onboard calls DefaultConfig() (main.go:231) and writes the result to ~/.picoclaw/config.json. So even after this PR merges, every new user who runs picoclaw onboard will get glm-4.7 in their config.

Also affected: config/config.example.json:6, README.zh.md:202, README.ja.md:180 — all still show glm-4.7 with OpenRouter.

Note: The Zhipu-specific sections (README.md:679, README.zh.md:551) correctly use glm-4.7 and should NOT be changed.

@Leeaandrob
Copy link
Collaborator

@SegFault42 take look on the changes review.

@SegFault42
Copy link
Author

@Leeaandrob All done ! 👏

Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent across all 6 files. Since glm-4.7 isn't available on OpenRouter (the de facto default provider), this is a real onboarding blocker. Worth a maintainer confirmation that deepseek/deepseek-chat is the desired default, but the fix is correct. LGTM.

@yinwm
Copy link
Collaborator

yinwm commented Feb 24, 2026

We make a refactor about provider in #283, could you please resolve conflicts
@SegFault42

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants