Skip to content

[FEATURE]: Allow disabling automatic session diff summarization #26035

@ualtinok

Description

@ualtinok

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Please add a config option to disable automatic session diff summarization during prompt processing.

For very long sessions, automatic SessionSummary.summarize(...) work can be expensive because it computes session/message diff metadata in the background during LLM turns. In the Electron desktop app, where the opencode server runs inside the app process, that background work can contribute to visible UI stalls during active prompts.

A config option such as:

{
  "session": {
    "summarize": false
  }
}

would let users opt out of this non-essential metadata when they prefer responsiveness over automatic diff summaries.

Local measurements on a large real database:

Database size: ~6.8 GB
Total rows:

  • message: ~247k
  • part: ~1.04M

Long session A:
~21.8k messages
~76.1k parts
part JSON size: ~230 MB
full message/part walk + JSON parse: ~3.1s

Long session B:
~35.3k messages
~123.6k parts
full message/part walk + JSON parse: ~5.9s

By comparison, compacted-tail prompt context reads were much smaller:

session A compacted scan: ~950 messages / ~3.3k parts, ~0.15s
session B compacted scan: ~250 messages / ~834 parts, ~0.014s

These are local lower-bound measurements of the DB/message hydration work, not full end-to-end prompt latency. The concern is that automatic session diff summarization currently needs broad session history access for metadata that is useful but not essential to completing an LLM turn.

Expected behavior:

Default behavior stays unchanged.

When disabled, opencode skips automatic session/per-message diff summarization during prompt processing.

Core prompt execution, compaction, title generation, tool calls, and revert behavior continue to work.

UI surfaces that depend on summary.diffs or session_diff may simply have no automatic diff metadata for new turns.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions