bug(linux): systemd-oomd kills AO during startup reconciliation
Summary
On Linux, the AO desktop/daemon was terminated during startup/recovery activity after systemd-oomd selected the AO app scope under sustained user-session memory pressure. Before the first kill, AO logged an ACP Chat-session resume failure (initialize timed out with JSON-RPC -32603 Internal error). A later oomd event killed the scope again at a higher measured scope memory use. The evidence confirms oomd as the proximate termination mechanism; it does not identify one process or session as the sole pressure source.
This is Linux evidence consistent with, but distinct from, the macOS eager Chat restore resource-spike report in #4608.
Confidence:
- High —
systemd-oomdkilled the AO application scope after sustained user-session memory pressure. - Medium — AO startup/recovery restoration was a significant contributor to the memory pressure.
- Low — Any claim that a specific AO child process or session was the initiating cause of the pressure.
Environment
- OS: Ubuntu 24.04.4 LTS
- AO version: 0.13.1
- Incident: 2026-09-27 (local time)
- Corroborating checkout:
0c60f21360f1718c75394649e8e3634c0b690e65(2026-08-11); not confirmed as the incident revision.
Evidence timeline
- 22:36:52 — During startup reconciliation, AO logged a live-pass failure while resuming Chat session
repo-ana-6: ACPinitializereturnedcontext deadline exceeded, with JSON-RPC-32603 Internal error. - 22:37:21 —
systemd-oomdselected the AO app scope at 1.4 GiB. User-session memory pressure was 63.09% against a 50% limit for more than 20 seconds, with reclaim activity. systemd recorded 34 processes killed and scope resultoom-kill. - 22:45:31 — AO logged reconciliation errors for two sessions because
git config extensions.worktreeConfigcould not lock.git/configwhile a lock file existed. This is evidence of recovery/reconciliation activity, but does not establish the cause of the oomd event. - About 22:45:45 — Attached screenshot shows load average 5.57, high CPU and I/O wait, about 188 MiB free, 1.1 GiB available, and 283 MiB swap in use.
- 22:46:17 —
systemd-oomdselected the AO app scope again, now at 2.1 GiB. User-session pressure was 71.94% against the 50% limit for more than 20 seconds, with reclaim activity; 37 processes were killed and the scope again failed withoom-kill.
Several OpenCode scopes were each around 140–206 MiB; Chromium was another oomd candidate at about 313 MiB. The available evidence does not identify which process or workload initiated the memory pressure.
RCA
Confirmed: systemd-oomd selected and killed the AO app scope after user-session memory pressure remained above its configured 50% threshold for more than 20 seconds while reclaim was active. The evidence points to memory pressure, not disk exhaustion.
Likely AO-side contributor: eager boot-time reconciliation/restoration of non-terminated Chat sessions may have contributed additional process and memory load. On the inspected checkout, backend/internal/session_manager/manager.go has Reconcile run reconcileLive for non-terminated records and then call RestoreAll; Chat controllers are daemon child processes and cannot be adopted after daemon restart, so eligible saved sessions are restored. The ACP timeout precedes the first oomd kill, but chronology alone does not prove it increased memory use or caused the kill. The inspected revision is only code-path corroboration, not proof of the incident binary's implementation.
Impact
The AO app scope was killed during startup and again during recovery, interrupting the desktop/daemon and its processes. With several concurrently restored Chat sessions and other workloads, startup recovery may contend for memory and CPU/I/O and trigger oomd termination. The evidence does not establish data loss or that every AO process was killed in either event.
Investigation findings
The following observations were reproduced during investigation:
- The most noticeable resource pressure and lag were observed during app launch/relaunch and session restoration when Chat/OpenCode sessions were present.
- Restart/relaunch/reinstall scenarios using only TUI sessions did not reproduce the same lag.
- After adding Chat/OpenCode sessions, subsequent launch/relaunch tests showed increased memory usage, swap activity, and noticeable lag.
- A startup/recovery scenario involving restored Chat/OpenCode sessions produced severe system lag that required a forced shutdown.
- During a later reproduction, OpenCode processes were observed consuming substantial memory while swap usage increased.
- These observations are consistent with Chat/OpenCode restoration contributing to resource pressure, but do not establish that Chat restoration was the sole cause of the original freeze.
Related issue
- #4608 — macOS report of eager startup Chat restoration causing a resource spike and desktop lag. This report adds Linux oomd evidence; the two incidents have similar suspected contributors but different platforms and confirmed outcomes.