Bug Report: Session Becomes Extremely Slow in v1.37.0
Summary
After upgrading to kimi-cli v1.37.0, a specific session becomes extremely slow (several seconds per token, even loading animation is laggy), while other sessions and the CLI itself remain fast.
Environment
- OS: Windows 10/11
- kimi-cli version: 1.37.0 (upgraded from 1.30.0)
- Python: 3.13.3
- Model: kimi-code/kimi-for-coding
Problem Description
Symptoms
- Token generation is extremely slow (several seconds per token)
- Loading animation stutters/lags
- Only affects one specific session; other sessions work fine
kimi --version responds instantly (not a system performance issue)
Session Details
The affected session was used for:
- MATLAB development (7R robotic arm kinematics)
- Bayesian optimization tasks
- Multiple background MATLAB training jobs
Investigation Results
We performed extensive debugging:
-
Context files: Cleaned from 66MB → 63KB (99.9% reduction)
- Deleted all
context_X.jsonl files
- Cleared
wire.jsonl
- No improvement
-
Task logs: Cleaned from ~60MB → 2MB (96% reduction)
- Cleared huge
output.log files (44MB, 10MB, 4MB)
- No improvement
-
Additional directories: Removed from state.json
- Removed
D:\Document\code\Matlab\7Rmatlab from additional_dirs
- No improvement
-
AGENTS.md files: Temporarily renamed 3 large AGENTS.md files in project
- Total ~22KB of project documentation
- No improvement
-
Moved entire MATLAB directory: Eliminated any file scanning issues
Key Finding: Encoding Corruption
In context.jsonl, we found encoding corruption:
{"role":"user","content":"���"} // Should be "你好"
The file contains invalid UTF-8 sequences, suggesting encoding issues during session persistence.
Current Session State
context.jsonl: 109 lines, ~63KB
state.json: 1.5KB
wire.jsonl: ~23KB (cleared)
- Tasks directory: ~2MB (cleaned)
- Total: Well under normal limits
Reproduction Steps
- Create a session with extensive MATLAB/technical work
- Run multiple background tasks that generate large outputs
- Upgrade from v1.30.0 to v1.37.0
- Resume the session
- Observe extreme slowness in token generation
Expected Behavior
Session should remain responsive regardless of history, or provide tools to properly clean/reset session without losing core state.
Actual Behavior
Session becomes unusably slow despite all cleanup efforts.
Workaround
Downgrading to v1.30.0 resolves the issue (confirmed by user).
Additional Context
- The session was working fine in v1.30.0
- Only this specific session is affected; other sessions work normally
- System resources are normal (CPU 13-19%, plenty of RAM)
Possible Causes
- v1.37.0 streaming/rendering changes: New version may have introduced performance regression with certain session states
- Encoding handling: Corrupted UTF-8 in context.jsonl may cause parsing overhead
- Background task scanning: Even with cleaned logs, task metadata scanning may be inefficient
Attachments
N/A (session contains sensitive project data)
Checklist
Bug Report: Session Becomes Extremely Slow in v1.37.0
Summary
After upgrading to kimi-cli v1.37.0, a specific session becomes extremely slow (several seconds per token, even loading animation is laggy), while other sessions and the CLI itself remain fast.
Environment
Problem Description
Symptoms
kimi --versionresponds instantly (not a system performance issue)Session Details
The affected session was used for:
Investigation Results
We performed extensive debugging:
Context files: Cleaned from 66MB → 63KB (99.9% reduction)
context_X.jsonlfileswire.jsonlTask logs: Cleaned from ~60MB → 2MB (96% reduction)
output.logfiles (44MB, 10MB, 4MB)Additional directories: Removed from
state.jsonD:\Document\code\Matlab\7Rmatlabfromadditional_dirsAGENTS.md files: Temporarily renamed 3 large AGENTS.md files in project
Moved entire MATLAB directory: Eliminated any file scanning issues
Key Finding: Encoding Corruption
In
context.jsonl, we found encoding corruption:{"role":"user","content":"���"} // Should be "你好"The file contains invalid UTF-8 sequences, suggesting encoding issues during session persistence.
Current Session State
context.jsonl: 109 lines, ~63KBstate.json: 1.5KBwire.jsonl: ~23KB (cleared)Reproduction Steps
Expected Behavior
Session should remain responsive regardless of history, or provide tools to properly clean/reset session without losing core state.
Actual Behavior
Session becomes unusably slow despite all cleanup efforts.
Workaround
Downgrading to v1.30.0 resolves the issue (confirmed by user).
Additional Context
Possible Causes
Attachments
N/A (session contains sensitive project data)
Checklist