Skip to content

sessions: keep automation cards running until history appears - #347444

Merged
Ben Villalobos (benvillalobos) merged 4 commits into
mainfrom
fix/automation-run-start-flicker
Nov 10, 2026
Merged

Ben Villalobos (benvillalobos) merged 4 commits into
mainfrom
fix/automation-run-start-flicker

Conversation

@benvillalobos

Copy link
Copy Markdown
Member

Motivation

Clicking Run briefly showed provisional history while the Agent Host created the real session, which made the automation card flicker and re-enabled Run too early. This PR keeps startup on the card until the session-backed row is presented, without changing provider-owned execution bookkeeping.

Code stats
  • Total diff (at PR creation): +193/-68
  • Implementation: +66/-36 across 3 files
  • Tests: +127/-32 across 1 file, 4 added
  • Documentation: +0/-0 across 0 files
  • Split: 39.1% implementation, 60.9% tests, 0% documentation
  • Changed-line coverage: not measured
Where the change lives
  • automationsView.test.ts: +127/-32 (60.9%)
  • automationsAccessibility.ts: +41/-24 (24.9%)
  • automationsView.ts: +18/-12 (11.5%)
  • automationRunProgress.ts: +7/-0 (2.7%)
Change breakdown
Category What it does Implementation Tests
Startup presentation Keeps unresolved execution state on the card until real history is presented, with matching accessibility behavior +66/-36 +0/-0
Regression coverage Covers startup, card-to-history handoff, deletion, and accessible status +0/-0 +127/-32
Total +66/-36 +127/-32
  • Startup presentation: automationRunProgress.ts, automationsAccessibility.ts, automationsView.ts
  • Regression coverage: automationsView.test.ts

Changes made

  • Hide unresolved local execution bookkeeping from history and keep the automation card Running until the real session row is rendered.
  • Keep visual and accessible startup state aligned while preserving duplicate-start, cancellation, failure, deletion, and recovery behavior.

Watch the Before/After proof video

Testing

  • pnpm run build-fast --client-only passed.
  • pnpm run test-browser-no-install --run src/vs/sessions/contrib/sessions/test/browser/automationsView.test.ts --browser chromium passed with 178 tests.
  • pnpm run typecheck-client passed.
  • pnpm run eslint src/vs/sessions/contrib/sessions/browser/views/automationRunProgress.ts src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.ts src/vs/sessions/contrib/sessions/browser/views/automationsView.ts src/vs/sessions/contrib/sessions/test/browser/automationsView.test.ts passed.

Hide unresolved provider bookkeeping from run history while preserving it for duplicate-start, cancellation, and recovery semantics. Keep the card and accessibility state running until the real session-backed history entry is presented.

Co-authored-by: Copilot <[email protected]>
Avoid treating deleted completed sessions as pending startup, and keep disabled automation accessibility output aligned with the visual Running state.

Co-authored-by: Copilot <[email protected]>
Copilot AI max review requested due to automatic review settings November 10, 2026 19:10
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: a9cd3102 Current: 704a0574

Changed (11)

sessions/automations/automationsView/Populated/Light
Before After
before after
sessions/automations/automationsView/PluginTemplatesPopulated/Light
Before After
before after
sessions/automations/automationsView/DropTarget/Light
Before After
before after
sessions/automations/automationsView/PartialLoading/Light
Before After
before after
sessions/automations/automationsView/PartialUnavailable/Light
Before After
before after
sessions/automations/automationsView/PartialDisconnectedRemotes/Light
Before After
before after
sessions/automations/automationsView/NarrowPartialDisconnectedRemotes/Light
Before After
before after
sessions/automations/automationsView/PartialUnavailableMultipleReasons/Light
Before After
before after
sessions/automations/automationsView/PartialError/Light
Before After
before after
sessions/automations/automationsView/Narrow/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverMissingInstallation/Light
Before After
before after

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.

🟡 Changes recommended

Valid completed history can leave automation cards stuck in Running with Run now disabled, while accessibility filtering can omit retained-history owner names and guidance.

3 open issues
What changed in this PR

This PR moves local automation startup feedback from provisional history rows to automation cards in the Agents Window, keeping Run disabled until session-backed history is presented.

Changes:

  • Track unresolved local runs and presented sessions to control card startup state.
  • Align accessibility labels, Accessible View content, and help text with the card-to-history handoff.
  • Extend regression coverage for startup, session discovery, deletion, and dispatch feedback.
File Description
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​automationsView.test.ts Updates startup, handoff, deletion, and accessibility tests.
src/​vs/​sessions/​contrib/​sessions/​browser/​views/​automationsView.ts Keeps startup on cards and hides unresolved local history rows.
src/​vs/​sessions/​contrib/​sessions/​browser/​views/​automationsAccessibility.ts Updates accessible startup status and history filtering.
src/​vs/​sessions/​contrib/​sessions/​browser/​views/​automationRunProgress.ts Adds a shared predicate for local startup presentation.

Review effort: Max

Exclude terminal sessionless history from startup presentation, reuse one session catalog snapshot in the accessible view, and preserve retained-history guidance during session handoff.

