Skip to content

Removing a peer leaves its open Exchanges open #286

Closed

Description

@Jacksondr5

Problem

j5 a2a peer remove (and the Connections UI) deletes this server's record of a peer server and revokes the session it held here. Any Exchange still open between a local agent and an agent on that server stays open on both sides:

  • A later reply or follow-up to it fails delivery here ("peer … is no longer recorded on this server"), retries, and alarms.
  • The answerer's silence detector keeps measuring a debt that can no longer be paid.
  • The asker's thread is never told the counterparty is gone.

The runbook (docs/j5/runbooks/peering.md) documents the workaround for now: close or withdraw open Exchanges, or archive the agents involved, before removing the peer.

Possible shape

On removal, drop every open Exchange whose recorded route (see apps/server/src/j5/a2a/peerCounterparty.ts) points at the removed environment, with a new drop cause such as peer-removed, and deliver the usual terminal notice to the local party. Nothing can reach the other server at that point, so its copy stays open until its operator removes us too and gets the same treatment.

Raised in review of #176 (bryantderosier).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions