396
return { sessionType: remembered, isPreferCopilotHarnessSwap: false };
397
}
399
>
// One-time migration: when the agent host is enabled and the user has opted
400
>
// in via `chat.editor.preferCopilotHarness`, swap an existing local editor
401
>
// session to Copilot exactly once (guarded by the persisted marker). Never
402
>
// swap when the agent host is disabled, since the Copilot harness would be
403
>
// unavailable. This function does not persist the marker itself; the caller
404
>
// marks it only after applying the swap, so a caller that discards the
405
>
// result does not consume the one-time migration.
406
if (options?.currentSessionType === localChatSessionType
408
&& configurationService.getValue<boolean>(ChatConfiguration.EditorPreferCopilotHarness)
409
&& !hasPreferredCopilotHarness(storageService)) {