You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Malformed KIMI_LOG_* limits are applied by prefix (10MB becomes 10 bytes) #4324
Kimi Code subscription. The bug happens while the logging config is read, before any provider or model is used.
Which model were you using?
No response
What platform is your computer?
Linux x86_64
What issue are you seeing?
The numeric KIMI_LOG_* settings are read by their leading digits, so a malformed value is applied instead of ignored. KIMI_LOG_GLOBAL_MAX_BYTES=10MB resolves to 10 bytes, and 1024bytes resolves to 1,024 bytes, instead of the documented 6 MB default. The same parser handles KIMI_LOG_GLOBAL_FILES, KIMI_LOG_SESSION_MAX_BYTES and KIMI_LOG_SESSION_FILES.
A malformed value should be ignored so the documented default applies. A complete positive integer should keep working as it does now.
Additional information
parsePositiveInt in packages/agent-core-v2/src/_base/log/logConfig.ts uses Number.parseInt, which accepts a numeric prefix and drops the rest. The result goes straight to the rotating file writers in logService.ts and sessionLogService.ts. I have a small fix with a regression test and a changeset ready.
Contribution
I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)
Small follow-up: I have the fix ready on my fork (strict parsing for the numeric KIMI_LOG_* values, malformed input is ignored instead of applied by prefix, with a test for the cases above). Per the contributing guide I am waiting for a maintainer /approve here before opening the PR.
Activity
mertkayacs commentedon Oct 29, 2026
Small follow-up: I have the fix ready on my fork (strict parsing for the numeric
KIMI_LOG_*values, malformed input is ignored instead of applied by prefix, with a test for the cases above). Per the contributing guide I am waiting for a maintainer/approvehere before opening the PR.