Skip to content

Finish idle thread unloads after slow shutdown - #51420

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/18c411f86fd69e710e472a4e3572d75f18682147
Oct 6, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Finish idle thread unloads after slow shutdown

Why

Idle thread unloading stopped waiting after ten seconds, leaving the thread loaded when resource cleanup took longer.

What changed

Keep awaiting the same shutdown future after the ten-second deadline, emitting codex.app_server.thread_shutdown_slow as a warning. Once shutdown completes, remove the thread and send thread/closed without requiring another unload request.

Testing

Add a regression test that blocks writer-lock cleanup past the warning deadline, verifies the thread remains loaded while cleanup is blocked, then releases the lock and checks for thread/closed and an empty loaded-thread list.

## Why

Idle thread unloading stopped waiting after ten seconds, leaving the thread loaded when resource cleanup took longer.

## What changed

Keep awaiting the same shutdown future after the ten-second deadline, emitting `codex.app_server.thread_shutdown_slow` as a warning. Once shutdown completes, remove the thread and send `thread/closed` without requiring another unload request.

## Testing

Add a regression test that blocks writer-lock cleanup past the warning deadline, verifies the thread remains loaded while cleanup is blocked, then releases the lock and checks for `thread/closed` and an empty loaded-thread list.

GitOrigin-RevId: 18c411f86fd69e710e472a4e3572d75f18682147
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/18c411f86fd69e710e472a4e3572d75f18682147 branch from bf30b4b to 946bb6c Compare October 6, 2026 17:10
@copyberry
copyberry Bot merged commit 946bb6c into main Oct 6, 2026
1 check passed
@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-06T17:10:33.164811Z bf30b4b 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 deleted the copyberry/codex-internal-to-codex-oss/18c411f86fd69e710e472a4e3572d75f18682147 branch October 6, 2026 17:10
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 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