Skip to content

Defer environment disconnect notifications until recovery fails - #55401

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/d6dce5cc5264af29b6f993daa209b93102122e40
Oct 19, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Defer environment disconnect notifications until recovery fails

Why

A temporary exec-server transport loss could emit a thread environment disconnect notification while the session was still recovering.

What changed

  • Add EnvironmentConnectionState::Recovering for interrupted transports and pending session recovery.
  • Suppress thread lifecycle notifications during recovery, emit a connected notification after successful recovery, and report disconnection when recovery fails.
  • Ignore recovery callbacks from retired clients so they cannot overwrite the connection state during refresh.

Testing

Add coverage for fast and near-deadline recovery, recovery timeout, rejected session resume, and retired-client callbacks. Extend app-server coverage to verify one lifecycle notification per selected thread and usable environment/info after recovery.

## Why

A temporary exec-server transport loss could emit a thread environment disconnect notification while the session was still recovering.

## What changed

- Add `EnvironmentConnectionState::Recovering` for interrupted transports and pending session recovery.
- Suppress thread lifecycle notifications during recovery, emit a connected notification after successful recovery, and report disconnection when recovery fails.
- Ignore recovery callbacks from retired clients so they cannot overwrite the connection state during refresh.

## Testing

Add coverage for fast and near-deadline recovery, recovery timeout, rejected session resume, and retired-client callbacks. Extend app-server coverage to verify one lifecycle notification per selected thread and usable `environment/info` after recovery.

GitOrigin-RevId: d6dce5cc5264af29b6f993daa209b93102122e40
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/d6dce5cc5264af29b6f993daa209b93102122e40 branch from 4107fc0 to 431185b Compare October 19, 2026 22:55
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-19T22:55:55.608966Z 4107fc0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 431185b into main Oct 19, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/d6dce5cc5264af29b6f993daa209b93102122e40 branch October 19, 2026 22:55
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
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.

1 participant