[cherry-pick] automations: fix: preserve runs during host migration - #333539
Open
vs-code-engineering[bot] wants to merge 1 commit into
Open
[cherry-pick] automations: fix: preserve runs during host migration#333539vs-code-engineering[bot] wants to merge 1 commit into
vs-code-engineering[bot] wants to merge 1 commit into
Conversation
Ulugbek Abdullaev (ulugbekna)
approved these changes
Aug 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents Automation runs from becoming orphaned during migration to Agent Host ownership.
Changes:
- Defers ownership migration while runs are active and improves recovery handling.
- Repairs stale non-terminal archive entries using CAS-safe persistence.
- Adds telemetry distinctions and concurrency-focused regression tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
automationTelemetry.ts |
Adds deferred migration telemetry. |
automationService.ts |
Defines active-run migration errors. |
agentHostAutomationStore.test.ts |
Tests migration deferral and archive repair. |
reconnectableAgentHostAutomationStore.ts |
Logs active-run deferrals separately. |
agentHostAutomationStore.ts |
Enforces terminal history and repairs archives. |
providerAutomationService.test.ts |
Tests ownership and recovery races. |
automationService.test.ts |
Tests deferral error classification. |
providerAutomationService.ts |
Guards transfers and orders recovery before migration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Base:
|
roblourens
approved these changes
Aug 31, 2026
Member
|
Ulugbek Abdullaev (@ulugbekna) since we are now past endgame, does this need to still be taken in this release or can this flow into next week's release? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #333525 from
main.Summary
Fix Automation runs that can remain permanently shown as Working... after legacy definitions migrate to Agent Host ownership.
The affected state is a non-terminal legacy run copied into the read-only history archive without a session resource. Once ownership changes, neither the legacy runner nor the Agent Host owns that archived run's remaining lifecycle. Besides producing a non-clickable history row, it permanently occupies the Automation's active-run slot.
Changes
Lifecycle guarantees
Validation
agentHostAutomationStoreproviderAutomationServiceautomationServiceautomationSchedulernpm run typecheck-clientpassed.git diff --checkpassed.The cross-cutting Automations architecture specification will be submitted separately as a stacked documentation PR.