Skip to content

Subscription recipients spawned via integration subscribe --spawn never wake: deliveries never injected #1794

Description

@AgentRelayBot

Summary

Verified against the published agent-relay@12.2.5 (post-merge of #1756) on production: a real GitHub → relayfile → subscription → channel chain delivers events to a spawned recipient's inbox, but the agent is never woken — zero delivery_injected, pending_messages stays 0, events sit unread indefinitely.

Repro

agent-relay integration subscribe github \
  --resource AgentWorkforce/software-garden \
  --to @ghsub-watcher-2 \
  --spawn claude \
  --broker-connection <node connection.json> \
  --task "<digest/ack task>"
# then: gh issue create / gh issue comment on the repo

Observed

  • integration subscribe succeeds: relayfile binding, webhook wh_…, relay subscription sub_… all created; recipient spawns, reports ready, and stands by.
  • Real GitHub events land in the agent's agent-events-<id> channel ~40s after the GitHub action (verified: evt_/rev_ relayfile metadata, issue docs: add bun install + markdown docs access (#385, #386) #529 payload present).
  • Agent inbox (checked with its own at_live_ token): 3 unread messages — events ARE delivered to its queue.
  • But pending_messages: 0 on the broker and no delivery_injected/delivery_queued events for the worker — the engine never pushes the deliveries to the node.

Root-cause chain (partially diagnosed)

  1. Every spawn's node-control agent.register fails on this broker (bound HTTP-registered agent to node (via_node) after agent.register fallback in broker logs for ALL recent spawns — including non-subscription spawns, e.g. cloud-deploy-scope, since at least Sep 17).
  2. The fallback path HTTP-registers the agent (providerName="default", locationType=via_node pointing at its direct-<id> pseudo-node) then calls bind_agent_to_node, which only writes agentNodeBindings — it does not update agents.locationNodeId/providerName.
  3. Delivery routing (resolveLiveLocations) joins bindings only when agents.locationNodeId = bindings.node_id; engine-side this agent still points at the dead pseudo-node → deliveries never route to a live node.
  4. On a non-enrolled node it's worse: the node's providerName differs, so inventory_sync is rejected with agent_provider_conflict and the node-control socket flaps every ~30s — degrading delivery for the whole node, not just the spawned agent.

Evidence

  • Broker log (chief-linuyc.log.2026-09-19): bound HTTP-registered agent to node (via_node) after agent.register fallback worker=ghsub-watcher-2 at 00:31:46, then only failed to publish agent session event warnings; zero delivery events for the agent.
  • /api/spawned on chief-linuyc: ghsub-watcher-2 idle, pending_messages: 0.
  • Channel agent-events-226862793946365952 contains the real GitHub event messages; agent inbox shows 3 unread.
  • On a fresh non-enrolled broker (ghsub-cli-e2e, own workspace): agent_provider_conflict → "Agent "ghsub-watcher-1" belongs to provider "default"" every ~30s; engine sees node offline.

Impact

The integration subscribe --spawn path (the documented way to wire a repo → agent wake) produces recipients that can never be woken. Since the register fallback applies to all broker spawns, new spawned agents generally may be undeliverable, not just subscription recipients. Long-standing (fallback present ≥Sep 17) — possibly an engine-side regression in agent.register/provider handling rather than a CLI regression.

Notes

  • The same end-to-end chain DID deliver to a worker in the selfhost proof (ghsub-selfhost-e6a8fedbd7), but that worker was spawned via HarnessDriverClient.spawn directly against the fix: preserve broker spawn custody and dispatch compiled MCP calls once #1759 candidate broker — worth A/B-testing whether register_node_agent_token succeeds there.
  • integration subscribe --spawn itself worked fine mechanically (bind, webhook, spawn, readiness) — the defect is in the spawn's registration path leaving the agent undeliverable.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions