-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[codex] Bind shell snapshots to retained thread environments #28421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,10 @@ use crate::agent::role::resolve_role_config; | |
| use crate::agent::status::is_final; | ||
| use crate::codex_thread::ThreadConfigSnapshot; | ||
| use crate::config::Config; | ||
| use crate::environment_selection::TurnEnvironmentSnapshot; | ||
| use crate::session::emit_subagent_session_started; | ||
| use crate::session_prefix::format_subagent_context_line; | ||
| use crate::session_prefix::format_subagent_notification_message; | ||
| use crate::shell_snapshot::ShellSnapshot; | ||
| use crate::thread_manager::ResumeThreadWithHistoryOptions; | ||
| use crate::thread_manager::ThreadManagerState; | ||
| use crate::thread_rollout_truncation::truncate_rollout_to_last_n_fork_turns; | ||
|
|
@@ -519,11 +519,11 @@ impl AgentControl { | |
| .ok_or_else(|| CodexErr::UnsupportedOperation("thread manager dropped".to_string())) | ||
| } | ||
|
|
||
| async fn inherited_shell_snapshot_for_source( | ||
| async fn inherited_environments_for_source( | ||
| &self, | ||
| state: &Arc<ThreadManagerState>, | ||
| session_source: Option<&SessionSource>, | ||
| ) -> Option<Arc<ShellSnapshot>> { | ||
| ) -> Option<TurnEnvironmentSnapshot> { | ||
| let Some(SessionSource::SubAgent(SubAgentSource::ThreadSpawn { | ||
| parent_thread_id, .. | ||
| })) = session_source | ||
|
|
@@ -532,13 +532,15 @@ impl AgentControl { | |
| }; | ||
|
|
||
| let parent_thread = state.get_thread(*parent_thread_id).await.ok()?; | ||
| let snapshot = parent_thread | ||
| .codex | ||
| .session | ||
| .services | ||
| .shell_snapshot | ||
| .load_full()?; | ||
| (!snapshot.is_failed()).then_some(snapshot) | ||
| Some( | ||
| parent_thread | ||
| .codex | ||
| .session | ||
| .services | ||
| .turn_environments | ||
| .snapshot() | ||
| .await, | ||
|
pakrym-oai marked this conversation as resolved.
Comment on lines
+540
to
+542
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This agent logic now inherits the parent Useful? React with 👍 / 👎. |
||
| ) | ||
| } | ||
|
|
||
| async fn inherited_exec_policy_for_source( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this warning wasn't worth the complexity of carrying it around