Skip to content

operator: ambient loop tick carries a live fleet snapshot#369

Merged
edwin-zvs merged 1 commit into
mainfrom
operator-ambient-fleet-snapshot
Jun 6, 2026
Merged

operator: ambient loop tick carries a live fleet snapshot#369
edwin-zvs merged 1 commit into
mainfrom
operator-ambient-fleet-snapshot

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Problem

The operator ambient loop (#352) fires every ~5 min but produced no useful observations. The tick injected a content-free prompt:

OBSERVATION: ambient operator loop tick. Quietly inspect only if useful; … reply exactly noted if nothing needs surfacing.

With no fleet data and a strong silence bias in the system prompt, the Operator had nothing concrete to react to and defaulted to noted essentially every tick. Confirmed against the live operator — when asked "Any other observations?", it replied:

"No — only the repeated ambient operator loop tick observations. No errors, approvals, done events, or fleet alerts surfaced."

(The data-carrying fleet-event observations only fire on sparse state transitions; between them the ambient loop carried zero signal.)

Fix

Each ambient tick now pulls the daemon session list and injects a compact fleet snapshot instead of a blank prompt:

  • counts of active sessions by state (running / awaiting_input / errored),
  • changes since the last tick (sessions that went errored / awaiting_input / done — a per-tick delta),
  • what needs attention now (errored, or awaiting_input ≥ 30m),
  • and a nudge to inspect a stuck/errored/surprising session or reply noted.

The Operator's own session is excluded. If the daemon can't be reached, it falls back to the original bare prompt. Delta state is in-memory (resets on adapter restart → first tick emits a baseline with no delta). Lists are capped to stay low-noise. The loop interval, orchestrator-only gate, and fleet-event pipeline are unchanged.

Verification

  • Pure formatter (format_ambient_observation) is unit-tested: counts exclude self, and a running→errored transition surfaces as a delta with updated counts.
  • Built clean; 34 interactive tests pass.
  • Rendered live against the running fleet:
    OBSERVATION: ambient operator loop tick.
    Fleet now: 5 running, 2 awaiting_input, 0 errored.
    Changes since last tick: (first tick — baseline only).
    Needs attention: none.
    If a session looks stuck, errored, or surprising, inspect it …
    

Spec: specs/0021-operator-ambient-tick-carries-fleet-snapshot.md. Code is in agentd-adapter-zarvis.

The ambient loop tick was content-free ("inspect only if useful ... reply
noted"), so the Operator had nothing concrete to react to and defaulted to
"noted" every tick. Observed live: it reported only "repeated ambient operator
loop tick observations ... no errors/approvals/done/fleet alerts surfaced".

Now each tick pulls the daemon session list and injects a compact snapshot:
counts by state, what changed since the last tick (delta), and what needs
attention (errored / long-awaiting). Falls back to the old bare prompt if the
daemon is unreachable. Pure formatter is unit-tested; spec 0021 records it.

Verified live: renders "Fleet now: 5 running, 2 awaiting_input, 0 errored ...".
@edwin-zvs
edwin-zvs merged commit 49a32a7 into main Jun 6, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the operator-ambient-fleet-snapshot branch June 6, 2026 15:14
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