Permission logs serialize full ruleset JSON on every check, causing multi-GB log files
Description
Each permission check writes a log entry containing the complete
permission ruleset serialized via JSON.stringify(). A single ruleset
blob is ~37KB. With hundreds of permission checks per session (every tool
call, skill invocation, and task dispatch triggers one), a single session
log can exceed 12GB.
Log output example
INFO 2026-06-12T04:14:52 +2ms service=permission permission=task pattern=explore ruleset=[{...37KB JSON...}] INFO 2026-06-12T04:14:52 +3ms service=permission permission=task pattern=general ruleset=[{...same 37KB JSON...}] INFO 2026-06-12T04:14:52 +2ms service=permission permission=skill pattern=adapt ruleset=[{...same 37KB JSON...}]
Actual impact
2026-06-11T131945.log— 12.06 GB (385,866 lines)2026-06-12T041348.log— 4.79 GB (144,275 lines)- 122,053 out of 144,275 lines (85%) are
service=permissionentries - Two days of usage consumed 16.85 GB of disk space
Root cause
-
The permission module passes the full
rulesetarray as a log parameter on every check. The logger'sbuild()function callsJSON.stringify(value)on objects, serializing the entire ruleset each Root cause -
The permission module passes the full
rulesetarray as a log parameter on every check. The logger'sbuild()function callsJSON.stringify(value)on objects, serializing the entire ruleset each time. -
log.tshas no per-file size limit —createWriteStreamappends indefinitely. Thecleanup()function only caps the number of files (keep=10), not individual file size.
Suggested fix
-
Permission module: Stop logging the full
rulesetin every entry. Log only the decision metadata:permission,pattern,action, andresult. The ruleset content is static per session and doesn't need repeating. -
Log system: Add a per-file size cap (e.g., 50MB) with rotation. When the current log exceeds the limit, rotate to a new file and prune old ones.
Plugins
No response
OpenCode version
No response
Steps to reproduce
- Start a new session with MiMo-Code
- Perform any workflow that triggers multiple tool calls / skill invocations / task dispatches
- Check the log directory (e.g., ~/.mimo/logs/ or equivalent)
- Observe log files growing rapidly, with 85%+ lines being service=permission entries containing full ruleset JSON
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Serializing full ruleset JSON on every permission check is the exact pattern AgentAutopsy's Context Monitor flags — one repeated operation bloating storage/context unboundedly.
Fix: serialize only the diff or changed rules, not the full ruleset. Or cache the serialized form and invalidate on change.
Traced with AgentAutopsy: https://github.com/Abhisekhpatel/AgentAutopsy
solve