[codex] Start the guardian child session when parent session is started#27982
Merged
Conversation
7e4332c to
274762d
Compare
274762d to
6aebfd0
Compare
dylan-hurd-oai
approved these changes
Jun 17, 2026
| warn!("failed to initialize guardian review session: {err:#}"); | ||
| } | ||
| })); | ||
| } |
Collaborator
There was a problem hiding this comment.
Non-blocking but we might also want to trigger this when a user switches permissions mid-thread
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.
Why
The first auto-review currently creates its Guardian child session on demand, adding avoidable latency before the review can begin. Creating the ordinary Guardian child during parent-session initialization lets that child use the existing session startup WebSocket prewarm before the first escalation. This does not introduce a Guardian-specific prewarm mechanism.
What changed
Sessionwhen a thread starts with auto-review enabled and an approval policy that routes to Guardiangenerate=falseprewarm requestBenchmark
I compared release builds against main. Each prompt first ran a non-escalated
sleep 3, then requested an escalated marker command.Guardian duration fell by 28.5% and Guardian TTFT fell by 33.5%. These measurements cover Guardian review latency; they do not measure parent thread-start latency.