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
Bug: SessionSummary runs on every processor finish-step and repeatedly loads full session history #21761
Tool-using sessions can freeze the TUI and drive multi-GB RSS growth because SessionSummary.summarize(...) is invoked on every assistant finish-step, and summarize() loads the full session history (Session.messages({ sessionID })) every time.
This creates a hot loop during multi-step agent execution:
prompt loop re-enters for normal tool-assisted execution
processor finish-step fires for each assistant model turn
processor calls SessionSummary.summarize(...)
summarize loads the full session history and hydrates all parts
memory spikes and repeats on every turn
Root Cause
Primary trigger
packages/opencode/src/session/processor.ts
Inside the finish-step event handler, the processor unconditionally calls:
Activity
github-actions commentedon Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
SessionSummary.summarize()only on the first step to avoid redundant per-step summary computation — same root fix as proposed heresjawhar commentedon Apr 9, 2026
Re: possible duplicates (#20302, #20285, #18136)
These are closely related, but not clean duplicates of #21761:
finish-stephandler callsSessionSummary.summarize()on every assistant turn, andsummarize()does a fullsessions.messages({ sessionID })load each time.So #21761 is the concrete root-cause bug report for one specific repeated full-history load path we traced with live diagnostics.
PR with fix: #21762
github-actions commentedon Jul 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.