Skip to content

Stopping an agent strands messages already queued to it, and the sender is not told #504

Closed

Description

@Jacksondr5

Found in the review of the upstream advance (#500). This is upstream's Stop working as designed, which J5's stop_agent and stop_crew now use (Jackson, 2026-10-08).

When an agent is stopped, turns already queued behind its running turn are held until a person resumes its queue. For agent-to-agent messages that means:

  • The delivery worker treats a held queue as not a failure. It rechecks at most every 15 minutes, indefinitely, and never raises an alarm.
  • The sender gets no notice.
  • No agent tool can resume a queue. Only a person in the client can.
  • A message sent after the stop starts at once, so it runs ahead of the held ones, which may include an ask that expects a reply.

The tool descriptions now tell agents this. The open question is whether stopping an agent should cancel its held deliveries through the existing cancellation path, so senders are told and can decide what to do, or whether held is the right state and the sender should get a notice instead.

Activity

  1. Jacksondr5 commented on Oct 10, 2026

    @Jacksondr5
    OwnerAuthor

    Parked (Jackson, 2026-10-10): this is larger than a follow-up fix and is not part of the nightly work. His two framings, for whoever picks it up:

    1. The core problem may be the queue jump. A message sent after the stop starts at once and runs ahead of the held ones. If a new message instead restarted the queue, the held messages would run first, in order, and nothing would be stranded once anyone messaged the agent again. Open points: upstream lets a new message start new work after a Stop on purpose, so changing that for everyone is a change to upstream's product; limiting it to agent-sent messages is a J5 rule on J5's delivery path. Held messages would still sit silently if nobody messages the agent again, which is Held A2A deliveries and limited receivers: tell the sender what is happening #272.
    2. If agents can stop an agent, perhaps they need the rest of the person's controls: resuming a queue, reordering and removing queued items, steering a message. That is the question feat(j5): reconcile agent queue mutations with A2A delivery and Exchanges #136 already asks (agent queue mutations against A2A delivery and Exchanges), and it belongs with Evaluate J5's agent tools against upstream's: keep, converge, retire or give back #519 (J5's tools against upstream's) and Decide whether J5 agents keep delegate_task alongside spawn_agent, native Subagents and propose_crew #336 (which agents the person sees).

    Options considered and not chosen: cancel held deliveries when an agent stops an agent (senders are told, queued work is discarded); leave them held and tell the sender (#272); a resume tool for agents.

    Until then the j5_stop_agent and j5_stop_crew descriptions tell agents what a stop does to queued messages.

  2. Jacksondr5 commented on Oct 13, 2026

    @Jacksondr5
    OwnerAuthor

    Picked up with Jackson, 2026-10-11 and 2026-10-12. Checking the code and the live database changed what this issue is about.

    What actually happens

    The ledger marks an agent message delivered when it joins the receiver's queue, not when its turn starts. So for messages queued before a stop:

    • Nothing is pending. There is no 15-minute recheck and no alarm. That recheck only covers a message that arrives while a hold exists and a turn is running.
    • The existing cancellation path does nothing, because it skips rows already marked delivered.
    • Asks are partly covered already: the silence detector follows the run an ask became and tells the sender when it ends without a reply, including when it is cancelled. Messages that are not asks are followed by nothing, and a held run has not ended, so nothing reacts to it.

    Seen once in live data

    2026-10-11, about 02:10 UTC: an agent sent a three-part review. Part 1 ran and was stopped. Parts 2 and 3 were held by the stop and removed from the queue two seconds later. The ledger says all three were delivered, and the sender was not told.

    Decided

    1. This issue becomes: when a queued agent message is removed without ever running, tell the sender, whoever removed it. Extend the run-following the silence detector already does for asks to every agent message, for this one case.
    2. No stored "queued" status. The run already records queued, held, running and removed; a copy in the ledger would have to be kept in step with it. Derive the state from the run when something needs it (Held A2A deliveries and limited receivers: tell the sender what is happening #272, Fleet).
    3. Wording: notice text that calls a queued message "delivered" should say it was queued.
    4. The queue jump is its own issue: An agent's message to a stopped agent runs ahead of the messages held in its queue #580.

    A message that is held and not removed still waits silently. That stays with #272. Agent queue tools stay with #136, which needs item 1 first.

  3. Jacksondr5 commented on Oct 13, 2026

    @Jacksondr5
    OwnerAuthor

    Build status, 2026-10-12:

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