Skip to content

Locally-spawned agents never register with relaycast (send_dm agent_not_found) — briefing never delivered; root cause behind #96/#97; reproduces on two machines #98

Description

@khaliqgant

Summary

Locally-spawned implementer/reviewer agents never complete their relaycast registration. They run (the codex/claude process is alive and does work from its --task arg), but the broker/engine cannot address them, so the critical briefing DM fails and the agent proceeds un-briefed. Reproduced on two independent machines — this is not environmental to one host.

This is the root cause behind #96 (fabricated on-call policy) and the abort-not-firing in #97: both are downstream of "the briefing never reaches the agent."

The signal

On a machine where errors serialize with enumerable fields, the failure is explicit:

Relaycast publish failed: relaycast send_dm failed:
  API error (agent_not_found): Agent "ar-53-impl-relayed" not found

And the broker roster confirms it — the agent is NONE registered (or status: "unknown" with no pid/cli), while ps shows its codex process alive at ~0% CPU. So: process up, relaycast registration never completed, send_dmagent_not_found → briefing injection exhausts its retries (max delivery retries exceeded, or the opaque [factory] error {} on published 0.1.19 where #83's fix hasn't shipped).

Reproduced on both machines

host factory node for the agent's agent-relay mcp result
laptop published 0.1.19 + local #97 build mise node 22 (correct) not registered → delivery fails, 4/4 dispatches
sf-mini published 0.1.19 mise node 22 (correct) not registered → send_dm agent_not_found

On the laptop this is the same failure I mis-attributed to the Slack gate in #94 and to #96/#97 — all of them are this. The one configuration that did brief successfully was enrolled-node placement (relayed#47: laptop orchestrator → agent placed on sf-mini's enrolled factory-node): that agent registered and followed its injected instructions. So the break is specific to the internal owned-broker spawn+register path, not the enrolled-node path.

What changed

The 3/3 verified E2E (2026-07-16, published 0.1.17, laptop, internal owned-broker) briefed fine. The same internal path now fails to register on both machines. Candidates, not yet isolated:

  • a relaycast/engine-side change in how agent-relay mcp agents register (the error is a relaycast API error, agent_not_found);
  • the agent's MCP server failing to start or connect (its command/args run agent-relay/dist/cli/index.js mcp under the spawn env);
  • an owned-broker vs enrolled-node registration difference that a recent broker/CLI bump exposed.

Why this is the blocker

Until local-spawned agents register, no internal-backend factory dispatch can brief its agents on either machine — every run produces an un-briefed agent that guesses (#96) or stalls. It disables the entire human-steering premise and makes local E2E untrustworthy. The only working config today is enrolled-node placement, which loops back to #84/#85.

Repro

  1. factory dispatch <github issue> --config <internal-backend config> (no placement).
  2. agent-relay agent list → the spawned agents show status: "unknown", no pid/cli — a name only.
  3. Dispatch log → send_dm ... agent_not_found (or max delivery retries exceeded, or [factory] error {} pre-[factory] error {} — raw Errors serialize to {} (message/stack are non-enumerable); describeError() already exists one line away #83).
  4. Agent proceeds on the bare triage task.

Diagnostic to add

Log the agent's MCP-server startup outcome (connected / failed) at spawn, and surface agent_not_found distinctly from a generic delivery timeout. Right now the registration failure is invisible unless you cross-reference agent list against the process table.

Refs: #96, #97, #94, #84, #85, #50/#51 (earlier cold-start ack race — likely the same family).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions