From 5cca824071f83944673f76cd0500e204206381f4 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Mon, 9 Nov 2026 17:20:37 -0800 Subject: [PATCH] fix(computer): keep OneDrive's per-user setup out of the Windows base OneDrive set itself up at the session user's first sign-in, from the default profile's Run key, and left two RunOnce deletes behind. Each is a console command, which Windows 11 opens in a Terminal window that takes the foreground for about 350 ms; a composed disk boots afresh every time, so they ran at every boot and took keys typed through SendInput (agent-desktop's WindowsDriver), failing the probe's P6 typing checks now and then. The base now removes OneDriveSetup from the default profile's Run key before the session user's profile exists. Part of FD-5418. Co-Authored-By: Claude Opus 5.5 --- src/agent_env/computers/disk/windows/setup.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/agent_env/computers/disk/windows/setup.ps1 b/src/agent_env/computers/disk/windows/setup.ps1 index 373e6ad02..3467346fe 100644 --- a/src/agent_env/computers/disk/windows/setup.ps1 +++ b/src/agent_env/computers/disk/windows/setup.ps1 @@ -1,10 +1,10 @@ # setup.ps1: a Windows base readied for agent-env, once, elevated, at agentadmin's first sign-in. OpenSSH comes first # (agentadmin by agent-env's key alone), which is how agent-env composes the base and reads this setup's log when it # fails (setup-failed). Then nothing of Windows' own is left in an agent's way: no updates, lock screen, notifications, -# widgets, Copilot, first-run pages or apps Windows installs in the background, and no page file, all of which would grow -# every layer composed on the base. The pinned Python, with Tk, is what layers' venvs and the probe's fixture run on; -# agentenv-session starts the session's services, windowless, at the session user's sign-in. Then the session user signs -# in at every boot. +# widgets, Copilot, OneDrive, first-run pages or apps Windows installs in the background, and no page file, all of +# which would grow every layer composed on the base. The pinned Python, with Tk, is what layers' venvs and the probe's +# fixture run on; agentenv-session starts the session's services, windowless, at the session user's sign-in. Then the +# session user signs in at every boot. param([string]$Media, [string]$User, [string]$UserPassword) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' @@ -66,6 +66,12 @@ try { Set-Values 'HKU\AgentenvDefault\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement' @{ ScoobeSystemSettingEnabled = 0 } -BestEffort Set-Values 'HKU\AgentenvDefault\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' @{ SubscribedContentEnabled = 0; SystemPaneSuggestionsEnabled = 0; SilentInstalledAppsEnabled = 0; SoftLandingEnabled = 0 } -BestEffort + # OneDrive sets itself up at a new user's first sign-in, from the default profile's Run key, and leaves two RunOnce + # deletes behind. Each is a console command, which Windows opens in a Terminal window that takes the foreground, and + # a composed disk boots afresh every time, so they would run at every boot and take what an agent types. + $run = 'Registry::HKU\AgentenvDefault\Software\Microsoft\Windows\CurrentVersion\Run' + (Get-Item $run -ErrorAction SilentlyContinue).Property | + Where-Object { (Get-ItemPropertyValue $run $_) -match 'OneDriveSetup' } | ForEach-Object { Remove-ItemProperty $run $_ } [gc]::Collect() reg.exe unload HKU\AgentenvDefault | Out-Null