Skip to main content

Module test_offscreen

Module test_offscreen 

Source
Expand description

A test build that never shows a window on a real display.

A tester starts an isolated build with AGENTMUX_TEST_OFFSCREEN=1. Every window the host creates then goes to ORIGIN, far above every display, and nothing saves that place as the person’s window position. Before this, the window opened on screen and a separate script raced to move it, and three times (2026-11-15) a tester’s window showed on a shared screen.

Only a dev or local build honours it (build_kind): a published release ignores the variable, so one inherited from a test instance’s shell cannot hide a person’s windows. The decision is the binary’s, never the variable’s alone.

Windows and Linux/X11 place a window anywhere. Wayland cannot place a window at all, so there the flag does nothing and a tester must use X11 (or XWayland) for a test build.

macOS cannot park a window: AppKit puts a shown window onto a display. There no window is ever shown at all (test_offscreen_macos): the process blocks every way to order one in, refuses to start if it cannot, and stops itself if one is on the on-screen list anyway.

Constants§

AUDIO_OFF_MARK
The phrase start_line carries when audio is off, which scripts/offscreen-check.sh looks for in a binary: a build from before this one honours the off-screen flag but plays sound.
ENV
The environment variable a launch sets.
ORIGIN
Where a window goes: far above every display, with its left edge at 0. Not the pool’s corner (-32000, -32000): the host reads a window whose left edge is under -20000 as a spare pool window (OFFSCREEN_POOL_THRESHOLD_X), counts it as closed, and ends the app when it is the only one.
PARKED_BELOW_X
A spare pool window waits parked with its left edge under this (the host’s OFFSCREEN_POOL_THRESHOLD_X): it is already off-screen and stays there until it is promoted.
SILENT_SWITCHES
The Chromium switches that keep a test build silent. A test run is driven on a machine a person works at, and an agent sound (turn done, waiting) through that person’s speakers is as much an intrusion as a window on their screen. mute-audio zeroes every sample and disable-audio-output swaps the audio service’s output for a fake one, so no device is opened; Chromium forwards both to the audio service process. Neither depends on the app’s sound setting, so a build that has sounds on (the default) is silent anyway, in the app’s own sounds and in any page a pane loads.

Functions§

active
True when this process creates every window off-screen. Read once.
begin
The start of a process: when it runs off-screen it first makes sure it can (on macOS, that no window will ever be ordered in), and refuses (one line on stderr, exit status 2, nothing started) when it cannot. It then logs start_line if there is one.
initial_rect
The rect a window is created at when this process is off-screen, None when it is not: CEF places a window whose initial bounds are empty at (0, 0), so the window must say where it starts. bounds are the ones the window was asked for, if any (a spare pool window keeps its parking place).
macos_activation_policy
The macOS activation policy the host sets: a normal Dock app, or an accessory app in test window mode (no Dock tile, no menu bar, never activated by itself), so a test run leaves no icon in the person’s Dock and cannot take the keyboard from their frontmost app.
place
(x, y) for a window that is off-screen, or pos when this process is not.
place_rect
A window rect (x, y, width, height) with its origin moved off-screen when this process is.
requested_by
Whether a build of this kind started with value in ENV runs off-screen.
silent_switches
The switches the host adds to its command line: SILENT_SWITCHES in test window mode, none otherwise.
start_line
One log line for the start of a process that says what the variable did, so a tester can tell a build that ignored it from one that honoured it. None when it was not set.