openclaw - ✅(Solved) Fix [Bug] cron-nested lane mis-resolves hyphen-prefixed provider aliases on 2026.4.29 [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#76155Fetched 2026-05-03 04:41:42
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
2
Author
Timeline (top)
referenced ×3cross-referenced ×2commented ×1unsubscribed ×1

The cron-nested lane's model resolver mis-handles aliases of the form <provider-with-hyphen>/<model> (e.g., kimi-code/kimi-for-coding), producing a stripped/different alias and reporting Unknown model. The same alias resolves correctly in the agent/embedded lane. This blocks any cron from using a provider whose name contains a hyphen.

Error Message

When a cron fires (lane=cron-nested), the resolver requests a stripped alias kimi/kimi-for-coding (note: the -code suffix on the provider name has been removed):

Root Cause

  1. Cleared payload.model from all crons so they inherit agents.defaults.model.primary. Crons still mis-resolve because they go through cron-nested.

Fix Action

Fix / Workaround

kimi-code/kimi-for-coding resolves consistently across all dispatch lanes. Verified working on the agent/embedded lane:

2026-05-01T19:02:52.004 [agent/embedded] phase=attempt-dispatch totalMs=14872
  model-resolution=7030ms  attempt-dispatch=3285ms

Workarounds attempted (all failed)

PR fix notes

PR #76163: fix(model): preserve custom provider key when it collides with built-in alias (#76155)

Description (problem / solution / changelog)

Root cause

resolveExactConfiguredProviderRef in model-selection-shared.ts is supposed to short-circuit parseModelRef for user-configured custom providers, returning the raw models.providers key so downstream dispatch can match the inline entry. It worked when the custom provider config included an explicit api field (because the !apiOwner guard passed), but returned null when api was absent — causing parseModelRef to run instead, which calls normalizeProviderId and collapses the key.

For a user-configured provider named kimi-code (which normalizeProviderId maps to the built-in kimi alias), this silently routed cron-nested lane dispatches to the kimi-coding extension rather than the user's inline config entry. The extension only knows its own models, not the user's custom kimi-for-coding entry, producing FailoverError: Unknown model: kimi/kimi-for-coding.

The same provider/model ref worked in the agent/embedded lane because that lane's model was already recorded in the session entry from a prior successful interactive run — it bypassed resolveCronModelSelection entirely.

Fix

Detect when the raw lowercased provider key and its normalizeProviderId result differ (hasKeyAliasCollision). If they differ, the user named their custom provider after a built-in alias and we must preserve the raw key regardless of whether an api field is present. The existing api-based guard is kept for providers where the key and its normalized form are identical (no collision risk).

Dispatch-time findInlineModelMatch already normalizes both sides with normalizeProviderId when doing its provider comparison, so it correctly matches the inline entry via the user's raw key.

Files changed

  • src/agents/model-selection-shared.ts — add hasKeyAliasCollision check to resolveExactConfiguredProviderRef
  • src/agents/model-selection.test.ts — two regression tests: api-present and api-absent collision cases
  • CHANGELOG.md — entry for #76155

Tests

Tests  221 passed (221)

oxlint: 0 warnings, 0 errors on changed files.

Fixes #76155.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/model-selection-shared.ts (modified, +15/-3)
  • src/agents/model-selection.test.ts (modified, +104/-0)

Code Example

{
  "id": "kimi-code/kimi-for-coding",
  "name": "kimi-for-coding",
  "api": "anthropic-messages",
  "reasoning": false,
  ...
}

---

{
  "agents": {
    "defaults": {
      "model":     { "primary": "kimi-code/kimi-for-coding", "fallbacks": [...] },
      "subagents": { "model": { "primary": "kimi-code/kimi-for-coding" } }
    }
  },
  "plugins": { "entries": { "active-memory": { "config": { "model": "kimi-code/kimi-for-coding" } } } }
}

---

2026-05-01T19:02:52.004 [agent/embedded] phase=attempt-dispatch totalMs=14872
  model-resolution=7030ms  attempt-dispatch=3285ms

---

[diagnostic] lane task error: lane=cron-nested durationMs=23445
  error="FailoverError: Unknown model: kimi/kimi-for-coding"

[model-fallback/decision] decision=candidate_failed
  requested=kimi/kimi-for-coding candidate=kimi/kimi-for-coding
  reason=model_not_found next=openai-codex/gpt-5.5
  detail=Unknown model: kimi/kimi-for-coding

---

curl -H "Authorization: Bearer $KEY" \
     -H "User-Agent: KimiCLI/1.5" \
     -H "Content-Type: application/json" \
     -d '{"model":"kimi-for-coding","messages":[{"role":"user","content":"hi"}],"max_tokens":20,"thinking":{"type":"disabled"}}' \
     https://api.kimi.com/coding/v1/chat/completions
RAW_BUFFERClick to expand / collapse

[Bug] cron-nested lane mis-resolves hyphen-prefixed provider aliases on 2026.4.29

Summary

The cron-nested lane's model resolver mis-handles aliases of the form <provider-with-hyphen>/<model> (e.g., kimi-code/kimi-for-coding), producing a stripped/different alias and reporting Unknown model. The same alias resolves correctly in the agent/embedded lane. This blocks any cron from using a provider whose name contains a hyphen.

Environment

  • OpenClaw CLI: 2026.4.29 (a448042)
  • Node.js: v22.22.2
  • macOS: Darwin 25.3.0 (Mac Mini, Apple Silicon)
  • Service shape: native LaunchAgent ai.openclaw.gateway via gateway install --force --wrapper
  • Provider in question: kimi-code (Kimi For Coding subscription endpoint, https://api.kimi.com/coding/v1, api: anthropic-messages)

Repro

In ~/.openclaw/agents/main/agent/models.json, a provider kimi-code exists with a model entry:

{
  "id": "kimi-code/kimi-for-coding",
  "name": "kimi-for-coding",
  "api": "anthropic-messages",
  "reasoning": false,
  ...
}

In ~/.openclaw/openclaw.json:

{
  "agents": {
    "defaults": {
      "model":     { "primary": "kimi-code/kimi-for-coding", "fallbacks": [...] },
      "subagents": { "model": { "primary": "kimi-code/kimi-for-coding" } }
    }
  },
  "plugins": { "entries": { "active-memory": { "config": { "model": "kimi-code/kimi-for-coding" } } } }
}

Each cron job's payload.model set to "kimi-code/kimi-for-coding".

Expected behavior

kimi-code/kimi-for-coding resolves consistently across all dispatch lanes. Verified working on the agent/embedded lane:

2026-05-01T19:02:52.004 [agent/embedded] phase=attempt-dispatch totalMs=14872
  model-resolution=7030ms  attempt-dispatch=3285ms

Observed behavior

When a cron fires (lane=cron-nested), the resolver requests a stripped alias kimi/kimi-for-coding (note: the -code suffix on the provider name has been removed):

[diagnostic] lane task error: lane=cron-nested durationMs=23445
  error="FailoverError: Unknown model: kimi/kimi-for-coding"

[model-fallback/decision] decision=candidate_failed
  requested=kimi/kimi-for-coding candidate=kimi/kimi-for-coding
  reason=model_not_found next=openai-codex/gpt-5.5
  detail=Unknown model: kimi/kimi-for-coding

The string kimi/kimi-for-coding does not appear anywhere in openclaw.json, cron/jobs.json, or models.json at the time of the failure. It is being constructed by the resolver itself when it processes the kimi-code/kimi-for-coding alias.

Workarounds attempted (all failed)

  1. Renamed provider kimi-codekimicode (no hyphen) in models.json + updated all references. The cron-nested lane still produced kimi/kimi-for-coding requests. So the bug is not strictly hyphen-related — there's a deeper alias-normalization step in cron-nested that doesn't honor the modern alias.

  2. Cleared payload.model from all crons so they inherit agents.defaults.model.primary. Crons still mis-resolve because they go through cron-nested.

  3. Added agents.defaults.models["kimi-code/kimi-for-coding"] registry entry. No effect on cron-nested resolution.

  4. Added a model entry with id: "kimi/kimi-for-coding" to the legacy kimi provider. The custom entry was stripped on next gateway bootstrap (related to issue #73607 — agents.defaults.models[].params and similar custom additions are wiped on restart). So I couldn't even register the alias the cron-nested lane was producing.

What works

Reverting cron payload.model to the legacy alias kimi/kimi-code (the only alias registered on the legacy kimi provider — its model entry has id: "kimi-code"). Cron-nested can resolve this. Slow (reasoning: true on legacy entry → 100-150 s first-token), but functional.

Companion: direct API verification

The Kimi For Coding endpoint itself is fast when called correctly. From the same machine:

curl -H "Authorization: Bearer $KEY" \
     -H "User-Agent: KimiCLI/1.5" \
     -H "Content-Type: application/json" \
     -d '{"model":"kimi-for-coding","messages":[{"role":"user","content":"hi"}],"max_tokens":20,"thinking":{"type":"disabled"}}' \
     https://api.kimi.com/coding/v1/chat/completions

Returns in 1.3 seconds. The K2.6 backend is fast when thinking: disabled is sent.

Asks

  1. Make the cron-nested lane's model resolver use the same alias-resolution path as agent/embedded, so both lanes accept kimi-code/kimi-for-coding.
  2. Stop stripping custom additions to models.json providers/models on bootstrap (related to #73607).
  3. Document the canonical alias format expected for hyphen-prefixed providers — if there's a sanctioned shape, surface it in the model-providers docs.

Sources / supporting context

extent analysis

TL;DR

The cron-nested lane's model resolver should be updated to handle hyphen-prefixed provider aliases correctly, allowing it to resolve kimi-code/kimi-for-coding without stripping the provider name.

Guidance

  • Verify that the kimi-code provider and its model entry kimi-for-coding are correctly configured in models.json and openclaw.json.
  • Check if there are any alias-normalization steps in the cron-nested lane that can be updated to honor the modern alias format.
  • Consider adding a custom registry entry for the kimi-code/kimi-for-coding alias to see if it resolves the issue.
  • Review the related upstream issues (e.g., #73607) to ensure that custom additions to models.json providers/models are not being stripped on bootstrap.

Example

No code snippet is provided as the issue seems to be related to configuration and alias resolution rather than code.

Notes

The issue seems to be specific to the cron-nested lane and its model resolver. The agent/embedded lane resolves the alias correctly, suggesting that the issue is not with the provider or model configuration.

Recommendation

Apply a workaround by using the legacy alias kimi/kimi-code for cron jobs until the cron-nested lane's model resolver is updated to handle hyphen-prefixed provider aliases correctly. This will allow crons to resolve the model, although it may have performance implications due to the legacy entry having reasoning: true.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

kimi-code/kimi-for-coding resolves consistently across all dispatch lanes. Verified working on the agent/embedded lane:

2026-05-01T19:02:52.004 [agent/embedded] phase=attempt-dispatch totalMs=14872
  model-resolution=7030ms  attempt-dispatch=3285ms

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug] cron-nested lane mis-resolves hyphen-prefixed provider aliases on 2026.4.29 [1 pull requests, 1 comments, 2 participants]