Operations

Inspect runs on request. Do not turn status into polling.

LMAS keeps long-running work out of the agent loop. Operational commands are for explicit user checks, completion handling, and cancellation, not for repeatedly watching a running job.

Status and list

lmas list
lmas status <run_id>

lmas list shows each run id, status, exit code, elapsed seconds, a short command summary, and the run directory. lmas status shows the command, elapsed time, stdout, stderr, metadata, watcher log, adapter log, resume prompt, and optional notification log.

Agent rule

If status is RUNNING, the agent should stop the turn unless the user explicitly asks for another check. RUNNING is not a completion event.

Progress file

A job may write lightweight progress lines to:

.lmas/runs/<run_id>/progress.txt

When that file exists, lmas status reports only the latest line as progress. LMAS never reads this file during handoff waiting; it is surfaced only during explicit status checks.

Secondary notification

lmas start --notify https://ntfy.sh/my-topic -- python train.py
LMAS_NOTIFY_URL=https://ntfy.sh/my-topic lmas start -- python train.py

--notify posts the generated resume_prompt.txt to an http:// or https:// webhook or ntfy URL after the adapter attempt. It does not replace session resume; it is only an extra notification path.

Webhook URLs may contain secrets. LMAS stores the URL in notify_url.txt, not in metadata.txt. Metadata records only notify=enabled. Run artifacts may also contain commands and local paths, so treat the owner-only run directory as sensitive.

HTTP completion calls are bounded by LMAS_HTTP_CONNECT_TIMEOUT and LMAS_HTTP_MAX_TIME, defaulting to 5 and 30 seconds. Timeout failures are recorded in adapter.log or notify.log and do not change the completed run status.

Cancel

lmas cancel <run_id>

Cancellation stops the watcher, terminates the process tree and process group, escalates to KILL when needed, writes a CANCELLED completion event when the watcher is still alive, and records any surviving pids in metadata.

Runtime files