Urgent.News

What's breaking now, across thousands of outlets.

Tech

Sticky in process, gone on restart: auditing the state your CLI daemon keeps in memory

A containment flag can be wired correctly, tested, documented, and still be a containment flag you do not have. The wiring is only half the story. The other half is where the baseline lives. I spent a while reading the source of agent-browser , a browser-automation CLI that runs as a client plus a long-lived per-session daemon, because a user reported that a containment flag "disappears silently…

Sticky flags in daemons can remain unnoticed, even when correctly wired. While the implementation may be sound, the boundary where the state lives is often overlooked. A case in point is a browser-automation CLI called agent-browser, which experiences a containment flag disappearing silently during daemon restarts. By thoroughly auditing the source code, a procedure can be devised to examine any daemon-shaped CLI for such issues.

Two flags in agent-browser serve as examples: --allowed-domains and --pin-tab. Both restrict the browser session, but they differ in their lifetime. The former uses a sticky approach, while the latter is made restart-proof with a sidecar file. The former flag is implemented with two different lifetimes and inherits the adopted filter upon subsequent commands. However, a new process restarts with whatever the replacing command carried, essentially starting with a clean slate.

The second flag, --pin-tab, is implemented with a sidecar file and re-read when the daemon state is built. It ensures that the session remains safe, even if the binding is lost or corrupt. The domain filter flag, however, lacks an equivalent load mechanism, making it prone to open failure.

Consequences of such bugs are visible in the code. State replay refuses to proceed with a domain filter active, and the browser-side half drops the restriction. The restrictive behavior of the flag is derived from the list, which gets hashed into the launch hash. Upon relaunch, the browser returns without the WebRTC restriction. Additionally, the session-info handler reports session, engine, launch hash, and the restore family but does not include the active allowlist.

The missing test case is worth generalizing. Every end-to-end test of the domain filter mutates the filter in a live process, but none of them cross a restart. The test suite remains silent about this issue, as it never leaves one process. Adding a test case to an existing test would not have caught the problem, as the missing test is a different shape altogether.

To ensure the stability of such daemons and CLIs, a systematic audit should be conducted, covering the entry points, adoption, baseline, persistence, and write safety.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

My Weekly Tech Digest: What I Learned in Linux Essentials with Akwannya Hub

This week, I dove deep into the core concepts of the Linux Essentials course organized by Akwannya Hub. Here is a quick breakdown of everything I covered, from low-level kernel concepts to cloud…

  • Linux Essentials course explored FOSS principles and license types
  • Examined Linux file system hierarchy and key directories
  • Covered networking services and directory services in Linux

Canada is about to break your scheduler

At 2:00 AM on 1 November 2026, DST ends for Canada. However, DST will not end in British Columbia, Alberta, the Northwest Territories, and Manitoba starting from this shift.

  • Canada to switch to permanent daylight time on 1 November 2026
  • DST ends in BC on 9 March, Alberta on 18 June, NWT on 21 August, Manitoba on 11 September 2026
  • Transition will break computer systems and time-related schedulers

More from Sunday 20 September →