Retry transient environment startup failures on the next turn (#57866)

## Why

A transient environment startup failure persisted across turns when the selected environment and workspace were unchanged, preventing commands from recovering after the executor became available.

## What changed

Retry failed environment resolution at the start of a new turn when the error is retryable and the workspace remains selected. Reuse healthy or pending resolutions and preserve provisioning failures until the selection is updated.

## Testing

Add coverage for command execution recovering on an unchanged next turn after endpoint availability is restored. Extend provisioning failure tests to verify that subsequent turns receive the original error without restarting resolution.

GitOrigin-RevId: b80af60990f30d277804160c9c39c286024c7667
This commit is contained in:
pansul47-oai
2026-10-29 00:42:21 +00:00
committed by copyberry
parent f276b82185
commit 4e2dfd2230
3 changed files with 252 additions and 14 deletions
+3 -5
View File
@@ -214,11 +214,9 @@ impl Session {
self.services
.turn_environments
.set_active_thread_defaults(configuration.inferred_environment_config());
if environments != self.services.turn_environments.selections() {
self.services
.turn_environments
.update_selections(&environments);
}
self.services
.turn_environments
.activate_selections(&environments);
}
self.services.turn_environments.snapshot()
};