You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on a proof-of-concept feature for long-running Codex sessions:
Opt-in automatic fresh-session handoff after repeated context compactions, with a children-only mode for roots that have live subagents.
The idea is simple:
Let users opt in with auto_new_session_after_compactions = N.
After N live compactions, Codex asks the current thread to prepare a handoff prompt and continues in a fresh replacement session.
Keep internal sessions out of the feature.
Preserve the active persisted goal in replacement sessions.
If a root has live thread-spawn subagents, optionally keep the root running and let only child subagents hand off to replacement child threads.
That last part matters for multi-agent workflows: replacing the root while it is coordinating live children can disrupt the parent/child lifecycle. Replacing child subagents independently is less disruptive and still refreshes their context.
The branch includes implementation, tests, generated schema updates, and docs. I attempted to open a PR, but GitHub returned a CreatePullRequest permission error, and the contributing guide says feature proposals should start as issues unless a PR is invited.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have been working on a proof-of-concept feature for long-running Codex sessions:
Opt-in automatic fresh-session handoff after repeated context compactions, with a children-only mode for roots that have live subagents.
The idea is simple:
auto_new_session_after_compactions = N.Nlive compactions, Codex asks the current thread to prepare a handoff prompt and continues in a fresh replacement session.That last part matters for multi-agent workflows: replacing the root while it is coordinating live children can disrupt the parent/child lifecycle. Replacing child subagents independently is less disruptive and still refreshes their context.
Fork branch:
Compare view:
The branch includes implementation, tests, generated schema updates, and docs. I attempted to open a PR, but GitHub returned a
CreatePullRequestpermission error, and the contributing guide says feature proposals should start as issues unless a PR is invited.Maintainer-facing proposal issue:
I am especially interested in feedback from people running long sessions or subagent-heavy workflows:
Beta Was this translation helpful? Give feedback.
All reactions