Skip to content

Fix idle cleanup for disconnected multi-agent v2 children - #52081

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

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Fix idle cleanup for disconnected multi-agent v2 children

Why

Persisted multi-agent v2 children created after the client disconnects need lifecycle listeners so their runtimes can be released once idle. Listener attachment must also wait for an earlier runtime's cleanup to finish.

What changed

  • Start lifecycle listeners for persisted v2 children even when no initialized clients are connected, and defer attachment until pending unload cleanup completes.
  • Keep ephemeral children loaded so follow-up tasks retain their model context.
  • Raise the default thread_unload_delay_secs from 60 seconds to 1800 seconds (30 minutes), updating the configuration documentation and sample.

Testing

Add regression coverage for children spawned after disconnect with zero- and one-second unload delays, including waiting for pending cleanup, keeping running threads loaded, releasing idle runtimes, and preserving an ephemeral child's earlier reply across a follow-up. Update configuration tests for the new default and explicit overrides.

## Why

Persisted multi-agent v2 children created after the client disconnects need lifecycle listeners so their runtimes can be released once idle. Listener attachment must also wait for an earlier runtime's cleanup to finish.

## What changed

- Start lifecycle listeners for persisted v2 children even when no initialized clients are connected, and defer attachment until pending unload cleanup completes.
- Keep ephemeral children loaded so follow-up tasks retain their model context.
- Raise the default `thread_unload_delay_secs` from 60 seconds to 1800 seconds (30 minutes), updating the configuration documentation and sample.

## Testing

Add regression coverage for children spawned after disconnect with zero- and one-second unload delays, including waiting for pending cleanup, keeping running threads loaded, releasing idle runtimes, and preserving an ephemeral child's earlier reply across a follow-up. Update configuration tests for the new default and explicit overrides.

GitOrigin-RevId: 2fecc77b5c03237aa8fd7eacc4bd119b99d36e0a
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Note

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/2fecc77b5c03237aa8fd7eacc4bd119b99d36e0a branch from a61caee to 2fdf047 Compare October 8, 2026 11:52
@copyberry
copyberry Bot merged commit 2fdf047 into main Oct 8, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/2fecc77b5c03237aa8fd7eacc4bd119b99d36e0a branch October 8, 2026 11:52
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2026
@Soki-Fuchi
Soki-Fuchi deployed to issue-triage October 8, 2026 11:59 — with Image GitHub Actions Active
@Soki-Fuchi
Soki-Fuchi deployed to issue-triage October 8, 2026 11:59 — with Image GitHub Actions Active
@Soki-Fuchi
Soki-Fuchi deployed to issue-triage October 8, 2026 11:59 — with Image GitHub Actions Active
@Jpunturi
Jpunturi deployed to issue-triage October 8, 2026 12:03 — with Image GitHub Actions Active
@Jpunturi
Jpunturi deployed to issue-triage October 8, 2026 12:03 — with Image GitHub Actions Active
@Jpunturi
Jpunturi deployed to issue-triage October 8, 2026 12:03 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:05 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:05 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:05 — with Image GitHub Actions Active
@maybejeb
maybejeb deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@maybejeb
maybejeb deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@maybejeb
maybejeb deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:08 — with Image GitHub Actions Active
@tapperwijn89
tapperwijn89 deployed to issue-triage October 8, 2026 12:09 — with Image GitHub Actions Active
@ckevinjones
ckevinjones deployed to issue-triage October 8, 2026 12:14 — with Image GitHub Actions Active
@ckevinjones
ckevinjones deployed to issue-triage October 8, 2026 12:14 — with Image GitHub Actions Active
@ckevinjones
ckevinjones deployed to issue-triage October 8, 2026 12:14 — with Image GitHub Actions Active
@WeMakeThose
WeMakeThose deployed to issue-triage October 8, 2026 12:22 — with Image GitHub Actions Active
@WeMakeThose
WeMakeThose deployed to issue-triage October 8, 2026 12:22 — with Image GitHub Actions Active
@Akiba275
Akiba275 deployed to issue-triage October 8, 2026 12:26 — with Image GitHub Actions Active
@meteop-x
meteop-x deployed to issue-triage October 8, 2026 12:26 — with Image GitHub Actions Active
@meteop-x
meteop-x deployed to issue-triage October 8, 2026 12:26 — with Image GitHub Actions Active
@meteop-x
meteop-x deployed to issue-triage October 8, 2026 12:26 — with Image GitHub Actions Active
@chudthai
chudthai deployed to issue-triage October 8, 2026 12:29 — with Image GitHub Actions Active
@chudthai
chudthai deployed to issue-triage October 8, 2026 12:29 — with Image GitHub Actions Active
@chudthai
chudthai deployed to issue-triage October 8, 2026 12:29 — with Image GitHub Actions Active
@DmitrL-dev
DmitrL-dev deployed to issue-triage October 8, 2026 12:37 — with Image GitHub Actions Active
@DmitrL-dev
DmitrL-dev deployed to issue-triage October 8, 2026 12:37 — with Image GitHub Actions Active
@DmitrL-dev
DmitrL-dev deployed to issue-triage October 8, 2026 12:37 — with Image GitHub Actions Active
@DmitrL-dev
DmitrL-dev deployed to issue-triage October 8, 2026 12:38 — with Image GitHub Actions Active
@hptdev92
hptdev92 deployed to issue-triage October 8, 2026 12:41 — with Image GitHub Actions Active
@hptdev92
hptdev92 deployed to issue-triage October 8, 2026 12:41 — with Image GitHub Actions Active
@hptdev92
hptdev92 deployed to issue-triage October 8, 2026 12:41 — with Image GitHub Actions Active
@hptdev92
hptdev92 deployed to issue-triage October 8, 2026 12:42 — with Image GitHub Actions Active
@Kregnach
Kregnach deployed to issue-triage October 8, 2026 12:43 — with Image GitHub Actions Active
@Kregnach
Kregnach deployed to issue-triage October 8, 2026 12:43 — with Image GitHub Actions Active
@Kregnach
Kregnach deployed to issue-triage October 8, 2026 12:43 — with Image GitHub Actions Active
@Golrokhsarv
Golrokhsarv deployed to issue-triage October 8, 2026 13:02 — with Image GitHub Actions Active
@Golrokhsarv
Golrokhsarv deployed to issue-triage October 8, 2026 13:02 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 2fdf047c Deployed Oct 8, 2026 by juanfranca via Identify potential duplicates (all issues) #53161
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.