chenhg5/cc-connect · error

%s failed after %d retries: %w

Error message

%s failed after %d retries: %w

What it means

withTransientRetry exhaustion: the operation still failed with a transient error after maxTransientRetries attempts of exponential backoff with up to +25% jitter; the last error is wrapped for the caller.

Source

Thrown at platform/feishu/feishu.go:4232

		}
		// Add jitter: up to +25% of delay to spread out concurrent retries.
		jitter := time.Duration(rand.Int64N(int64(delay / 4)))
		actualDelay := delay + jitter
		slog.Warn(p.tag()+": transient error, retrying",
			"operation", operation,
			"attempt", attempt+1,
			"max_retries", maxTransientRetries,
			"delay", actualDelay,
			"error", lastErr,
		)
		select {
		case <-ctx.Done():
			return fmt.Errorf("%s: %s retry cancelled: %w (last error: %v)", p.tag(), operation, ctx.Err(), lastErr)
		case <-time.After(actualDelay):
		}
		delay = min(delay*2, transientRetryMaxDelay)
	}
	return fmt.Errorf("%s failed after %d retries: %w", operation, maxTransientRetries, lastErr)
}

// ── Issue #1618: fail-closed + supervised retry for bot open_id ──
//
// When the Feishu/Lark bot-info API call fails at startup (transient
// proxy/VPN/DNS outage, server hiccup, etc.), the bot's open_id stays
// unknown. The previous behaviour read this as "group mention filter
// off", so the bot would reply to every group message for the rest of
// the process lifetime — a 3h10m window in the user's incident where
// the bot suddenly became a loud responder with no way for operators
// to notice. The functions below:
//
//   - wrap the initial fetch in transient retry so most startup
//     failures self-heal before we degrade,
//   - mark the filter as "degraded" (rather than "off") when the
//     retry budget is exhausted, with timestamp + last error captured
//     for /status surface,
//   - start a background supervisor that retries every

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Check Feishu API status/incidents and rate limits (429)
  2. Increase retry budget or reduce call frequency
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at platform/feishu/feishu.go:4232 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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