Meta: quota exhaustion reports need per-request usage in wire logs to be actionable
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.3k
- Forks
- 1.4k
- Merge medio
- 12 h 6 min
- PR fusionados (30 d)
- 596
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MoonshotAI/kimi-code
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
MoonshotAI/kimi-code#5539 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directoriesPosiblemente ocupada @markankamaransheogarat-sys la tomó hace 2 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
MoonshotAI/kimi-code#5296 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MoonshotAI/kimi-code#5256 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MoonshotAI/kimi-code#5062 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
MoonshotAI/kimi-code#5057 ·
Los mantenedores suelen responder en 1 día
Todos los issues de MoonshotAI/kimi-code
Issues similares
-
Add Alice&BotAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
midnightntwrk/midnight-faucet-api#215 ·
Los mantenedores suelen responder en 1 día
-
[功能] 手机端命令执行显示 AI 动作描述Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NanmiCoder/cc-haha#2034 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
mobile prio:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
digitalfabrik/entitlementcard#3324 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día