mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Support pending environment attachment configuration (#38684)
## Why An environment connection can be available before its owner has supplied the configuration for a particular thread attachment. Threads need to start without blocking while ensuring turns do not use that attachment prematurely. ## What changed - Accept `Pending` environment configuration and resolve each attachment only after both its shared executor connection and owner configuration are ready. - Add a `Failed` configuration state and `environment_failed` callback so an owner can fail one thread's attachment without affecting other threads. - Keep pending and failed attachments out of capability-root inspection and turn environments, and allow failed attachments to recover through a ready update. - Apply owner configuration before waking a waiting turn so its permission profile, login-shell policy, capability roots, and tools are immediately consistent. ## Testing Add an integration test covering non-blocking thread startup, independent ready and failed callbacks, waiting-turn resumption, installed capability and tool configuration, and recovery from failure. GitOrigin-RevId: d587e2025d584c867d782d470b18bf5a1a27b76c
This commit is contained in:
@@ -717,6 +717,15 @@ impl CodexThread {
|
||||
self.session.environment_ready(selection, config).await
|
||||
}
|
||||
|
||||
/// Fails this thread's pending environment without affecting other attached threads.
|
||||
pub async fn environment_failed(
|
||||
&self,
|
||||
selection: &TurnEnvironmentSelection,
|
||||
error: String,
|
||||
) -> CodexResult<()> {
|
||||
self.session.environment_failed(selection, error).await
|
||||
}
|
||||
|
||||
/// Passively inspects the selected capability roots whose environments are ready now.
|
||||
pub fn inspect_selected_capability_roots(&self) -> SelectedCapabilityRootsStatus {
|
||||
self.session.inspect_selected_capability_roots()
|
||||
|
||||
Reference in New Issue
Block a user