Conversation
|
@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. |
|
whatever you change the provider, it always points to openrouter. that is ridiculous. Error creating provider: no API key configured for model: qwen3-coder-plusMy 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"
.... |
Leeaandrob
left a comment
There was a problem hiding this comment.
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 ./...— cleango test ./pkg/...— all passing- Searched codebase for all
glm-4.7occurrences — 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:224—DefaultConfig()still returns"glm-4.7". This is the actual default used bypicoclaw onboard. Even after this PR merges, new users runningpicoclaw onboardwill getglm-4.7in their generated config. - H2: Chinese README (
README.zh.md:202) and Japanese README (README.ja.md:180) have the same Quick Start bug — showingglm-4.7with OpenRouter provider.
MEDIUM
- M1:
config/config.example.json:6still hasglm-4.7without specifying a provider — misleading for users who copy this template.
POSITIVE
- Correct root cause identification —
glm-4.7is Zhipu-only, not available on OpenRouter - The model change to
deepseek/deepseek-chatis a good default — widely available on OpenRouter - 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— changeDefaultConfig()model to"deepseek/deepseek-chat"(or a provider-agnostic model) — see H1 - Fix
README.zh.md:202andREADME.ja.md:180— same Quick Start mismatch — see H2 - Update
pkg/migrate/migrate_test.go:296-297if 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", |
There was a problem hiding this comment.
[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", |
There was a problem hiding this comment.
[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.
|
@SegFault42 take look on the changes review. |
|
@Leeaandrob All done ! 👏 |
nikolasdehor
left a comment
There was a problem hiding this comment.
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.
|
We make a refactor about provider in #283, could you please resolve conflicts |
|
|
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