Skip to content

Supervision, second pass: the layer was silent on seven livelocks and loud at healthy agents #3665

Open

Description

@jwbron

The problem

We ran two long pipelines over the last three days. Between them, seven agents entered
repetition loops: the same tool call, or a short cycle of them, repeated until something
outside the system intervened. Five different roles, across all three phases. Not one was
detected by the product. Every one of them was caught by a monitor I was running by hand in a
terminal, and cleared by me typing an answer into the bus.

In the same window, the supervision layer was noisy in the other direction. A convergence-stall
alert fired at [high] priority against a coder whose peer heartbeat was seconds old, while the
health monitor was concurrently logging, every 30 seconds, that the same agent was alive. That
alert was then read (by me) as the cause of a 110-minute work loss it had nothing to do with.
The misdiagnosis cost more than the alert would ever have saved. Separately, two agents were
killed at exactly two hours by a timeout none of them could see coming, and both kills were
counted as crashes against the fail-streak budget.

So the layer whose job is to distinguish a working agent from a wedged one was silent for seven
wedged agents and loud at several healthy ones. Both directions have the same consequence: an
operator stops trusting the signal and goes back to watching by hand, which is what happened.

There is one more thing worth stating plainly, because it shaped everything above. While
building that hand-rolled monitor I rewrote the "is this role stuck?" rule five times. Each
version looked obviously correct and each produced false positives against live data. Producers
are legitimately podless between events; reviewers legitimately wait on upstream producers; a
declared no-op leaves its review edges pending forever; a NACK is a verdict and discharges the
obligation just as an ACK does. Two of those five states are not visible in the status payload at
all. Whatever gets built here will hit all five. A detector that cries wolf gets muted, and a
muted detector misses the real stall.

What has already landed, and must not be rebuilt

The last pass over this area produced work that shipped. Verify each of these in the tree and
treat them as done:

That list is what shipped. It is not a statement about what remains.

Areas worth attention

Four, loosely. How you cut them up, order them, or merge them is your call.

  • Signals that exist and are not consulted. In more than one place the information needed to
    tell working from wedged is already computed, in the same process, seconds away from the code
    that decides. It is not read. Some detectors are also unreachable because an input they require
    is never populated.

  • Session boundaries read as failures. An agent that simply ran long, or exited cleanly
    without emitting the verdict it owed, or whose pod vanished, is currently indistinguishable
    from one that crashed. Some of these consume a retry budget or an arm they should not, and at
    least one suppresses the very check that would have noticed.

  • Loops that nothing detects. This is the seven. One empirical result from the incident
    analysis is worth handing over rather than making you rediscover: across every instance,
    counting tool inputs never issued before in the session over a trailing window separates a
    loop from work cleanly: a working agent produces new ones and a loop of any length produces
    none. Two constraints found the hard way: the pod log cannot support this, because tool inputs
    are truncated at about 100 characters and distinct commands sharing a prefix collapse together;
    and the cycle shape varies (single-input, 2-, 3-, and 8-cycles were all observed), so anything
    keyed on a fixed shape or on dominance misses most of them. What to do with that is yours to
    decide.

  • Alerts an operator cannot act on. Some fire without the evidence that would make them
    readable. Some name a threshold whose detector does not exist. Some outcomes are distinguishable
    only by which log string was emitted.

What to propose

Two things, and keep them separate.

The work. Decide what is worth doing across those areas, in what order, and what to leave
out. Nothing above is a requirement; if you find something in the list is already handled, drop
it and say where.

A candidate list. Beyond whatever you propose to build, produce a ranked list of further
improvements to this layer that you think are worth making. Every entry must carry a
file-and-symbol citation and a verdict on whether the thing is present or absent in the tree
today. This list is a deliverable in its own right and does not obligate anyone to implement any
of it. It is input to the gate, and the gate decides. Do not defer chosen work into it.

Ground rules

Verify before you build. Some of what looks missing here may already exist; this description
is written from an operator's experience, not from the code. Check the tree before planning
anything, and say what you checked. If something is already implemented, drop it and say so
rather than building it twice.

Scope is yours to propose. If a judgement call would materially change the shape of the work,
raise it as a decision rather than guessing.

Read the prior write-ups critically, or not at all. #3595 is the incident analysis and #3596
was the first pass over this area; both contain superseded plans and at least one hypothesis that
was later disproved. The repository is the source of truth.

This layer is watching you while you change it. Its blind spots are the ones described above,
so do not assume an absence of alerts means anything is fine.

Activity

  1. added
    p1
    on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions