fix(intercom): retry transient read failures#6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens live Intercom “read” operations during backfills by adding opt-in retry behavior for transient failures and increasing the live CLI timeout to better tolerate slow/unhealthy provider responses.
Changes:
- Increased the live CLI HTTP client timeout from 30s to 90s.
- Added opt-in retry support in the Intercom client for request timeouts and HTTP 5xx responses (while leaving 429 handling to the syncer’s rate-limit retry layer).
- Added a synthetic test to verify recovery from a transient 502 during conversation search.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/intercom/client.go | Adds configurable retry attempts + backoff for timeouts and 5xx, with proper body handling between attempts. |
| internal/intercom/client_test.go | Adds coverage ensuring a 502 on the first request is retried and succeeds on the next attempt. |
| internal/cli/cli.go | Increases live HTTP timeout and enables Intercom client retries for live sync runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Harden live Intercom reads against transient provider/network failures seen during a 90d backfill attempt.
Changed
Risks
Verification
go test ./internal/intercom ./internal/syncer ./internal/cli./scripts/verify$HOME/.agents/skills/codex-review/scripts/codex-review --mode localclean after the 429 retry layering fixComplexity
Reduced for operators: live backfills can survive transient provider failures without adding tenant-specific wrapper behavior.
Summary by cubic
Add opt-in retries for transient Intercom read failures and increase the live CLI HTTP timeout to 90s. This improves backfill resilience against timeouts and 5xx errors while keeping 429 handling unchanged.
MaxAttemptsandRetryBackoff(CLI sets 3 attempts, 2s backoff).Written for commit 0931d71. Summary will update on new commits. Review in cubic