Repository navigation
fix(usage): Kimi 사용량 조회에서 Kimi CLI 위장 헤더 제거 - #358
Merged
Merged
Conversation
- fetchKimiUsage가 `User-Agent: KimiCLI/1.5`, `X-Msh-Platform: kimi_cli`, `X-Msh-Version: 1.5` 대신 다른 USAGE 공급자처럼 `User-Agent: omk`만 보낸다. - 실제 endpoint(`GET https://api.kimi.com/coding/v1/usages`)는 OAuth 토큰과 kimi-coding 키 모두 두 헤더 조합에서 200과 같은 응답 구조(limits, usages)를 돌려줬다. - 테스트: 보내는 헤더 검사 추가. providers 문서, CHANGELOG 갱신.
Owner
Author
|
OMK Community Thanks for opening this pull request. Mention Automated response. No code changes or merges are performed. |
dmae97
commented
Nov 6, 2026
dmae97
left a comment
Owner
Author
There was a problem hiding this comment.
a5dada7ba57d49e20241987da47a984de4ba6294의 4개 변경 파일과 호출 경로를 검토했습니다. 병합을 막을 문제는 찾지 못했습니다.
- Kimi 사용량 조회의 식별 헤더만 바뀌며, OAuth와 API 키 모두 같은
fetchKimiUsage를 사용합니다. 고정 endpoint, 인증, 파싱, 실패 시 표시와 추론 요청은 그대로입니다. - 회귀 테스트가
User-Agent: omk와 두X-Msh-*헤더의 부재를 검사하고, 사용량 파싱 결과도 유지합니다. 문서와 변경 이력도 이 범위와 맞습니다. - CI run 42190504384의 secret-scan과 build/check/test가 모두 통과했습니다. 검사 대상 merge
caba9ae의 부모는 현재 mainf977108과 이 head입니다.
이 head는 병합 가능한 것으로 검토했습니다. 이번 검토는 소스와 CI 결과 확인이며, 로컬 테스트나 실제 Kimi API 호출을 새로 실행한 것은 아닙니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
Kimi 사용량 조회(
GET https://api.kimi.com/coding/v1/usages)가 Kimi CLI인 척하던 헤더를 없앱니다.User-Agent: KimiCLI/1.5,X-Msh-Platform: kimi_cli,X-Msh-Version: 1.5User-Agent: omk만 보냅니다. Command Code, OpenCode Go, xAI 같은 다른 USAGE 공급자와 같은 방식입니다.packages/ai의 Kimi 추론 요청 헤더(KimiCLI/1.5)는 건드리지 않았습니다.docs/providers.md,CHANGELOG.md(Changed).원래 체크아웃의 미커밋 작업에 섞여 있던 변경입니다. 앞선 PR들의 범위 밖이라 따로 올립니다.
검증 (로컬, 커밋 a5dada7)
subscription-usage.test.ts에 보내는 헤더 검사 추가: 구현 전에는expected 'KimiCLI/1.5' to be 'omk'로 실패, 구현 후 통과npx vitest --run: provider-usage,loadSubscriptionUsage, KIMI를 다루는 8개 파일, 238개 통과npx tsgo --noEmit,npx biome check --error-on-warnings .,check:module-size,check:import-cycles,check:ts-imports,check:doc-links,check:feature-claims,check:release-surfacekimi-codeOAuth 토큰과kimi-coding키로 이전과 이후 헤더 조합을 각각 한 번씩 보냈습니다. 네 경우 모두 HTTP 200이었고, 응답 최상위 키도limits,usages로 같았습니다. 키와 응답 본문은 기록하지 않았습니다.usage unavailable이 표시됩니다.