automations: feat: add starter templates and clarify target selection - #334836
Conversation
Offer editable starter templates without silently inheriting a recent workspace. Explain workspace-specific agent choices while preserving saved provider-owned session configuration. Distinguish catalogue loading, readiness, unavailability, and errors across providers, storage, tools, and accessible UI. Keep usable local automation targets available when a remote host is offline, and preserve focus without stealing it after delayed updates. Include regression tests and visual fixtures for catalogue lifecycle, migration readability, target selection, and focus behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13c4c742-2729-4be4-819c-2adf8243f733
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It introduces a new cross-store contract (catalogueState) and rewires multiple UI and provider/migration paths, so it warrants final human review for correctness and UX regressions.
Review tier: Lite
Findings: None
What changed in this PR
Adds explicit catalogue-completeness state to Automations stores and uses it to improve the Agents Window Automations UX: showing starter templates for “no known automations yet”, differentiating “still loading / unavailable / error” from “confirmed empty”, and tightening target/workspace selection to avoid implicit Cloud binding.
Changes:
- Introduces provider-neutral
catalogueState(loading/ready/unavailable/error) for automation stores and aggregates it across sources. - Adds starter automation templates to the Automations view (with hovers + accessible view/help updates) and keeps creation available even when catalogues are incomplete.
- Updates automation dialog/workspace picker behavior to require explicit target selection and provide clearer guidance when only one agent is available.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/automations/automationService.ts | Adds AutomationCatalogueState and a shared state-combiner helper; extends IAutomationStore contract. |
| src/vs/workbench/contrib/chat/common/automations/automationDialogService.ts | Allows create-dialog initial values to omit/leave target undefined. |
| src/vs/sessions/contrib/sessions/browser/views/automationTemplates.ts | Adds localized starter template definitions (name/prompt/schedule). |
| src/vs/sessions/contrib/sessions/browser/views/automationsView.ts | Renders templates + empty/loading/unavailable/error states; preserves focus across transitions; adds full-text hovers for truncated template fields. |
| src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.ts | Updates accessibility help + accessible view content to reflect templates and catalogue completeness state. |
| src/vs/sessions/contrib/sessions/browser/media/automationsCards.css | Styles new state panels, partial-catalogue banner, and template cards (incl. HC borders). |
| src/vs/sessions/browser/parts/customViewNode.ts | Synchronizes native scroll/focus scrolling with the custom scrollbar implementation. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostAutomationStore.ts | Publishes catalogueState based on authoritative snapshot readiness + legacy readability; hardens migration readability checks. |
| src/vs/sessions/contrib/providers/agentHost/browser/reconnectableAgentHostAutomationStore.ts | Derives provider-neutral catalogueState across connection lifecycle; makes state transitions atomic via observable transactions. |
| src/vs/sessions/contrib/automations/browser/providerAutomationService.ts | Aggregates catalogueState across provider stores + legacy store; keeps initial aggregate loading until providers settle. |
| src/vs/sessions/contrib/automations/browser/automations.contribution.ts | Wires ProviderAutomationService with an initialProvidersSettled observable based on AfterRestored completion. |
| src/vs/sessions/contrib/automations/browser/automationService.ts | Adds catalogueState to legacy store, keeping last-known rows while reporting unreadable storage as error. |
| src/vs/sessions/contrib/automations/browser/automationTools.ts | Extends listAutomations tool output with catalogueState and updates modelDescription/toolResultMessage accordingly. |
| src/vs/sessions/contrib/automations/browser/media/automationDialog.css | Adds styling for the new target-hint row and action link. |
| src/vs/sessions/contrib/automations/browser/automationDialog.ts | Adds target hint logic + “Choose Workspace” action; hides target-dependent controls until a target exists. |
| src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts | Ensures restoration respects canRestoreWorkspace (and thus avoids unintended auto-selection when restoration is disabled). |
| src/vs/sessions/AUTOMATIONS.md | Documents the new catalogue availability contract and consumer expectations. |
| src/vs/sessions/contrib/sessions/test/browser/automationsView.test.ts | Adds extensive UI/a11y/focus tests for templates and catalogue-state transitions. |
| src/vs/sessions/contrib/sessions/test/browser/automationsView.fixture.ts | Adds fixture coverage for new empty/loading/unavailable/error/partial states across sizes/themes. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAutomationStore.test.ts | Adds tests for authoritative readiness, errors, legacy readability, reconnect behavior, and atomic state transitions. |
| src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts | Adds tests preventing implicit restore of cloud workspace when restoration is disabled; validates “No workspace” availability. |
| src/vs/sessions/contrib/automations/test/browser/providerAutomationService.test.ts | Adds tests for aggregate catalogue state, initial-provider settlement behavior, and ensuring local ops work with unavailable remote. |
| src/vs/sessions/contrib/automations/test/browser/automationTools.test.ts | Tests listAutomations catalogueState semantics and messaging for incomplete catalogues. |
| src/vs/sessions/contrib/automations/test/browser/automationService.test.ts | Expands coverage for legacy store catalogueState transitions and atomic publication on refresh/recovery. |
| src/vs/sessions/contrib/automations/test/browser/automationDialog.test.ts | Adds tests for target guidance messages across target/session-type scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Screenshot ChangesBase: Changed (2)3 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. Added (20) |
The badge cherry-pick calls catalogueState, but release/1.137 does not yet contain the catalogue API from #334836. Backport the required contract, aggregate readiness, legacy readability, and Agent Host lifecycle support without importing the templates UI. Include focused catalogue and migration regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e75f732-f18f-42a7-b1e2-a034c03596eb
…#334836) Offer editable starter templates without silently inheriting a recent workspace. Explain workspace-specific agent choices while preserving saved provider-owned session configuration. Distinguish catalogue loading, readiness, unavailability, and errors across providers, storage, tools, and accessible UI. Keep usable local automation targets available when a remote host is offline, and preserve focus without stealing it after delayed updates. Include regression tests and visual fixtures for catalogue lifecycle, migration readability, target selection, and focus behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13c4c742-2729-4be4-819c-2adf8243f733 (cherry picked from commit b6d68fb)
…334865) automations: feat: add starter templates and clarify target selection (#334836) Offer editable starter templates without silently inheriting a recent workspace. Explain workspace-specific agent choices while preserving saved provider-owned session configuration. Distinguish catalogue loading, readiness, unavailability, and errors across providers, storage, tools, and accessible UI. Keep usable local automation targets available when a remote host is offline, and preserve focus without stealing it after delayed updates. Include regression tests and visual fixtures for catalogue lifecycle, migration readability, target selection, and focus behavior. (cherry picked from commit b6d68fb) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13c4c742-2729-4be4-819c-2adf8243f733
Summary
Add starter automation templates to the Agents Window, make new automation targets explicit, and distinguish an incomplete catalogue from an empty one.
This is the reviewed and updated version of #334368, based on the provider-owned session-template architecture already merged in #334521.
Why
Automations are aggregated from legacy storage and local/remote providers. An empty array does not tell a consumer whether there are no automations, discovery is pending, or a provider is offline. Treating all of those situations alike either shows a misleading empty state or prevents a usable local target from being offered.
The new-automation dialog also restored a checked/recent workspace even though restoration from existing sessions was disabled. A remembered GitHub repository could therefore silently bind a template to Cloud. Cloud is legitimately the only agent for that workspace, but the disabled control did not explain how to choose a different target.
Changes
Templates and target selection
canRestoreWorkspacecallback during initial restoration, then opt out in the automation dialog without changing normal New Session defaults.Honest catalogue state
Expose observable
catalogueStateon automation stores:loadingreadyunavailableerrorerror > loading > unavailable > ready.readymay claim that there are no automations.{ catalogueState, automations }fromlistAutomations, preserving existing row fields and explaining incomplete results to the model.Storage, accessibility, and focus
Compatibility
Provider-owned
IAutomationSessionTemplateremains canonical, with opaque configuration preserved. Workspace trust, managed policy, and provider capabilities still govern drafts and runs. This does not introduce a scheduler, permission grant, AI setting, dependency, or persistence-schema change. Existing AI feature gating is preserved.Validation