Skip to content

Fix migration activity persistence after reverting a customization - #336828

Merged
Hawk Ticehurst (hawkticehurst) merged 2 commits into
mainfrom
agents/customization-migration-revert-fix
Sep 21, 2026
Merged

Hawk Ticehurst (hawkticehurst) merged 2 commits into
mainfrom
agents/customization-migration-revert-fix

Conversation

@hawkticehurst

Copy link
Copy Markdown
Member

Fixes #336731

This pull request addresses the issue where customization migration activity remains after a migration is reverted, as outlined in issue #336731. The changes ensure that stale migration activity is properly reconciled when migration candidates are refreshed.

Changes

  • Reconciles stored migration activity whenever migration candidates refresh, removing stale activity if a reverted source becomes migratable again.
  • Introduces stable URI-based migration keys for new file and MCP activity, while maintaining a legacy label/path fallback for existing stored activity.
  • Preserves copied-file activity, ensuring the original source remains intact.

Validation

  • All tests for the customization management editor pass.
  • Regression tests for current and legacy migration activity are successful.
  • ESLint checks and git diff --check pass without issues.
  • Full client type-check was blocked due to unrelated missing declarations, but transpilation completed successfully.

Copilot AI balanced review requested due to automatic review settings September 18, 2026 20:06
@hawkticehurst
Hawk Ticehurst (hawkticehurst) marked this pull request as ready for review September 18, 2026 20:08

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 copied-file preservation branch needs regression coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Reconciles persisted customization migration activity after reverted migrations.

Changes:

  • Adds stable migration keys for files and MCP servers.
  • Removes stale current and legacy activity while preserving copied-file records.
  • Adds regression coverage for activity reconciliation.
File Description
aiCustomizationManagementEditor.ts Reconciles and keys migration activity.
customizationMigrationDashboard.ts Adds optional migration keys.
aiCustomizationManagementEditor.test.ts Tests current and legacy activity removal.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Cover the reconciliation exception that keeps copy migration activity when its source remains a migration candidate.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Base: 6b0c54ee Current: 8de98620

No screenshot changes.

@hawkticehurst
Hawk Ticehurst (hawkticehurst) merged commit 5188ead into main Sep 21, 2026
52 of 54 checks passed
@hawkticehurst
Hawk Ticehurst (hawkticehurst) deleted the agents/customization-migration-revert-fix branch September 21, 2026 19:58
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 21, 2026
homecoc pushed a commit to homecoc/ticode that referenced this pull request Sep 21, 2026
…icrosoft#336828)

Agent Host changes for agents/customization-migration-revert-fix
homecoc added a commit to homecoc/ticode that referenced this pull request Sep 21, 2026
* chat: add a render-only Permissions area to the Customizations editor

Adds Terminal, Files and Network permission sections to the Chat
Customizations editor, behind the off-by-default
`chat.customizations.permissions.enabled` setting, so users can see which
rules govern an agent.

The Copilot runtime is the source of truth for permissions: it owns the
rule DSL, the matcher, and the precedence between managed policy,
configured rules, location grants and session grants. Nothing here
recomputes any of that -- the rule syntax helper only splits
`Kind(argument)` for display, and domains exist only for the four rule
families the runtime actually accepts.

The runtime exposes no read API for its resolved rule set yet, so the
snapshot reports only the managed scope and names the layers it could not
read. An empty list would claim "nothing governs this agent", which is the
opposite of the truth under `failClosed`. Tracked upstream in
github/copilot-sdk-internal#244.

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

* chat: cross-reference the managed rule builder from the display parser

Upstream added `ManagedRuleFamily` for the rules VS Code sends. Note the
relationship from the read-side parser, including why it accepts the
`Bash`/`PowerShell`/`Edit` aliases the builder never emits, so the two
family sets do not drift.

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

* chat: align the Permissions sections with the customization design language

The permission sections were visibly foreign next to the customization
sections: an inline icon+title+filter strip, no panel chrome, uppercase
scope labels, and the description stranded in a bottom footer.

Reuse the existing chrome instead of approximating it. The sections now
join the shared selector lists for the content panel, the section title
header (title, description, inline learn-more) and the search row, and
render scope groups with the same collapsible `ai-customization-group-header`
markup, so consistency holds by construction rather than by copied values.

What stays different is what a row means: a permission rule is a read-only
statement of what the runtime enforces, not something authored here, so
there is no create button, uneditable rows carry a lock, and each row ends
in an allow/ask/deny pill.

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

* chat: fix staleness, partial provider failures and focus in the Permissions sections

Addresses PR review findings:

