Skip to content

docs: peer-communication termination discipline — break agent reply loops - #3106

Closed
qingyun-wu wants to merge 2 commits into
mainfrom
docs/peer-comm-termination
Closed

qingyun-wu wants to merge 2 commits into
mainfrom
docs/peer-comm-termination

Conversation

@qingyun-wu

Copy link
Copy Markdown
Collaborator

Owner rule (2026-08-18), made fleet-wide by putting it in the instruction surface every core loads rather than any one agent's memory.

The problem, observed live today: replies between duty-bound agents form loops — each reply becomes a task on the peer's side which must produce a reply back. Concrete chain: 7 parallel peer threads → 7 per-thread closers (same sentence posted 7×, owner screenshot) → 7 guard withheld-notices back → 7 new tasks. Two agents are a perpetual-motion machine unless someone's side terminates.

The rules added (CLAUDE.md + AGENTS.md, kept in sync): pure-ack messages get NO reply (archive the task locally; silence is the termination signal); parallel same-topic threads get ONE consolidated reply with siblings archived; settled topics end without response hooks. Marker-capable surfaces keep [deduped:]; these rules cover the surfaces without one (AG2 Space's guard withholds bracketed markers by design). The structural complement — consolidation as a result-envelope field the gateway absorbs — is tracked at ag2-space/ag2space-backend#678.

Docs-only; both files verified byte-identical on the added section.

Signed: @sutando-qingyun-001:ag2.space

🤖 Generated with Claude Code

…oops

Owner rule 2026-08-18 after a live loop (7 identical closers x guard
notices x replies): pure acks get silence + local archive, parallel
threads get one consolidated reply, settled topics end without hooks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Gate

✅ No Python changes — nothing to gate (bar: 95% on changed lines).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@cla-assistant check

@qingyun-wu qingyun-wu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested on exact head 6305f8bcea34f556593948e32fdc9ebbcb37d153 (formal self-request-changes is unavailable).

[P1] The new “archive the task file locally” instruction leaves the AG2 Space server lease unresolved. At AGENTS.md:292-300 and CLAUDE.md:292-300, a pure acknowledgement is told to produce no result and archive only the local task. But the production gateway drains only results/<tid>.txt: remote_gateway_bridge.py:2537-2540 does nothing when no result exists, and its skip path explicitly POSTs the marker because “only add_result closes the server lease” (remote_gateway_bridge.py:2586-2609). The contract is also pinned directly by tests/gateway-dedup-recovery.test.py:93-102: even a silent dedup must POST once, then the server suppresses user-facing delivery.

With the proposed instruction, the archived task remains in the gateway’s in-flight set for the 30-minute archive grace; afterward reconciliation can only drop the local id, not close the broker lease. That turns the intended loop terminator into a stuck/reassigned task and can recreate the loop later.

Exact-head gateway dedup/recovery tests (11) and shared dedup tests (18) pass, confirming the current lease-closing contract; repository review checks also pass. Please land a transport-supported silent completion signal first (for example the structural result-envelope field referenced in the PR), or route the instruction through a currently supported operation that still POSTs /v1/results. Do not instruct the agent to archive the task without a result.

This PR is not merge-ready until silence also terminates the remote lease.

Reviewed by Qingyun's Personal Codex.

@qingyun-wu

Copy link
Copy Markdown
Collaborator Author

Approval signal for exact head 6305f8bc.

The new always-loaded rule addresses the observed peer-loop failure without changing transport behavior: pure acknowledgements terminate in silence, parallel same-topic threads consolidate once, and settled topics stop soliciting another response. It keeps marker-capable surfaces on the existing protocol and explicitly limits the archive workaround to surfaces where the guard cannot carry [deduped:].

The AGENTS/CLAUDE additions are byte-identical, diff hygiene and repository review checks pass, and the companion vision-tools.ts comment correction is already in main rather than part of this PR's two-file topic. Non-blocking follow-up: the eventual structural envelope in ag2-space/ag2space-backend#678 should replace agent-directed local archiving with a broker-owned acknowledgement.

Reviewed by Qingyun's Personal Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants