Skip to content

feat(pause): the pause alert, a doctor row, and /curator run refuses while paused - #920

Draft
OAraLabs wants to merge 5 commits into
feat/pause-everything-2from
feat/pause-everything-3
Draft

OAraLabs wants to merge 5 commits into
feat/pause-everything-2from
feat/pause-everything-3

Conversation

@OAraLabs

@OAraLabs OAraLabs commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Beacon iOS Piece 17, PR 3 of 3: the push alert and the doctor row. Stacked on #919 (itself on #918); retarget as they merge. Next release, held with them.

The alert. A new pause pushes one alert to each owner device with no live socket:

  • Title "Prometheus paused", body "Paused by {who}. Nothing runs until a person resumes it." The spec's reason: "A pause nobody knows about looks like a broken agent."
  • PushDispatcher.push_paused, called by the pause itself, so the REST route and the owner's Telegram /pause both alert.
  • No category, so a lock screen offers nothing to act on; resuming is a person's, in the app.
  • Never the reason, which stays on /api/status, and never a chat account's id: a Telegram pause reads "Paused by owner in Telegram". The top-level key paused_since (epoch seconds) lets the app show local time.
  • Sent to every owner device at once, so one device that never answers doesn't keep the alert from the others.
  • Owner devices only (owner_device_ids): never a scoped or revoked device. A device watching over its socket already got the paused_changed frame, so it gets no push.
  • Once per pause: a second PUT /api/pause (the same pause) pushes nothing.

The doctor row. oara doctor gains a Pause row, in the checks that always run, so --no-scan, a missing config or a failed deep scan still show it. It names the file it read; a CLI run reads this machine's default file unless told another. The row is:

  • ok when not paused;
  • a warning with since when, never who or why, plus how to resume;
  • an error when the pause file is unreadable, which counts as paused, with what to do (oara doctor then exits 1);
  • an error, never a crash, when the state can't be read at all.

The curator archives nothing while paused. /curator run refuses. A pause that lands while the curator's model is reviewing archives nothing either; the suggestions come again on the next run. Both were backlogged lows from #919's second review.

A pause file with a nonsense since (Infinity, NaN, negative, too large for a float, or past the year 5138) is unreadable, which counts as paused. Before, that crashed boot and child processes; it's PR 1 code, fixed here because this PR's doctor row exposed it.

Choices noted:

  • Fail closed: a store that can't name its owner devices sends no alert.
  • A failed push never fails the pause, and neither does a slow one: it's capped at 5 s, and everything is already stopped before the push goes.
  • Who paused is on the lock screen because the spec asks for it. It's the one-line, 80-character by the pause stores: a device name, the API token, or the owner's Telegram.
  • The doctor row leaves out who and why, since doctor output can reach more surfaces than /api/status.
  • Merge order with feat(push,chat): every push carries node_pub; a repeated client_msg_id is the same message #912 (node_pub in every push): whichever of the two merges second adds _named(...) to the pause body and a row to tests/test_push_carries_node_pub.py.

Not in this PR (backlog from #919's reviews): the web chat handler and /v1 treat a pause met inside a round, before the sweep cancels the turn, as a turn failure. The client gets an error frame reading "Prometheus is paused", and the turn's tail is discarded. That's safe; making it match the interrupt path is a separate change to ws_server.py.

Reviews: two.

  • The review session found nothing medium or higher. Its lows: a comment saying why the alert is owner-only, and the doctor row naming its file (both done); no alert on resume (a product choice).
  • The agent found one medium: the doctor row was missing without the deep scan.
  • Fixed red-first, along with these lows: a nonsense since, the curator's archive step, the chat id, concurrent delivery, a docs sentence that overstated, and a test that a hanging push is cut off.
  • Backlogged:
    • an offline phone, a daemon that boots paused, or persisted: false can make the alert missed or misleading;
    • the alert goes to owner devices while a scoped device can carry the person mark;
    • the sweep's task_failed pushes.

Phone: nothing to adopt for the alert to show; it's a plain alert. Optional: open the pause banner on tap, and read paused_since.

Tests: red first (tests/test_pause_alert_and_doctor.py). Local Mac suite at 681627e, with the venv on PATH: 16,092 passed, 0 failed. Ruff and the mypy gate are clean.

🤖 Generated with Claude Code

OAraLabs and others added 5 commits November 13, 2026 15:04
…while paused

- A new pause pushes one "Prometheus paused" alert, saying who paused
  and never why, with no category, to each live owner device with no
  live socket (PushDispatcher.push_paused). Pausing again pushes
  nothing; a store that cannot name its owners sends nothing; a failed
  or slow push (5 s cap) never fails the pause.
- oara doctor gains a Pause row: ok, a warning with since when (never
  who or why), or an error with what to do when the file is unreadable.
- /curator run refuses while paused (its non-model pass archives files).
- Docs: the alert, the doctor row, and a model-started process pointed
  at another pause file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The Pause row is in the doctor checks that always run, so --no-scan,
  no config or a failed scan still show it (and exit 1 on an unreadable
  file); not reported twice. It names the file it read, and a state
  that cannot be read is an error row, never a crash.
- A pause file whose since is Infinity, NaN, negative, too large for a
  float or past the year 5138 is unreadable (paused), not a crash at
  boot or in a child.
- A pause landing while the curator's model reviews archives nothing.
- The alert never carries a chat account's id to Apple, and goes to
  every owner device at once, so one that never answers does not keep
  it from the others. A comment says why it is owner-only.
- Docs: what a pause does not stop (a process detached before it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant