Persist session IDs across thread resume#29327
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa64660c0a
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9fe64fe5f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
A cold-resumed subagent kept its durable thread ID but could receive a new session ID, splitting one agent tree across multiple sessions after a restart.
Persist the root session ID in every rollout
SessionMeta, carry it through thread creation, and restore it before initializing the resumedSessionandAgentControl.Behavior
For a nested agent tree:
The child rollout stores:
After a cold resume, the child still belongs to root session
Rwhile its immediate parent remainsP. The integration coverage uses distinct values for all three IDs so it catches restoring the session fromparent_thread_id.Legacy rollouts
Previous rollouts have
idbut nosession_id.SessionMetaLinedeserialization treats a missingsession_idasid, keeping those files readable, listable, and resumable. When a legacy subagent is resumed through its root, that synthesized child ID no longer overrides the inherited root-scopedAgentControl. New rollouts always persist the explicit root session ID.