openclaw - ✅(Solved) Fix Bug: `kimi` provider config defaults to `anthropic-messages` instead of `openai-completions` [1 pull requests, 5 comments, 3 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#61379Fetched 2026-04-08 02:59:13
View on GitHub
Comments
5
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×5cross-referenced ×1referenced ×1

PR fix notes

PR #62155: fix(kimi-coding): change default API from anthropic-messages to openai-completions

Description (problem / solution / changelog)

Summary

  • Problem: Kimi API is OpenAI-compatible, not Anthropic-compatible. The previous default caused tool calls to fail with malformed output (e.g. raw <|tool_calls_section_begin|> markers leaking to users).
  • Why it matters: Tool calls were broken for Kimi-coding users, showing raw markers instead of proper tool execution.
  • What changed: Changed API type from "anthropic-messages" to "openai-completions", updated baseUrl to include /v1/, updated all related tests.
  • What did NOT change (scope boundary): No changes to other providers or core agent logic.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #61379
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause: Wrong API type configured - Kimi uses OpenAI-compatible API, not Anthropic.
  • Missing detection / guardrail: N/A
  • Contributing context (if known): API compatibility mismatch.

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: kimi-coding extension tests
  • Scenario the test should lock in: Tool calls work correctly with OpenAI-compatible API.
  • Why this is the smallest reliable guardrail: Tests verify the API configuration.
  • Existing test that already covers this (if any): All 10 kimi-coding tests pass.
  • If no new test is added, why not: N/A - configuration fix.

User-visible / Behavior Changes

List user-visible changes (including defaults/config). If none, write None.

Tool calls now work correctly with Kimi-coding instead of showing raw markers.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

N/A

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No - same API, correct endpoint)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node.js
  • Model/provider: Kimi K2.5
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Steps

  1. Use kimi-coding model
  2. Execute a tool call
  3. Verify no raw markers leak to user

Expected

Tool calls execute cleanly.

Actual

Fixed - tool calls work correctly.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: Tool calls work with Kimi
  • Edge cases checked: N/A
  • What you did not verify: N/A

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes - fixes broken behavior)
  • Config/env changes? (No - internal default change)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

None

Changed files

  • extensions/kimi-coding/implicit-provider.test.ts (modified, +1/-1)
  • extensions/kimi-coding/onboard.ts (modified, +1/-1)
  • extensions/kimi-coding/provider-catalog.test.ts (modified, +2/-2)
  • extensions/kimi-coding/provider-catalog.ts (modified, +2/-2)
  • extensions/kimi-coding/stream.test.ts (modified, +5/-5)
  • src/agents/pi-embedded-runner.anthropic-tool-replay.live.test.ts (modified, +1/-1)
  • src/plugins/loader.test.ts (modified, +2/-2)
  • src/plugins/loader.ts (modified, +2/-2)

Code Example

"kimi": {
  "baseUrl": "https://api.kimi.com/coding/",
  "api": "anthropic-messages"
}
RAW_BUFFERClick to expand / collapse

Describe the bug When using OpenClaw's configuration modification feature to add/configure kimi, it incorrectly sets the API format to anthropic-messages in openclaw.json.

Expected behavior Kimi's API format is OpenAI-compatible, so it should default to openai-completions (or openai-messages).

Current configuration output:

"kimi": {
  "baseUrl": "https://api.kimi.com/coding/",
  "api": "anthropic-messages"
}

Reported via user.

extent analysis

TL;DR

Manually updating the api field in the openclaw.json file to openai-completions or openai-messages may resolve the issue.

Guidance

  • Verify the current configuration by checking the openclaw.json file for the incorrect api setting.
  • Update the api field under the kimi configuration to either openai-completions or openai-messages to match Kimi's API format.
  • Test the configuration modification feature again to ensure it correctly sets the API format.
  • If the issue persists, investigate if there are any other configurations or settings that might be overriding the manual update.

Example

"kimi": {
  "baseUrl": "https://api.kimi.com/coding/",
  "api": "openai-completions"
}

Notes

This solution assumes that the openclaw.json file is the correct place to configure the API format for Kimi and that updating this file will be reflected in the configuration modification feature.

Recommendation

Apply workaround: Manually update the api field in the openclaw.json file, as this directly addresses the incorrect setting and allows for testing of the configuration modification feature with the correct API format.

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…

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: `kimi` provider config defaults to `anthropic-messages` instead of `openai-completions` [1 pull requests, 5 comments, 3 participants]