fix(compaction): tolerate slow summarizers and show live chat activity - #1115
Merged
chen-ran merged 2 commits intoSep 4, 2026
Merged
Conversation
The automatic compaction path injected the interactive non-streaming client, whose 30s ResponseHeaderTimeout is far below the summarizer's measured cold TTFB (60-93s on ~110k-token inputs): every automatic pass died with 'timeout awaiting response headers' while manual /compact, which never set a client, survived on the SDK default. Compaction now uses its own transport with a 3m header deadline; interactive non-streaming chat keeps the 30s policy. Claude-Session: https://claude.ai/code/session_01BQNmA3AKE3nh6AnArrG54g
chen-ran
force-pushed
the
fix/compaction-summarizer-client
branch
from
September 4, 2026 18:28
74ce732 to
2c69db9
Compare
chen-ran
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic context compaction used the interactive HTTP client's 30-second response-header timeout, which could abort a healthy summarizer before its first response. Compaction now uses a dedicated client with a 3-minute header timeout and a 10-minute overall cap; interactive chat retains its existing timeout.
Long compactions also left chat users without visible feedback. The composer now shows a localized “Compacting context…” shimmer while manual or automatic compaction runs, and removes it when the work ends. It reuses the existing composer panel and reduced-motion styling.
The existing bot activity stream carries permission-filtered compaction snapshots on connection, on state changes, and with its heartbeat. Manual requests show feedback immediately and are deduplicated by bot/session. Reconnection replaces stale activity, and older frontends safely ignore the new event. Activity reflects the connected server process, consistent with the existing in-process event hub.
Validation:
go test -race ./internal/agent/context/compaction ./internal/handlers ./cmd/agent ./cmd/internal/corepassed.go test ./...and Go lint.mise run lintpassed.