Support asynchronous command hooks - #37533
Merged
copyberry[bot] merged 1 commit intoAug 8, 2026
Merged
Conversation
## Why Hook configurations can mark command handlers as asynchronous, but Codex previously skipped those handlers outside `SessionEnd`. ## What changed - Run asynchronous command hooks in the background with a per-session concurrency limit, while keeping `SessionEnd` hooks synchronous. - Prevent asynchronous hooks from blocking, stopping, rewriting, or otherwise controlling the operation that launched them. - Deliver warnings and additional context at safe turn boundaries: inject results into an active turn after sampling, or buffer them ahead of the next user prompt when the session is idle. - Preserve in-flight hooks across configuration reloads, scope spilled output to the thread, and abort outstanding work during session shutdown. ## Testing Add unit and integration coverage for background scheduling, concurrency, output parsing, active and idle result delivery, configuration reloads, and shutdown cleanup. GitOrigin-RevId: 8094552e4afe7b47b09a61bb575bb20f4e491d8d
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/8094552e4afe7b47b09a61bb575bb20f4e491d8d
branch
from
August 8, 2026 04:25
aa29579 to
6f647ca
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/8094552e4afe7b47b09a61bb575bb20f4e491d8d
branch
August 8, 2026 04:26
ganigeorgiev
temporarily deployed
to
issue-triage
August 8, 2026 04:36 — with
GitHub Actions
Inactive
ganigeorgiev
temporarily deployed
to
issue-triage
August 8, 2026 04:36 — with
GitHub Actions
Inactive
ganigeorgiev
temporarily deployed
to
issue-triage
August 8, 2026 04:36 — with
GitHub Actions
Inactive
ganigeorgiev
temporarily deployed
to
issue-triage
August 8, 2026 04:37 — with
GitHub Actions
Inactive
Michael-WhiteCapData
temporarily deployed
to
issue-triage
August 8, 2026 04:49 — with
GitHub Actions
Inactive
Michael-WhiteCapData
temporarily deployed
to
issue-triage
August 8, 2026 04:49 — with
GitHub Actions
Inactive
Michael-WhiteCapData
temporarily deployed
to
issue-triage
August 8, 2026 04:49 — with
GitHub Actions
Inactive
Michael-WhiteCapData
temporarily deployed
to
issue-triage
August 8, 2026 04:50 — with
GitHub Actions
Inactive
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Support asynchronous command hooks
Why
Hook configurations can mark command handlers as asynchronous, but Codex previously skipped those handlers outside
SessionEnd.What changed
SessionEndhooks synchronous.Testing
Add unit and integration coverage for background scheduling, concurrency, output parsing, active and idle result delivery, configuration reloads, and shutdown cleanup.