Skip to content

Keep long chats responsive by cooling older tool output#160

Open
dnouri wants to merge 1 commit intomasterfrom
optimize-redisplay-pressure
Open

Keep long chats responsive by cooling older tool output#160
dnouri wants to merge 1 commit intomasterfrom
optimize-redisplay-pressure

Conversation

@dnouri
Copy link
Owner

@dnouri dnouri commented Mar 11, 2026

Long chats with lots of read, write, and edit output were getting heavier to use.

This keeps recent tool turns rich and interactive, but cools older completed tool output into a cheaper preview-only history form. Old history stays readable and still shows a plain ... (N more lines) hint.

The ghost tool block cleanup bug was split out and merged already in #161. This PR now focuses only on long-session responsiveness.

Long pi-coding-agent sessions had started to punish the user for having
used the tool successfully.  As read, write, and edit output accumulated,
Emacs had more and more rich tool rendering to redisplay and refontify,
until ordinary typing in the input buffer began to feel unnecessarily
heavy.

This change takes the pressure off without making old history disappear
or become misleading.  Recent completed tool turns remain rich and fully
interactive, because that is the part of the conversation the user is
still actively working with.  Older completed tool output cools
automatically at stable boundaries into a cheaper preview-only form.
That cold form keeps the tool header, the visible preview, and the
"... (N more lines)" clue, but it drops the hot-only overlay machinery
and syntax-tagged rendering that were making long sessions expensive.

The result is a simpler and more honest transcript: recent history stays
alive, old history stays readable, and long-running sessions stop
getting slower simply because they contain a lot of successful tool use.
Reloading or resuming a session rebuilds the same hot/cold tail, and the
default budget is tuned from real sessions so normal short conversations
do not cool prematurely.
@dnouri dnouri force-pushed the optimize-redisplay-pressure branch from 54966af to 0182d0e Compare March 11, 2026 23:51
@dnouri dnouri changed the title Keep long tool-heavy sessions responsive without losing useful history Keep long chats responsive by cooling older tool output Mar 12, 2026
@dnouri
Copy link
Owner Author

dnouri commented Mar 12, 2026

Small note: the ghost tool block cleanup bug was intentionally split out and merged already in #161. This PR is now just the long-session responsiveness change: keep recent tool output rich, and cool older completed tool output into a cheaper preview-only history form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant