Problem#
On Windows and Windows on ARM (win32-arm64), T3 Code suffers from severe responsiveness bottlenecks, high background CPU/IPC overhead, slow startup, and update/provider issues that push x64 builds onto ARM hosts or fail on ARM64 installations:
- Port discovery WMI polling:
PortScanner spawns powershell.exe Get-NetTCPConnection + Get-Process every 3 seconds even when no terminals are active, taking up to 22.5s and timing out at 5s on every poll.
- Main-thread FFI overhead in
@ff-labs/fff-node: Workspace file searches perform 7 separate FFI calls plus manual char-by-char pointer reads per result (175,000+ FFI calls for 25k files), stalling the server event loop for >4s and causing WebSocket ping disconnects.
- Synchronous SQLite WAL commits:
Sqlite.ts enables journal_mode = WAL with the default synchronous = FULL, invoking FlushFileBuffers() on every EventSink.write transaction on Windows.
- Duplicate startup shell environment probes & Android SDK
PATH scans: The server re-runs synchronous PowerShell login probes even when the desktop parent already prepared the environment, mergeWindowsEnv leaves colliding Path/PATH keys, and LocalDeviceHost scans every PATH directory before checking %LOCALAPPDATA%\Android\Sdk.
- Renderer IPC storm during streaming:
SnapShotCoordinator recreates drain whenever activeThreadRef updates, firing desktop:list-pending-snap-shots on every streaming turn update.
- Full-system PEB process enumeration in
t3-resource-monitor: On Windows, sysinfo::ProcessRefreshKind::everything() reads PEB command lines, memory, and disk I/O for every process on the machine every 2 seconds instead of only tracked PIDs.
- Windows terminal teardown hangs & console window flashes:
node-pty's conpty_console_list_agent only listens for message and hangs for 5s if the helper exits early, Manager.runKillEscalation sleeps for the full grace period after exit, and detached helper spawns flash console windows.
- Windows on ARM updates & provider installs:
NsisUpdater checks process.arch ("x64" under Prism emulation) or falls back to the first manifest entry, keeping emulated installs on x64 or pushing x64 updates to ARM hosts; DesktopEnvironment ignores runningUnderArm64Translation on win32; .github/workflows/release.yml falls back to an x64-only latest.yml/nightly.yml if the arm64 manifest is missing; ACP Registry providers lack a windows-aarch64 -> windows-x86_64 Prism fallback; and CodexInstallation can hit GNU tar path parsing or transient Windows file-lock rename failures after validation.
Change#
- PortScanner: Short-circuit in
0ms when targetPids is empty and replace Get-NetTCPConnection PowerShell WMI polling with concurrent netstat.exe -ano -p tcp / tcpv6 calls (~50ms).
@ff-labs/fff-node patch: Marshal string fields via DataType.String in a single struct return and skip per-item get_score FFI calls when count > 200, cutting 25k-item queries from 4.16s to ~1.12s.
- SQLite WAL: Set
PRAGMA synchronous = NORMAL; alongside PRAGMA journal_mode = WAL;.
- Startup & device discovery: Respect
shellEnvironmentPrepared: true on win32, run shellEnvironment.installIntoProcess concurrently with electronApp.whenReady, deduplicate Path/PATH keys in mergeWindowsEnv, check standard Android SDK locations before scanning PATH, and skip no-op DeviceService.refreshHosts runs.
- SnapShotCoordinator: Stabilize
drain with a ref so streaming thread state updates do not trigger listPendingSnapShots IPC calls.
t3-resource-monitor: Enable two-stage process refresh on Windows (ProcessRefreshKind::nothing().with_cpu() across the system, then everything() only for tracked PIDs) and resolve target-triple binary paths in ResourceMonitorBinary.ts.
- Terminals & process spawning: Handle
exit/error on conpty_console_list_agent in node-pty, race process.onExit against processKillGraceMs in Manager.ts, remove the redundant 1s Windows teardown sleep in OpenCodeRuntime.ts, and pass windowsHide: true on detached spawns.
- Windows on ARM updates & providers:
- Preserve
runningUnderArm64Translation and hostArch: "arm64" on win32 in DesktopEnvironment.ts so DesktopUpdates disables differential downloads when switching from x64 to arm64.
- Filter
updateInfo.files to hostArch in DesktopUpdates.ts (ignoring manifests that carry no package for hostArch) and add NsisUpdater.filterFilesForArch in patches/electron-updater@6.8.9.patch so ARM64 Windows hosts always select arm64.exe.
- Order
arm64 first when merging Windows update manifests in .github/workflows/release.yml and fail if the arm64 manifest is missing instead of publishing an x64-only manifest.
- Add the Windows
arm64.exe download link to /download and update the architecture warning copy for Windows on ARM.
- Fall back from
windows-aarch64 to windows-x86_64 in AcpRegistrySupport.ts, and use System32\tar.exe plus fs.rename retries and stale .install-* cleanup in CodexInstallation.ts.
Model: Claude 5.5 Opus
Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
093e451ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.