Co-authored-by: Copilot <[email protected]>
@benvillalobos
Ben Villalobos (benvillalobos) marked this pull request as ready for review November 10, 2026 23:05
@benvillalobos
Ben Villalobos (benvillalobos) merged commit 071de6f into main Nov 10, 2026
52 of 53 checks passed
@benvillalobos
Ben Villalobos (benvillalobos) deleted the fix/automation-run-start-flicker branch November 10, 2026 23:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 10, 2026
@bryanchen-d

Copy link
Copy Markdown
Collaborator

Ben Villalobos (@benvillalobos), a heads-up: a test added here looks like the reason every unit job on main is timing out.

What fails: since 495093 (225e6b5944), every unit job (Electron on Linux, Windows and macOS, plus Browser Chromium and WebKit) hits its 30-minute timeout. The first failure is Sessions - SessionsList › catalogue refresh scheduling › coalesces provider, catalogue and host invalidations while preserving focus and selection. About 70 failures then cascade through later suites that wait on animation frames.

Mechanism (local repro of all vs/sessions/** browser tests in one Chromium window, 29 failures starting at the same test): scheduleAtNextAnimationFrame in dom.ts sets a per-window animFrameRequested = true and then calls requestAnimationFrame. When that call hits a rAF faked by runWithFakedTimers, and the fake is uninstalled before the frame fires, the flag stays true forever, and the shared animation-frame runner never runs again in that renderer. With dom.js instrumented, the first faked rAF call comes from AutomationsCardsWidget › run feedback survives acknowledgement and refresh until the new run session appears (added here), via a list splice → eventuallyUpdateScrollDimensions.

Why PR CI didn't catch it: PR CI runs only the affected tests across 4 workers. Main runs the full suite in one renderer, so a stuck flag only reaches other suites there.

Confirmation: agent bisect runs are in flight. 495148 has #347484 alone, and 495149 adds this PR. Results come around 02:10 UTC.

Timing and options: the 05:00 UTC releasing insider will include this commit. A minimal test-side fix is being staged (await the frame, or keep the splice outside the faked-timer window), so you can take it or do your own. A revert is staged only as a fallback. The longer-term fix is for runWithFakedTimers to flush or cancel captured rAF callbacks when it uninstalls, and we're drafting that separately.

Co-authored with Copilot

Bryan Chen (bryanchen-d) added a commit that referenced this pull request Nov 11, 2026
The sinon clocks in AutomationsCardsWidget faked requestAnimationFrame. Since
#347444, the last setRuns in 'run feedback survives acknowledgement and refresh
until the new run session appears' splices a list after the final tick, so
scheduleAtNextAnimationFrame sets the window's animFrameRequested flag and
requests the frame from the fake clock. restore() drops that frame, the flag
never clears, and no later test in the renderer gets an animation frame. In the
full single-renderer unit run this times out every later frame waiter, starting
with the SessionsList catalogue refresh tests (main CI 495093).

Fake only Date and timers in these tests so animation frames stay real.

Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d) added a commit that referenced this pull request Nov 11, 2026
The sinon clocks in AutomationsCardsWidget faked requestAnimationFrame. Since
#347444, the last setRuns in 'run feedback survives acknowledgement and refresh
until the new run session appears' splices a list after the final tick, so
scheduleAtNextAnimationFrame sets the window's animFrameRequested flag and
requests the frame from the fake clock. restore() drops that frame, the flag
never clears, and no later test in the renderer gets an animation frame. In the
full single-renderer unit run this times out every later frame waiter, starting
with the SessionsList catalogue refresh tests (main CI 495093).

Fake only Date and timers in these tests so animation frames stay real.

Co-authored-by: Copilot <[email protected]>
@bryanchen-d

Copy link
Copy Markdown
Collaborator

The agent bisect confirms it. 495148 (#347484 alone, on green aadc4c6a07) passed Linux Electron unit. 495149, which adds this PR's merge 071de6f9b3, failed with the same first failure (catalogue refresh scheduling › coalesces provider…) and timed out. A test-only fix is up as draft #347524. The 4 sinon clocks in AutomationsCardsWidget now fake only Date and the timer functions, so animation frames stay real. Locally that takes all of vs/sessions/** from 29 failures to 0. Feel free to take it or do your own. The 05:00 UTC releasing insider needs a fix on main before it's queued.

Co-authored with Copilot

Bryan Chen (bryanchen-d) added a commit that referenced this pull request Nov 11, 2026
…sts (#347524)

The sinon clocks in AutomationsCardsWidget faked requestAnimationFrame. Since
#347444, the last setRuns in 'run feedback survives acknowledgement and refresh
until the new run session appears' splices a list after the final tick, so
scheduleAtNextAnimationFrame sets the window's animFrameRequested flag and
requests the frame from the fake clock. restore() drops that frame, the flag
never clears, and no later test in the renderer gets an animation frame. In the
full single-renderer unit run this times out every later frame waiter, starting
with the SessionsList catalogue refresh tests (main CI 495093).

Fake only Date and timers in these tests so animation frames stay real.

Co-authored-by: Copilot <[email protected]>
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.

4 participants