Skip to content

Back off automatic remote control reconnects with jitter - #50348

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e
Oct 2, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Back off automatic remote control reconnects with jitter

Why

Closed WebSocket connections previously triggered immediate reconnects, and successful handshakes reset backoff even when connections were short-lived.

What changed

  • Delay automatic reconnects before token refresh or enrollment, and report Connecting while waiting.
  • Use exponential backoff with jitter between half and all of the delay, starting at 5 seconds and capped at 30 seconds.
  • Retain backoff across short-lived connections and reset it after a connection lasts at least 60 seconds.
  • Interrupt the reconnect delay on shutdown, auth owner invalidation, or enable/disable changes, including an immediate disable/enable pair.

Testing

Add connection tests for delayed token refresh, backoff retention and reset, explicit re-enabling, and prompt shutdown. Update retry tests to check jitter bounds, saturation during sustained failures, and backoff retention after a successful handshake.

## Why

Closed WebSocket connections previously triggered immediate reconnects, and successful handshakes reset backoff even when connections were short-lived.

## What changed

- Delay automatic reconnects before token refresh or enrollment, and report `Connecting` while waiting.
- Use exponential backoff with jitter between half and all of the delay, starting at 5 seconds and capped at 30 seconds.
- Retain backoff across short-lived connections and reset it after a connection lasts at least 60 seconds.
- Interrupt the reconnect delay on shutdown, auth owner invalidation, or enable/disable changes, including an immediate disable/enable pair.

## Testing

Add connection tests for delayed token refresh, backoff retention and reset, explicit re-enabling, and prompt shutdown. Update retry tests to check jitter bounds, saturation during sustained failures, and backoff retention after a successful handshake.

GitOrigin-RevId: 0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e branch from e488a9c to 9d2b603 Compare October 2, 2026 16:06
@copyberry
copyberry Bot merged commit 9d2b603 into main Oct 2, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e branch October 2, 2026 16:06
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
@MeroZemory
MeroZemory deployed to issue-triage October 2, 2026 16:13 — with GitHub Actions Active
@MeroZemory
MeroZemory deployed to issue-triage October 2, 2026 16:13 — with GitHub Actions Active
@MeroZemory
MeroZemory deployed to issue-triage October 2, 2026 16:13 — with GitHub Actions Active
@MeroZemory
MeroZemory deployed to issue-triage October 2, 2026 16:14 — with GitHub Actions Active
@tscho-tscho
tscho-tscho deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active
@tscho-tscho
tscho-tscho deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active
@tscho-tscho
tscho-tscho deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active
@blkaka66
blkaka66 deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active
@blkaka66
blkaka66 deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active
@blkaka66
blkaka66 deployed to issue-triage October 2, 2026 16:31 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 9d2b6030 Deployed Oct 2, 2026 by blkaka66 via Translate non-English issue #16956
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants