chenhg5/cc-connect · warning
compress timed out
Error message
compress timed out
What it means
A manual (non-auto) /compress that does not reach idle within the compress timeout gives the user a localized "compress timed out" error; the engine cleans up interactive state and notifies queued messages they were dropped with this reason. Auto compresses stay silent on timeout.
Source
Thrown at core/engine.go:10554
case event, ok = <-events:
if !ok {
e.cleanupInteractiveState(sessionKey, state)
if !auto {
if len(textParts) > 0 {
e.send(p, replyCtx, strings.Join(textParts, ""))
} else {
e.reply(p, replyCtx, e.i18n.T(MsgCompressDone))
}
}
e.notifyDroppedQueuedMessages(state, fmt.Errorf("agent process exited during compress"))
return
}
case <-idleCh:
if !auto {
e.send(p, replyCtx, fmt.Sprintf(e.i18n.T(MsgError), "compress timed out"))
}
e.cleanupInteractiveState(sessionKey, state)
e.notifyDroppedQueuedMessages(state, fmt.Errorf("compress timed out"))
return
case <-e.ctx.Done():
return
}
if state.isStopped() {
return
}
if idleTimer != nil {
if !idleTimer.Stop() {
select {
case <-idleTimer.C:
default:
}
}
idleTimer.Reset(e.eventIdleTimeout)
}View on GitHub (pinned to 4000b2338a)
Solutions
- Retry /compress when the agent is idle; heavy load stretches completion past the timeout
- Increase the compress/idle timeout in config if your context sizes routinely need longer
- Use a faster provider/model for compression, or reduce history with /new before compressing
- Queued messages were dropped — re-send them after the compress completes or start a fresh session
Example fix
// before: default idle timeout too short for huge contexts [engine] compress_idle_timeout = "60s" // after: allow slow compressions to finish [engine] compress_idle_timeout = "300s"
Defensive patterns
Strategy: retry
Try / catch
if err indicates "compress timed out": wait until the agent is idle, then retry /compress with a larger configured timeout; warn users their queued messages were dropped.
Prevention
- Configure compress_idle_timeout generously relative to your typical context size
- Compress while the agent is idle, not while other tasks are running
- Prefer /new (fresh session) over compressing very large histories
- Re-send queued messages after a timeout since they are dropped by design
When it happens
Trigger: The `<-idleCh` case fires (no agent events for the idle window) while the compress is still in progress and auto=false: the compression prompt takes longer than the configured idle/timeout window, so the engine gives up.
Common situations: Very large conversation context making compression slow; slow model/provider endpoint; agent busy with other work so the idle heuristic fires early.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- agent process exited during compress
- session is closed
- session.resume timeout
- session.create timeout
- session is closed
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/a8e63edd8212ad63.
Report an issue: GitHub.