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

  1. Retry /compress when the agent is idle; heavy load stretches completion past the timeout
  2. Increase the compress/idle timeout in config if your context sizes routinely need longer
  3. Use a faster provider/model for compression, or reduce history with /new before compressing
  4. 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

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.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/a8e63edd8212ad63. Report an issue: GitHub.