Repository navigation
fix(provider): discover current Kimi models - #6
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughKimi discovery now reads models from generic ACP configuration options, filters invalid entries, and falls back to legacy session state. Tests and fixtures cover K2.7, K3, custom models, and model-specific thinking options. Design and implementation plans document the behavior and validation steps. ChangesKimi model discovery
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ACP as ACP session setup
participant Provider as KimiProvider
participant Discovery as Capability discovery
ACP->>Provider: Return configOptions and session model state
Provider->>Provider: Normalize model selector values
Provider->>Discovery: Pass current and available models
Discovery->>ACP: Probe each discovered model
ACP-->>Discovery: Return model-specific thinking options
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/server/src/provider/Layers/KimiProvider.test.ts (1)
202-215: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover fallback when the model option has no usable values.
The helper also falls back when a model select exists but produces zero valid IDs. The current test only covers an absent model option. Add a case with a blank-only model option and legacy
models, then assert that the legacy state is returned. This protects the branch inapps/server/src/provider/Layers/KimiProvider.ts, Lines 176-186.As per coding guidelines: backend behavior changes require focused tests for the changed behavior.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server/src/provider/Layers/KimiProvider.test.ts` around lines 202 - 215, The existing test only covers an absent model option; extend the Kimi model-state tests with a case where the model option contains only blank or unusable values alongside legacy models. Assert that kimiModelStateFromSessionSetup returns the legacy currentModelId and availableModels, covering the zero-valid-ID fallback branch.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/superpowers/plans/2026-08-12-kimi-model-discovery.md`:
- Around line 95-96: Update every documented pnpm command in the plan, including
the commands near the referenced test and later validation steps, to run through
a login shell configured with Node 24 or to explicitly prepend the Node 24
binary path. Ensure all JavaScript and TypeScript repository commands use Node
24.13.1 or compatible.
In `@docs/superpowers/specs/2026-08-12-kimi-model-discovery-design.md`:
- Around line 27-35: The design scope in
docs/superpowers/specs/2026-08-12-kimi-model-discovery-design.md lines 27-35
must explicitly decide the adapter status for Codex, Claude, Cursor, Grok, and
OpenCode, marking each unchanged or deliberately unsupported. Mirror the same
adapter decision matrix in
docs/superpowers/plans/2026-08-12-kimi-model-discovery.md lines 21-32, including
corresponding verification coverage.
---
Nitpick comments:
In `@apps/server/src/provider/Layers/KimiProvider.test.ts`:
- Around line 202-215: The existing test only covers an absent model option;
extend the Kimi model-state tests with a case where the model option contains
only blank or unusable values alongside legacy models. Assert that
kimiModelStateFromSessionSetup returns the legacy currentModelId and
availableModels, covering the zero-valid-ID fallback branch.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a0f36be-f2d1-4ab3-ac4b-ad975c53b00c
📒 Files selected for processing (4)
apps/server/src/provider/Layers/KimiProvider.test.tsapps/server/src/provider/Layers/KimiProvider.tsdocs/superpowers/plans/2026-08-12-kimi-model-discovery.mddocs/superpowers/specs/2026-08-12-kimi-model-discovery-design.md
|
Review fixes pushed in 2f08d0c. Added the blank-only model-option fallback case requested in the nitpick; focused Kimi tests now pass 11/11, including the live installed-CLI ACP probe. Server typecheck exits 0 on Node v24.14.0. |
Kimi appeared without any default models in T3 Code, which also hid model-specific thinking controls and the official Highspeed choice.
Kimi Code CLI 0.29.1 moved model discovery from the legacy ACP
modelsfield to a genericmodelconfig option. T3 only read the legacy field, so the authenticated CLI's catalog was discarded before the provider snapshot reached web, desktop, or mobile.This change normalizes the generic ACP model option at the Kimi provider boundary, falls back to legacy model state for older CLIs, and reuses the existing bounded per-model probe. The picker now follows the installed CLI and account: K2.7 Coding, K2.7 Coding Highspeed, K3, and K3-256k on the current managed catalog. K3 model switches expose the CLI-advertised Low, High, and Max thinking levels. Highspeed remains an official model rather than a synthetic toggle.
Verification:
pnpm exec vp test run apps/server/src/provider/Layers/KimiProvider.test.ts apps/server/src/provider/acp/KimiAcpCliProbe.test.tswithT3_KIMI_ACP_PROBE=1— 10 tests passed, including the installed Kimi CLI 0.29.1 handshakepnpm exec vp run --filter t3 typecheck— exit 0 (pre-existing Effect suggestions only)git diff --check fork/main...HEADImplemented with GPT-5.6-sol through the Codex harness in T3 Code.
Summary by CodeRabbit
New Features
Bug Fixes