Meta: quota exhaustion reports need per-request usage in wire logs to be actionable
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 15/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start in loopService.ts around dynamicTools (about line 638 for normal turns, 861 for operation requests) and operationTools() (about line 658), and compare how the compaction request resolves its tools block with a normal turn. The open question is which tool-resolution approach to use, and the issue is still awaiting maintainer approval. Done means the compaction request keeps the same tools block as a normal turn, so the cached prefix is reused, and the wire log records the per-request fields the issue describes.
索引モデルが issue の本文から書いたものです。
説明
Several reports describe quota being consumed faster than expected. Grouping them here because they need the same kind of evidence to become actionable, and because at least one of them has a measured cause we can fix.
Primary: #679, #3948, #3781, #3926. All are still open.
One measured case
#4935 records a compaction with 941,639 input tokens and only 26,368 cached (2.8%). The reporter's controlled follow-up found the cause: with a tool allowlist active, a normal request sends about 40 tool definitions but the compaction request sends 30, and cache hits drop from 98.1% to 2.6%. Tool definitions sit at the front of a request, so a change there invalidates the cached prefix for the system prompt and everything after it — extra billable input on every compaction.
The other reports lack the data to say what happened. #679 reports 26 interactions in 90 seconds with two log lines and no reproduction steps. #3948 is a screenshot plus "does not follow instructions, wastes tokens". #3781 names 0.7.5 as a regression and asks whether context is being re-sent; #3926 reports a stuck turn followed by a 403. None of these can currently show whether the quota went to repeated requests, one uncached request, a changed tools block, or a request that never completed — and a maintainer cannot tell from the metadata either.
Proposed direction
We are preparing two changes and will share the full patch in a PR once this issue is approved:
- Keep the tools block stable across compaction. Normal turns resolve tools dynamically (
dynamicTools: true, loopService.ts:638), but operation requests default todynamicTools: false(loopService.ts:861) andoperationTools()(loopService.ts:658) filters a startup snapshot of tools — it can only remove, never add. That is why the compaction request ends up with a different tools block and breaks the cached prefix. The direction is to make the compaction request use the same tool resolution as a normal turn. We are still weighing a one-linedynamicTools: trueagainst having operation inherit the previous turn's exact tools snapshot; the trade-off is whether deferred-tool schemas leak into the operation, and will be resolved in the PR. - Make future reports self-evident. Add per-request fields to the wire log — turn and step ids, a hash of the tools block, cache hit count, and the step-end reason — so a report can show whether quota went to repeated requests, one uncached request, a changed tools block, or a request that never completed.
Full diffs, edge cases (deferred tools, allowlist changes, profile switches), and tests will come with the PR. We are deliberately not treating all four reports as one root cause: #4935 is proven, #3926 is plausibly the stuck-turn problem tracked separately, #679 and #3948 need logs before any conclusion, and #3781 needs a version-by-version comparison. A session-level spending cap is a product decision and is out of scope.
Request
Would a maintainer /approve this issue so we can open an external bug-fix PR linking it? We would scope the PR to the measured #4935 cache fix and the logging change, and leave the symptom-only reports for follow-up. Happy to wait for triage or narrow further if needed.
This is based on code audit and the reports linked above; I do not have a runnable checkout, so the test suite and a live A/B measurement will be part of the PR.
- 主要言語
- TypeScript
- スター
- 8.3k
- フォーク
- 1.4k
- 平均マージ
- 12時間 6分
- マージ済み PR(30日)
- 596
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MoonshotAI/kimi-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5539 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directories対応中かも @markankamaransheogarat-sys が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MoonshotAI/kimi-code#5256 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MoonshotAI/kimi-code#5062 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MoonshotAI/kimi-code#5057 ·
メンテナーはふだん 1 日以内に返信
MoonshotAI/kimi-code の issue をすべて見る
似ている issue
-
Add Alice&Botオープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
midnightntwrk/midnight-faucet-api#215 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanmiCoder/cc-haha#2034 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mobile prio:low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
digitalfabrik/entitlementcard#3324 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信