[Feature] Add a provider self-test command (kimi provider test <id>)

Đang mở
#5,125 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend-api-design, cli

Hướng nghiên cứu

Start by reading the existing kimi doctor and kimi provider command entry points mentioned in the issue to see how commands validate configuration and handle provider operations. Then trace how provider requests, streaming, usage, tool calls, and thinking settings are represented. Done means the command supports the requested checks and stable --json output, with tests covering the reported provider failures.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What feature would you like to see?

Add a provider self-test command:

kimi provider test <providerId> [--model <alias>] [--json]

It should send a minimal request (one non-streaming call and one streaming call, plus one tiny tool call when the model declares tool_use) and report:

  • transport and auth: base URL, protocol, HTTP status, headers the server rejects;
  • streaming behavior: whether chunks arrive, whether a finish event / finish_reason is present, whether the stream ends cleanly;
  • usage shape: which fields the provider returns (prompt_tokens / input_tokens / cached_tokens / cachedContentTokenCount / usage), and whether the provider reports cached-token counts at all;
  • tool calling: whether tool-call arguments stream correctly and are complete at finish_reason;
  • thinking: whether reasoning can be disabled, and which effort values the provider accepts;
  • a short verdict with a suggested fix for common failures (missing custom header, unknown model id, invalid effort, non-conforming usage).

--json should return the same data as a stable object suitable for CI.

Additional information

Why this is worth adding: configuring a non-managed provider currently requires guessing a lot of protocol details. In this week's real setup work, four separate problems each took a manual probe to diagnose:

  1. a gateway required an x-opencode-session header and returned 400 MissingSessionID without it;
  2. a model alias with a [1M] suffix was rejected while the base model id worked;
  3. a Gemini model always reasons, and sending thinking off produced 400 ... thinking cannot be turned off. Choose a concrete thinking effort;
  4. the provider's usageMetadata had no cachedContentTokenCount, which silently disables Kimi's measured token accounting and feeds issue #5064 (auto-compaction sees a message-only estimate).

kimi doctor currently validates config.toml / tui.toml syntax only, and kimi provider only supports add/remove/list/catalog. A provider-level request test would turn each of those into a one-command diagnosis, and would also make it obvious when a provider cannot report cached tokens (which changes compaction behavior).

I checked the tracker for provider health/connection tests and found no existing request. I understand external feature PRs are not accepted; I am only proposing the feature and can provide reproductions or output-format suggestions if the team picks it up.

Ngôn ngữ chính
TypeScript
Star
8.3k
Fork
1.4k
Merge trung bình
12 giờ 6 phút
Pull request đã merge (30 ngày)
596

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MoonshotAI/kimi-code

Tất cả issue của MoonshotAI/kimi-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.