- Disabling the agent host mid-probe left the in-flight generation valid,
  so a late result could overwrite the disabled state. Bump the generation
  on the transition.
- Provider failures arrive in-band as `{ error }` rather than thrown, and
  were being skipped. A timeout then looked like "not supported", and a
  mixed result could present one provider's rules as the whole policy.
  Failures are now carried on the snapshot and shown as a warning, and an
  all-failed probe reports an error instead of a capability gap.
- Selecting a permission section focused the hidden prompts search box.
  Route contributed sections through their own `focus()` via one shared
  helper used by both the selection path and the editor's `focus()`.
- An empty group while filtering said "No rules", implying no policy
  exists. Say "No matching rules" when a filter is active.
- The snapshot only refreshed on construction or enablement change, so the
  view could not recover from a stale read. Add a Refresh action in the
  slot the customization sections use for their primary action, and
  re-read when a section is opened unless a probe is already running.

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

* chat: add a Permissions section fixture and polish its states

Writing the fixture surfaced that the panel chrome was scoped to the
management editor, so the widget could not render standalone. Scope it to
`.chat-permissions-section` instead — the class belongs to the widget, so
it now carries its own chrome while staying in the shared rule.

Visual fixes found by looking at it:
- Drop the group-header icon. The shared header hides `.group-icon`, so it
  was dead DOM; the scope icon now appears in the override badge instead,
  where it explains which layer won.
- Dim the effect pill on an overridden rule. Its verdict does not apply, so
  showing it at full strength misrepresented it.
- Replace the bare status line with the customization sections' centered
  empty state, keeping the honest detail ("Rules may still be enforced").

Four fixtures cover managed-only, all scopes with a shadowed rule, partial
provider failure, and unavailable — each in Dark and Light.

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

* chat: complete the Permissions fixture coverage

Expands the fixtures from 4 to 13 (26 with themes) so every state the
widget can render has a screenshot baseline, and labels them
`kind: 'screenshot'` so CI treats them as such.

Adds coverage for: all three domains (Files exercises every path anchor,
Network its own argument shape), a family-wide rule, long arguments that
must ellipsize, a filtered view with no matches, fail-closed, loading,
error, and all three unavailable reasons. Fixtures build on the real
domain definitions rather than copies, so a label or docs-link change is
reflected instead of drifting.

Two problems the fixtures exposed, fixed here:
- A family-wide rule rendered as a bare kind and looked truncated. Domains
  now supply an `allRequestsLabel` ("All commands"), shown in its place.
- `splitPermissionPathArgument` was unused while the UI showed the raw
  anchors, so `//etc` versus `/src` was unexplained. Domains can now
  contribute `describeArgument`, used for the row tooltip and — more
  importantly — the accessible name, so a screen reader hears "in the
  workspace" rather than a leading slash.

Rendering a filtered view needed the filter to be set at construction, so
the widget takes an optional `initialFilter`.

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

* chat: render managed permissions from VS Code's own channels while the agent is asked

VS Code receives the same admin-authored managed-settings documents the
agent does, through the server and file channels, and retains them raw —
`IDefaultAccountService.managedSettingsRawResponse` and
`IFileManagedSettingsService.rawManagedSettings`. The Permissions sections
therefore no longer have to sit blank for seconds waiting on the
diagnostics probe.

The agent stays authoritative: it runs its own resolution, composes layers
this client cannot see, and applies fail-closed. The local read is a
labelled stand-in that is always superseded, and if the probe fails the
stand-in is kept but marked unconfirmed rather than collapsing to a bare
error — the admin-authored policy is still the best available description
of what governs the user.

Two things this must not become:
- It never merges channels. VS Code resolves managed settings by per-key
  precedence, but the agent composes `deny`/`ask` as a union and `allow` as
  an intersection; applying VS Code's precedence would show only the
  winning channel and under-report the restrictions in force. Channels are
  read independently and concatenated, and two declared allow lists set
  `allowIntersected` rather than being flattened.
- It omits native MDM. That watcher only reports keys a configuration
  policy declares, and `permissions.*` is runtime-owned with no VS Code
  setting behind it; declaring one purely to read it is what the
  managed-settings guidance warns against. The agent's answer covers it.

Extraction is shared with the probe path, so both produce identical rows.
Also registers `NullFileManagedSettingsService` in web so the service is
injectable everywhere, mirroring the existing native MDM registration.

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

* Update DevSkim workflow trigger to include Docs

* Modify DevSkim workflow triggers and branches

Updated workflow triggers for DevSkim to use 'MacOS' and changed branches from 'main' to 'master'.

