From 69a85f56d2057f7dbcb25ddc2a7b4726e3034488 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Thu, 16 Jul 2026 01:45:35 -0700 Subject: [PATCH] fix(codex): establish real-home lane before cleanup --- src/main/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 43970bf11a8..d56d1c98609 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -2016,6 +2016,14 @@ app.whenReady().then(async () => { runtimeService.notifyEmulatorAutoAttachFromWatcher(worktreeId, info) }) nativeTheme.themeSource = store.getSettings().theme ?? 'system' + if (codexRuntimeHome.isHostSystemDefaultRealHomeSelected()) { + // Why: establish capability before managed-hook reconciliation so an + // incapable host re-arms and completes the legacy real-home sweep now. + ensureRealHomeCodexHookState({ + hooksEnabled: isAgentStatusHooksEnabled(store.getSettings()), + userDataPath: app.getPath('userData') + }) + } if (shouldInstallManagedHooks(is.dev)) { // Why: the persisted off switch must run before any auto-install path so // users who removed Orca-managed hooks do not see them silently reappear on launch. @@ -2025,14 +2033,6 @@ app.whenReady().then(async () => { removeManagedAgentHooks() } } - if (codexRuntimeHome.isHostSystemDefaultRealHomeSelected()) { - // Why: establish the lane before background rate-limit polling starts, so - // an incapable grant host never polls a home its PTYs will not use. - ensureRealHomeCodexHookState({ - hooksEnabled: isAgentStatusHooksEnabled(store.getSettings()), - userDataPath: app.getPath('userData') - }) - } app.on('child-process-gone', (_event, details) => { recordProcessGoneCrash('child', details.type, details.reason, details.exitCode ?? null, { name: details.name,