Description
I had a very large file (+200MB) sucked into my opencode session.
Then I ran multiple sub agents that somehow also pulled it into their sessions causing a ballooning memory issue.
The file was technically json, but wasn't something that opencode touched or modified. It was generated by a tool and I was deleting it.
Doing some digging and it appears that the file was sucked in by Snapshot.diffFull
Tangentially related to this is that all sub-agent sessions are fully loaded into a main session when you reload. So when I close and reload my session it immediately balloons back up even tho most of the large diff elements are residing in the sub-agent sessions.
Plugins
None
OpenCode version
issue exists on dev branch
Steps to reproduce
- have a large text blob (you can generate one by doing export heap snapshot in opencode)
- send one message
- delete large text blob
- see memory footprint increase
- can also do the same thing with sub agents too multiply the issue
Screenshot and/or share link
No response
Operating System
macOS
Terminal
iterm2
Description
I had a very large file (+200MB) sucked into my opencode session.
Then I ran multiple sub agents that somehow also pulled it into their sessions causing a ballooning memory issue.
The file was technically json, but wasn't something that opencode touched or modified. It was generated by a tool and I was deleting it.
Doing some digging and it appears that the file was sucked in by
Snapshot.diffFullTangentially related to this is that all sub-agent sessions are fully loaded into a main session when you reload. So when I close and reload my session it immediately balloons back up even tho most of the large diff elements are residing in the sub-agent sessions.
Plugins
None
OpenCode version
issue exists on dev branch
Steps to reproduce
Screenshot and/or share link
No response
Operating System
macOS
Terminal
iterm2