Skip to content

sessions: fix Agents window hang with per-group editor limit of 1 - #327074

Merged
sandy081 merged 4 commits into
mainfrom
sandy081/agents/agents-window-disable-single-tab-mode
Jul 23, 2026
Merged

sessions: fix Agents window hang with per-group editor limit of 1#327074
sandy081 merged 4 commits into
mainfrom
sandy081/agents/agents-window-disable-single-tab-mode

Conversation

@sandy081

Copy link
Copy Markdown
Member

Fixes #327066

What

Enforce showTabs: 'multiple' and limit: { enabled: false } on the single-pane editor part (SinglePaneMainEditorPart) via the existing enforcePartOptions API.

Why

The single-pane docked tab bar keeps several managed editors open at once — the pinned Changes multi-diff tab, the Files placeholder, and any real file tabs ([Changes][Files][file…]). Two user settings break this layout:

  • workbench.editor.showTabs set to single/none collapses the docked tab strip.
  • workbench.editor.limit (especially perEditorGroup: true, value: 1) makes EditorsObserver auto-evict the least-recently-used tab. Since the managed tabs are pinned (not sticky), they get evicted, the managed-tab reconciliation reopens them, and the observer evicts again — an infinite open/close loop that hangs the renderer (the reported bug).

Notes for reviewers

  • Scoped to the single-pane editor part only; the user's workbench.editor.showTabs / workbench.editor.limit settings are untouched everywhere else.
  • limit: { enabled: false } is sufficient because EditorsObserver.ensureOpenedEditorsLimit returns early when the limit is disabled, so the other limit fields are never read.
  • The showTabs enforcement was already present; this PR adds the limit enforcement to close the hang.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The single-pane docked tab bar keeps multiple managed tabs open at once
(pinned Changes multi-diff + Files placeholder + file tabs). The user's
`workbench.editor.showTabs` (single/none) and `workbench.editor.limit`
settings break this: with a per-group editor limit of 1 the managed-tab
reconciliation and EditorsObserver enter an infinite open/close loop and
hang the renderer.

Enforce `showTabs: 'multiple'` and `limit: { enabled: false }` on the
single-pane editor part via the existing enforcePartOptions API, scoped
to this part only so the user's settings are untouched elsewhere.

Fixes #327066

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 00:19
@sandy081 sandy081 self-assigned this Jul 23, 2026
@sandy081 sandy081 added this to the 1.131.0 milestone Jul 23, 2026
@sandy081
sandy081 enabled auto-merge (squash) July 23, 2026 00:20
@vs-code-engineering

vs-code-engineering Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

@benibenj

Matched files:

  • src/vs/sessions/browser/parts/singlePaneEditorPart.ts
  • src/vs/workbench/browser/parts/editor/editorsObserver.ts
  • src/vs/workbench/services/editor/test/browser/editorsObserver.test.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.

Pull request overview

Disables editor-limit eviction for the Agents window’s single-pane editor layout to prevent managed-tab reconciliation loops.

Changes:

  • Forces multiple tabs.
  • Disables editor limits for the single-pane part.
Show a summary per file
File Description
src/vs/sessions/browser/parts/singlePaneEditorPart.ts Enforces editor-part options for managed tabs.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread src/vs/sessions/browser/parts/singlePaneEditorPart.ts Outdated
Comment thread src/vs/sessions/browser/parts/singlePaneEditorPart.ts Outdated
Address review feedback: the previous fix disabled workbench.editor.limit
for the whole Agents window (EditorsObserver reads the aggregate main-part
partOptions but evicts across modal/auxiliary parts too).

Instead, exempt only the managed docked inputs from the limit via a new
EditorInputCapabilities.ExcludeFromEditorLimit set on DockedEditorInput.
EditorsObserver skips such editors when counting/evicting, so the managed
Changes/Files tabs are never auto-closed (no open/close loop) while every
other editor — including modal and auxiliary editor groups — still honors
the user's limit.

Add regression tests: EditorsObserver keeps excluded editors while still
evicting a normal editor at a per-group limit of 1, and DockedEditorInput
carries the exclusion capability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081

Copy link
Copy Markdown
Member Author

Addressed review feedback in b823988:

  • Scoping: Removed the blanket limit: { enabled: false } enforcement (which, as noted, disabled the user's limit for modal/auxiliary groups too since EditorsObserver reads the aggregate main-part partOptions). Instead, only the managed docked inputs now opt out of the limit via a new EditorInputCapabilities.ExcludeFromEditorLimit set on DockedEditorInput. EditorsObserver skips such editors when counting/evicting, so the Changes/Files tabs are never auto-closed (no open/close loop) while every other editor — including modal and auxiliary groups — still honors workbench.editor.limit.
  • Tests: Added an EditorsObserver regression test with a per-group limit of 1 verifying the excluded managed editors survive while a normal editor is still evicted, plus a Sessions - Workbench test asserting DockedEditorInput carries the exclusion capability.

showTabs: 'multiple' enforcement is unchanged. typecheck-client, valid-layers-check, and the EditorsObserver + all 1049 Sessions unit tests pass.

dmitrivMS
dmitrivMS previously approved these changes Jul 23, 2026
Address feedback: list the docked inputs' capabilities explicitly (adding
only ExcludeFromEditorLimit) instead of deriving Readonly from super, so it
is obvious Readonly is retained. DockedEditorInput still carries the
exemption by default for any docked input that does not override capabilities.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DockedEditorInput.capabilities contributes only the limit exemption (no
Readonly). Each docked subclass ORs super.capabilities with the exact
capabilities it declared before, so Readonly/Singleton/ForceReveal are
retained explicitly while the exemption comes from the base.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081
sandy081 merged commit 6ecb223 into main Jul 23, 2026
29 checks passed
@sandy081
sandy081 deleted the sandy081/agents/agents-window-disable-single-tab-mode branch July 23, 2026 00:58
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.

Agents window hangs with per-group editor limit of 1

3 participants