* Update CodeNotify for automations (microsoft#337118)

* automations: add Ben to CodeNotify

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

* signing commit

---------

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

* test: isolate CopilotAgent proxy environment (microsoft#337119)

Clear ambient proxy variables for every CopilotAgent test and restore the original environment after each test so 1ES Network Isolation cannot bypass the mocked proxy resolver.

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

* [cherry-pick] sessions: make harness bootstrap authentication provider-neutral (microsoft#337111)

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>

* chat: Configure keybindings for voice control actions (microsoft#337115)

Make each segmented Voice Mode control configure the command it currently invokes, including start/disconnect, listen, and mute actions. Add regression coverage for the state-aware mappings.\n\nFixes microsoft#337067\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert CSS changes from PR microsoft#336770 to fix hover regression (microsoft#337107)

* network: align URL trust and IDN domain policies (microsoft#336960)

* network: normalize Unicode wildcard domain patterns

Normalize wildcard suffixes with the URL-aware authority helper before validating the pattern. Add matching, policy, and fetch-tool regression coverage while preserving existing domain handling.

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

* network: normalize sandbox domains and IDN URL approvals

Canonicalize sandbox domain policies and preflight URL hosts, rejecting patterns that cannot be normalized. Match equivalent Unicode and Punycode literal host labels in URL trust and approval rules while preserving existing glob semantics.

Partial Unicode wildcard labels remain outside this change.

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

* url: align trust checks with effective HTTP destinations

Normalize authority separators and resolved paths consistently across trusted domains, URL approval rules, and web-page fetching. Preserve hostname case semantics, escaped path data, and actual request destinations, with regression coverage for approvals, exclusions, and declined tool calls.

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

* sandbox: warn and deny network for invalid domain patterns

Keep shell-tool registration and offline sandboxed commands available when domain patterns cannot be normalized. Log a warning and use a deny-all policy instead of throwing, with regression coverage for both lists and recovery after settings are corrected.

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

* url: bound glob matching and preserve effective URL semantics

Replace the eager recursive matcher with iterative deduplicated states to avoid Unicode path allocation spikes and stack growth. Normalize configured patterns consistently, preserve effective authority and path semantics, and retain HTTP path case without changing non-HTTP drive normalization.

Add regression coverage for the PR feedback and verify real Code OSS trust, approval, fetch, and sandbox workflows.

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

---------

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

* agentHost: stabilize concurrent subagent replay (microsoft#337102)

* agentHost: stabilize concurrent subagent replay

Match opted-in concurrent parent and child model requests by their normalized projections, and canonicalize only cross-channel completion interleaving in the affected AHP snapshot. (Written by Copilot)

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

* agentHost: preserve per-chat snapshot order

Canonicalize the complete action sequence for each participating chat so cross-channel normalization cannot move a completion ahead of an earlier response. Extend the regression test with interleaved response actions. (Written by Copilot)

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

---------

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

* Make subagent model guidance the default (microsoft#337116)

* Make subagent model guidance the default

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

* Update Copilot system message expectation

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

---------

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

* Fix migration activity persistence after reverting a customization (microsoft#336828)

Agent Host changes for agents/customization-migration-revert-fix

* Agents - remember isolation per workspace (microsoft#337125)

* Agents - remember isolation per workspace

* Pull request feedback

* sessions: cap unified picker recent folders (microsoft#337132)

Keep Remote actions visible by limiting the unified workspace picker to ten recent workspaces. Add regression coverage for the cap.\n\nFixes microsoft#337129\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: clean up Windows agent-host descendants after shutdown (microsoft#337080)

* test: clean up Windows agent-host descendants after shutdown

Record the test server's descendants before graceful shutdown and await cleanup of survivors before removing temporary directories. Keep product provider shutdown and timeout budgets unchanged. Add a Windows regression proving that a clean parent exit does not imply descendant exit.

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

* test: bound descendant snapshots by the shutdown deadline

Share the existing shutdown budget between descendant enumeration and graceful exit. Preserve EOF and forced cleanup when enumeration stalls, report the timeout afterward, and cover that path with a real-process regression.

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

---------

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

* sessions: fix unified workspace picker edge cases (microsoft#337095)

* sessions: clarify remote chat target

Show the selected remote host for workspace-less chats and align workspace picker submenu affordances with the row edge.\n\nFixes microsoft#336544\nFixes microsoft#336582\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* sessions: align workspace picker submenu indicator

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

* git: ignore deleted cached repository paths

Validate the repository path when callers request it from git.clone so a surviving workspace cache entry cannot resurrect a deleted clone.\n\nFixes microsoft#335672\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

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

* Update CodeNotify for automations (microsoft#337118)

* automations: add Ben to CodeNotify

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

* signing commit

---------

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

* test: isolate CopilotAgent proxy environment (microsoft#337119)

Clear ambient proxy variables for every CopilotAgent test and restore the original environment after each test so 1ES Network Isolation cannot bypass the mocked proxy resolver.

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

* [cherry-pick] sessions: make harness bootstrap authentication provider-neutral (microsoft#337111)

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>

* chat: Configure keybindings for voice control actions (microsoft#337115)

Make each segmented Voice Mode control configure the command it currently invokes, including start/disconnect, listen, and mute actions. Add regression coverage for the state-aware mappings.\n\nFixes microsoft#337067\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert CSS changes from PR microsoft#336770 to fix hover regression (microsoft#337107)

* network: align URL trust and IDN domain policies (microsoft#336960)

* network: normalize Unicode wildcard domain patterns

Normalize wildcard suffixes with the URL-aware authority helper before validating the pattern. Add matching, policy, and fetch-tool regression coverage while preserving existing domain handling.

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

* network: normalize sandbox domains and IDN URL approvals

Canonicalize sandbox domain policies and preflight URL hosts, rejecting patterns that cannot be normalized. Match equivalent Unicode and Punycode literal host labels in URL trust and approval rules while preserving existing glob semantics.

Partial Unicode wildcard labels remain outside this change.

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

* url: align trust checks with effective HTTP destinations

Normalize authority separators and resolved paths consistently across trusted domains, URL approval rules, and web-page fetching. Preserve hostname case semantics, escaped path data, and actual request destinations, with regression coverage for approvals, exclusions, and declined tool calls.

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

* sandbox: warn and deny network for invalid domain patterns

Keep shell-tool registration and offline sandboxed commands available when domain patterns cannot be normalized. Log a warning and use a deny-all policy instead of throwing, with regression coverage for both lists and recovery after settings are corrected.

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

* url: bound glob matching and preserve effective URL semantics

Replace the eager recursive matcher with iterative deduplicated states to avoid Unicode path allocation spikes and stack growth. Normalize configured patterns consistently, preserve effective authority and path semantics, and retain HTTP path case without changing non-HTTP drive normalization.

Add regression coverage for the PR feedback and verify real Code OSS trust, approval, fetch, and sandbox workflows.

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

---------

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

* agentHost: stabilize concurrent subagent replay (microsoft#337102)

* agentHost: stabilize concurrent subagent replay

Match opted-in concurrent parent and child model requests by their normalized projections, and canonicalize only cross-channel completion interleaving in the affected AHP snapshot. (Written by Copilot)

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

* agentHost: preserve per-chat snapshot order

Canonicalize the complete action sequence for each participating chat so cross-channel normalization cannot move a completion ahead of an earlier response. Extend the regression test with interleaved response actions. (Written by Copilot)

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

---------

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

* Make subagent model guidance the default (microsoft#337116)

* Make subagent model guidance the default

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

* Update Copilot system message expectation

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

---------

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

* Fix migration activity persistence after reverting a customization (microsoft#336828)

Agent Host changes for agents/customization-migration-revert-fix

* Agents - remember isolation per workspace (microsoft#337125)

* Agents - remember isolation per workspace

* Pull request feedback

* sessions: cap unified picker recent folders (microsoft#337132)

Keep Remote actions visible by limiting the unified workspace picker to ten recent workspaces. Add regression coverage for the cap.\n\nFixes microsoft#337129\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: clean up Windows agent-host descendants after shutdown (microsoft#337080)

* test: clean up Windows agent-host descendants after shutdown

Record the test server's descendants before graceful shutdown and await cleanup of survivors before removing temporary directories. Keep product provider shutdown and timeout budgets unchanged. Add a Windows regression proving that a clean parent exit does not imply descendant exit.

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

* test: bound descendant snapshots by the shutdown deadline

Share the existing shutdown budget between descendant enumeration and graceful exit. Preserve EOF and forced cleanup when enumeration stalls, report the timeout afterward, and cover that path with a real-process regression.

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

---------

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

---------

Co-authored-by: Josh Spicer <23246594+joshspicer@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Ben Villalobos <bevillal@microsoft.com>
Co-authored-by: Joaquín Ruales <1588988+jruales@users.noreply.github.com>
Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Megan Rogge <merogge@microsoft.com>
Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Co-authored-by: roblourens <roblourens@gmail.com>
Co-authored-by: Bhavya U <bhavyau@microsoft.com>
Co-authored-by: Hawk Ticehurst <39639992+hawkticehurst@users.noreply.github.com>
Co-authored-by: Christof Marti <chrmarti@microsoft.com>
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.

Chat customization: Migration notice sticks around after reverting change

3 participants