From 8586fc761dca2cc3d9627c34b7960bd60d5cadf4 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:38:16 -0400 Subject: [PATCH] fix(linux): stop marking the terminal host scope ManagedOOMPreference=avoid (#32935) uresourced before 0.5.5 answers every attribute write on the scope's cgroup by re-setting its CPU and IO weights, which makes systemd rewrite the oomd xattr again. The loop pins systemd --user and eventually stops it starting new terminals. Per-terminal scopes already keep oomd from taking every terminal. --- src/main/daemon/terminal-scopes-runtime.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/main/daemon/terminal-scopes-runtime.ts b/src/main/daemon/terminal-scopes-runtime.ts index 50c0802e1e7..7f0cfa6cc2f 100644 --- a/src/main/daemon/terminal-scopes-runtime.ts +++ b/src/main/daemon/terminal-scopes-runtime.ts @@ -1,5 +1,4 @@ import { existsSync } from 'node:fs' -import { spawnProcess } from '@orca/process-host' import { userManagerEnv } from './daemon-cgroup-scope' import { setPtyActiveProcessLimit } from '../windows/windows-pty-job' import { resolveTerminalScopes, type TerminalScopeRuntime } from './terminal-scopes' @@ -21,21 +20,7 @@ export function initializeTerminalScopes( setWindowsLimit: setPtyActiveProcessLimit }) active = 'on' in resolved.scopes ? { scopes: resolved.scopes.on, log } : null - if (active && daemonScope) { - // Prefer losing one terminal to oomd over the daemon holding every scrollback; older systemd may reject this. - try { - const child = spawnProcess({ - program: 'systemctl', - args: ['--user', 'set-property', '--runtime', daemonScope, 'ManagedOOMPreference=avoid'], - env: userManagerEnv(process.env), - stdio: 'ignore' - }) - child.on('error', () => {}) - child.unref() - } catch { - // Terminal scopes remain usable if this optional preference fails. - } - } + // No ManagedOOMPreference on the daemon scope: uresourced <0.5.5 loops on its xattr rewrites and wedges systemd --user. if (process.platform === 'linux') { log( 'terminal-scopes',