Skip to content

automations: feat: add starter templates and clarify target selection - #334836

Merged
Ulugbek Abdullaev (ulugbekna) merged 1 commit into
mainfrom
ulugbekna/agents/vscode-pr-334368-review
Sep 7, 2026
Merged

automations: feat: add starter templates and clarify target selection#334836
Ulugbek Abdullaev (ulugbekna) merged 1 commit into
mainfrom
ulugbekna/agents/vscode-pr-334368-review

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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

  • Add editable starter cards for issue triage, pull request review, dependency audit, and release notes.
  • Templates seed only name, prompt, and schedule; choosing one opens the existing dialog and does not create an automation.
  • Require an explicit workspace or No workspace choice for a new target-less dialog. Honor the shared picker's existing canRestoreWorkspace callback during initial restoration, then opt out in the automation dialog without changing normal New Session defaults.
  • Put workspace selection before the agent control, explain single-agent targets with a Choose Workspace action, and show the agent dropdown chevron when alternatives exist.
  • Hide worktree and session-configuration controls until there is a relevant target. Preserve explicit edit/duplicate targets and unavailable saved provider/type choices.
New automation before choosing a target Explicitly selected Cloud-only workspace
New automation asks for an explicit workspace or No workspace choice Cloud-only target explains the workspace restriction and offers Choose Workspace

Honest catalogue state

Expose observable catalogueState on automation stores:

State Meaning
loading Provider discovery or an authoritative snapshot is still in flight.
ready All participating sources are readable and the catalogue is complete.
unavailable A known provider is disconnected, disabled, or does not advertise automation support.
error A participating source could not be read or loaded.
  • Compose states with error > loading > unavailable > ready.
  • Settle initial discovery after AfterRestored contributions finish; provider-less windows then settle to their legacy-store state.
  • Retain known cards beside partial-catalogue warnings. Offer templates whenever there are no known cards, even if a remote catalogue is unavailable. Only ready may claim that there are no automations.
  • Keep operations routed to an independently usable local provider available regardless of aggregate completeness.
  • Return { catalogueState, automations } from listAutomations, preserving existing row fields and explaining incomplete results to the model.

Storage, accessibility, and focus

  • Publish legacy ledger readability and catalogue state with the corresponding definitions/runs. Include still-participating legacy sources in Agent Host projection state and recheck readability across asynchronous migration boundaries.
  • Match accessible help/text to the visible templates and catalogue state, and provide full-text hovers for truncated template names and prompts.
  • Preserve meaningful focus across view transitions; cancel delayed created-card focus after user navigation or blur instead of stealing focus later.
  • Synchronize native keyboard-focus scrolling with the custom view's scrollbar.

Compatibility

Provider-owned IAutomationSessionTemplate remains 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

  • 406 targeted Electron tests: automation storage, providers, tools, Agent Host stores, cards view, dialog, and workspace/agent pickers.
  • 29 targeted Chromium tests for target guidance and workspace/agent selection.
  • Additional native Chromium focus checks and catalogue/template fixture rendering during implementation.
  • Client type checking, targeted ESLint, CSS stylelint, and staged pre-commit hygiene. Stylelint reported only pre-existing token suggestions.
  • Isolated Code OSS verification: unbound new dialog, Cloud-only explanation, local Copilot/Claude/Codex choices, No workspace, keyboard focus restoration, preserved saved targets, and fresh dialogs remaining unbound.
  • All actual GitHub CI checks passed, including cross-platform tests, Compile & Hygiene, Screenshots & Tests, and CodeQL. macOS Remote passed after one retry for a runner DNS failure while cloning the smoke-test fixture, before any smoke tests ran.
  • Copilot review completed with no inline findings or unresolved threads.

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
Copilot AI balanced review requested due to automatic review settings September 6, 2026 23:21
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/sessions/browser/parts/customViewNode.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 17c5935a Current: 4fcfc425

Changed (2)

sessions/automations/automationsView/Empty/Dark
Before After
before after
sessions/automations/automationsView/Empty/Light
Before After
before after

3 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Added (20)

sessions/automations/automationsView/Empty/DarkHighContrast

current

sessions/automations/automationsView/NarrowEmpty/Dark

current

sessions/automations/automationsView/NarrowEmpty/Light

current

sessions/automations/automationsView/ShortEmpty/Dark

current

sessions/automations/automationsView/ShortEmpty/Light

current

sessions/automations/automationsView/Loading/Dark

current

sessions/automations/automationsView/Loading/Light

current

sessions/automations/automationsView/Unavailable/Dark

current

sessions/automations/automationsView/Unavailable/Light

current

sessions/automations/automationsView/Unavailable/DarkHighContrast

current

sessions/automations/automationsView/NarrowUnavailable/Dark

current

sessions/automations/automationsView/NarrowUnavailable/Light

current

sessions/automations/automationsView/PartialLoading/Dark

current

sessions/automations/automationsView/PartialLoading/Light

current

sessions/automations/automationsView/PartialUnavailable/Dark

current

sessions/automations/automationsView/PartialUnavailable/Light

current

sessions/automations/automationsView/PartialError/Dark

current

sessions/automations/automationsView/PartialError/Light

current

sessions/automations/automationsView/Error/Dark

current

sessions/automations/automationsView/Error/Light

current

@ulugbekna
Ulugbek Abdullaev (ulugbekna) merged commit b6d68fb into main Sep 7, 2026
54 of 55 checks passed
@ulugbekna
Ulugbek Abdullaev (ulugbekna) deleted the ulugbekna/agents/vscode-pr-334368-review branch September 7, 2026 02:30
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 7, 2026
Ulugbek Abdullaev (ulugbekna) added a commit that referenced this pull request Sep 7, 2026
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
Ulugbek Abdullaev (ulugbekna) added a commit that referenced this pull request Sep 7, 2026
…#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)
Ulugbek Abdullaev (ulugbekna) added a commit that referenced this pull request Sep 8, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants