Skip to content

fix(kimi): export declared effort ladder and default to Kimi Code - #8126

Merged
lidge-jun merged 7 commits into
devfrom
fix/8095-kimi-code-efforts
Nov 3, 2026
Merged

lidge-jun merged 7 commits into
devfrom
fix/8095-kimi-code-efforts

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Kimi Code integration writes one [models."opencodex/<model>"] block per routed model, but buildKimiClientConfig() never read the model's declared effort ladder. A routed model such as kimi/k3.1-pro (reasoningEfforts: ["low","high","max"], defaultReasoningEffort: "low") was exported with no support_efforts, no default_effort and no thinking capability. Kimi Code cannot infer those from a routed name, so it offered no thinking-effort selection even though the proxy accepts reasoning_effort for that model. The DSH exporter already maps the same metadata.

The Kimi block now carries it, following Kimi Code's documented model fields:

  • support_efforts: the declared ladder, limited to Kimi Code's levels (low, medium, high, xhigh, max) in that order. OpenCodex-only values such as ultra are dropped, because Kimi Code fails validation on an unknown level.
  • default_effort: only when the declared default is in that exported ladder, since Kimi requires it to be a member.
  • capabilities gains thinking only when a ladder is exported; image_in is unchanged.
  • An empty, unknown or entirely unsupported ladder emits none of these fields, so nothing is invented. Context window, display name and image handling are unchanged.

Before: capabilities = ["image_in"], no effort fields.
After: capabilities = ["thinking", "image_in"], support_efforts = ["low", "high", "max"], default_effort = "low".

Closes #8095

Verification

  • bun test tests/config/client-config-kimi-efforts.test.ts: 6 pass, 0 fail. With the src/ change stashed: 3 pass, 3 fail (the ladder/default, the filtering and the TOML round-trip cases).
  • bun test tests/config/client-config-kimi-efforts.test.ts tests/config/client-config-new-clients.test.ts tests/config/client-config-export-new-clients.test.ts tests/clients/ tests/ci-workflows/file-size-ratchet.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 2572 pass, 0 fail.
  • tests/server/management-client-config-route.test.ts asserted Kimi capabilities were exactly ["image_in"] for Anthropic models, which declare an effort ladder and now also get thinking. That assertion now checks that image_in is present (52 pass).
  • bun run typecheck, bun run privacy:scan: pass.
  • NOT RUN: bun run test:changed and the full bun run test, because the host is shared with several full-suite lanes. Left to CI. Note that test 2/4 is currently red on dev itself: tests/server/server-combo-required-tool-contract.test.ts fails from fix(responses): scope tool authority to current turn #8027 onward, unrelated to this change.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (The integration docs list only the file path and format, so nothing to update.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • New Features
    • Kimi Code configuration exports now include supported reasoning effort levels and a valid default effort. Thinking and image-input capabilities are included when applicable.
  • Bug Fixes
    • Unsupported or unavailable effort levels are omitted from exports, along with defaults that aren’t supported.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 3, 2026 07:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T07:07:13.459029Z 656f878 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 236f060 and 7b79cad.

Files selected for processing: 7
  • docs-site/src/content/docs/guides/providers.md
  • scripts/test-layout/layout.json
  • src/clients/config-export.ts
  • structure/clients/integrations.md
  • tests/config/client-config-kimi-efforts.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/server/management-client-config-route.test.ts
Walkthrough

The Kimi Code exporter now emits supported reasoning-effort levels and a matching default when declared. It adds the thinking capability when valid effort levels exist and retains image_in when image input is declared.

Changes: Kimi effort export

Layer / File(s) Summary
Project effort metadata
src/clients/config-export.ts:63, 977-1003, 1199-1210, tests/config/client-config-kimi-efforts.test.ts:1-51, tests/server/management-client-config-route.test.ts:208, structure/clients/integrations.md:274, scripts/test-layout/layout.json:544, tests/fixtures/test-layout-expected.json:568
The exporter filters effort metadata to Kimi’s supported levels and emits a default only when it matches that list. Tests cover filtering, capabilities, and TOML round-tripping. Documentation and test-layout mappings reflect the updated export.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ExportModel
  participant buildKimiClientConfig
  participant TOMLSerialization
  ExportModel->>buildKimiClientConfig: declared reasoning efforts and default
  buildKimiClientConfig->>buildKimiClientConfig: filter effort levels and build capabilities
  buildKimiClientConfig->>TOMLSerialization: generated Kimi config
  TOMLSerialization-->>buildKimiClientConfig: serialized TOML
Loading
Merge Risk: Low · previous review 236f0

The change is mergeable with bounded follow-up: malformed hand-edited effort metadata can prevent Kimi configuration export, and the provider guide needs updating.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(kimi): export declared effort ladder and default to Kimi Code" matches the main change. The changeset adds support_efforts and default_effort export for Kimi Code model blocks, emits th…
Linked Issues check Passed Issue #8095 is directly linked and has coding requirements. In src/clients/config-export.ts (the KimiEffort/kimiEfforts code near lines 986-1000), the exporter reads reasoningEfforts and `defa…
Out of Scope Changes check Passed The changes stay within issue #8095. The source change implements Kimi effort metadata and the related capability. The new focused tests and the management-route assertion update verify the changed be…
Full details: Title check

Explanation

The title "fix(kimi): export declared effort ladder and default to Kimi Code" matches the main change. The changeset adds support_efforts and default_effort export for Kimi Code model blocks, emits thinking capability when a ladder is exported, and adds tests covering these behaviors. The title is specific, concise, and single-sentence, and it names the Kimi scope and the effort-ladder and default behavior.

Full details: Linked Issues check

Explanation

Issue #8095 is directly linked and has coding requirements. In src/clients/config-export.ts (the KimiEffort/kimiEfforts code near lines 986-1000), the exporter reads reasoningEfforts and defaultReasoningEffort, filters to Kimi Code's documented levels, orders and de-duplicates the result, and emits default_effort only when the default is in that result. The build path near lines 1196-1210 adds thinking only when support_efforts exists and preserves the existing context, display-name, and image_in behavior. Empty, undeclared, unsupported-only, and explicitly unsupported reasoning cases emit no effort fields or thinking capability. tests/config/client-config-kimi-efforts.test.ts covers ladder/default export, filtering, ordering, omission cases, capability behavior, and TOML round-trip behavior. The test update in tests/server/management-client-config-route.test.ts preserves the image capability assertion while allowing the new thinking capability.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #8095. The source change implements Kimi effort metadata and the related capability. The new focused tests and the management-route assertion update verify the changed behavior. The documentation row in structure/clients/integrations.md records the Kimi export contract. The test-layout files register the new test. No unrelated product behavior, context handling, display-name handling, or image handling was changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f7c2d32 and 236f060.

Files selected for processing: 6
  • scripts/test-layout/layout.json
  • src/clients/config-export.ts
  • structure/clients/integrations.md
  • tests/config/client-config-kimi-efforts.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/server/management-client-config-route.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 656f87891a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/clients/config-export.ts Resolved

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread src/clients/config-export.ts Resolved
Comment thread src/clients/config-export.ts Resolved
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (account lidge-jun) at head 7b79cad6c4d77864357a6d4f3df1490542cb2784.

Resolves #8095.

@lidge-jun
lidge-jun merged commit 363c0a1 into dev Nov 3, 2026
30 checks passed
@lidge-jun
lidge-jun deleted the fix/8095-kimi-code-efforts branch November 3, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant