← Back to PRs

#4459: fix: enable image input for Kimi K2.5 and refresh stale config model definitions

by manikv12 open 2026-01-30 07:24 View on GitHub →
agents
## Summary Follow-up to #4407 (5e635c9) which added Kimi K2.5 to the synthetic catalog but declared it text-only. - **Enable image input** for Kimi K2.5 in both the synthetic catalog (`synthetic-models.ts`) and the moonshot provider (`models-config.providers.ts`). - **Fix stale config override bug** in `mergeProviderModels` (`models-config.ts`): onboarding bakes the full model catalog into `~/.openclaw/openclaw.json`, and the old merge logic let stale config definitions shadow code updates — so even after fixing the catalog in code, existing users would never see capability changes (like adding image support). ### What changed in the merge logic **Before:** when both config file and code defined a model with the same ID, config always won — stale values for `input`, `reasoning`, `contextWindow`, `maxTokens` persisted forever. **After:** code-defined capability fields override stale config entries, while user-specific fields (`cost`, `headers`, `compat`, `apiKey`) are preserved from config. This affects all 7 providers that write model definitions during onboarding: synthetic, moonshot, kimi-code, xiaomi, venice, minimax, and qwen-portal. ### Testing - Verified old merge produces `["text"]` (broken), new merge produces `["text", "image"]` (fixed) - Verified user-specific fields (cost, apiKey) are preserved through merge - Verified new model IDs from code are still appended - End-to-end gateway test: stale `openclaw.json` + code fix → runtime `models.json` has correct `["text", "image"]` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR enables image input for Kimi K2.5 in both the synthetic catalog and the Moonshot provider defaults, and updates model merging so code-defined capability fields refresh stale model definitions that were previously written into users’ `openclaw.json` during onboarding. The core behavioral change is in `mergeProviderModels`, which now merges per-model entries by id: it preserves user-specific overrides from the config (e.g., cost/headers/compat/apiKey) while taking updated capability fields from the code-defined catalog, and still appends any new code-defined model ids not present in the config. <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge and addresses a real stale-config issue with low blast radius. - Changes are localized to model catalog metadata and the merge behavior for provider model definitions; the new merge logic is straightforward and preserves explicit provider config while refreshing a fixed set of capability fields. Main remaining risk is schema drift: if additional capability fields exist or are added later, they may still remain stale, and the current override assigns `undefined` if an implicit model omits one of the refreshed fields. - src/agents/models-config.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs