Skip to content

agentHost: preserve read-only session configuration values - #339328

Merged
roblourens merged 2 commits into
mainfrom
agents/fix-readonly-validation-schema
Oct 2, 2026
Merged

roblourens merged 2 commits into
mainfrom
agents/fix-readonly-validation-schema

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

Fixes a regression introduced by #339034: client-side schema filtering dropped settings-derived worktree configuration because the host marks these properties readOnly. In particular, git.worktreeSymlinkFolders stopped reaching the host, so folders such as node_modules were no longer symlinked into new worktrees.

  • Ignore readOnly in session config validation/filtering and in the pre-send settings refresh. Pickers still honor readOnly for UI editability; advertised-key, enum, and session-mutability checks remain unchanged.
  • Restore forwarding of branch prefixes, included files, symlink folders, branch tracking, and the create-new-branch option.
  • Match the provider test schema to the real host and cover creation, resolution, folder-settings refresh/clearing, programmatic worktree configuration, and read-only mutable values such as shell initialization scripts.
  • Update workbench tests to expect read-only values to remain in resolution and completion payloads.

Validation

  • npm run compile-client — passed.
  • The following unit-test command — passed: 752 passing, 11 pending.
./scripts/test.sh --run src/vs/platform/agentHost/test/common/sessionConfigProperties.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostSessionConfigPicker.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostPermissionPickerDelegate.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatInputPicker.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostGenericConfigChips.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostShellInitSynchronizer.test.ts --reporter dot
  • The following ESLint command — passed.
npm run eslint -- src/vs/platform/agentHost/common/sessionConfigProperties.ts src/vs/platform/agentHost/test/common/sessionConfigProperties.test.ts src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatInputPicker.test.ts src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostGenericConfigChips.test.ts
  • git diff --check — passed.
  • Commit hygiene hook — passed.
  • Live end-to-end worktree creation was not run. To verify manually, configure git.worktreeSymlinkFolders to include an existing ignored folder such as node_modules, create an Agent Host session using worktree isolation, and send its first request. Confirm the new worktree contains the expected symlink. Also verify that these host-owned properties do not become editable config chips.

(Written by Copilot)

Stop enforcing readOnly when validating and forwarding session config so settings-derived worktree options survive discovery, creation, and refresh. Keep picker editability and the remaining schema checks unchanged. Add regression coverage for worktree options and update workbench payload expectations.

Regression from #339034. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 16:56

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

🟡 Changes recommended

The generalized filter now leaks host-reported fields into replacement mutation payloads.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Preserves host-advertised read-only session configuration while keeping UI editing disabled.

Changes:

  • Allows read-only values through validation and forwarding.
  • Refreshes settings-derived worktree configuration.
  • Updates schemas, documentation, and regression expectations.
File Description
sessionConfigProperties.ts Revises filtering and validation semantics.
sessionConfigProperties.test.ts Covers read-only forwarding and picker editability.
baseAgentHostSessionsProvider.ts Refreshes advertised settings-derived values.
localAgentHostSessionsProvider.test.ts Expands worktree and read-only coverage.
agentHostChatInputPicker.test.ts Updates refresh payload expectation.
agentHostGenericConfigChips.test.ts Preserves read-only values in payloads.
meta/​README.md Documents read-only forwarding behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/platform/agentHost/common/sessionConfigProperties.ts
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: f1a93aca Current: 68ad7660

Changed (2)

sessions/accountMenu/WeeklyAndFiveHourLimits/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

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

@roblourens
roblourens marked this pull request as ready for review October 2, 2026 17:58
@roblourens
roblourens enabled auto-merge (squash) October 2, 2026 17:58
@roblourens
roblourens merged commit b9573ff into main Oct 2, 2026
35 checks passed
@roblourens
roblourens deleted the agents/fix-readonly-validation-schema branch October 2, 2026 21:20
@vs-code-engineering vs-code-engineering Bot added this to the 1.141.0 milestone Oct 2, 2026
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