feat: multi-directional agent orchestration#25
Merged
Conversation
c4a0ee8 to
1b621ec
Compare
… mailboxes Add communication network infrastructure enabling bidirectional, topology-rich agent communication. External agents can now proactively send messages back via callback URLs (reply_url pattern), solving the invocability asymmetry where only orchestrators could initiate. Phase 1 - Network foundation: CommunicationNetwork, NetworkParticipant, NetworkMessage models with Redis-backed context accumulation. Phase 2 - Three communication channels: synchronous calls, near-real-time messages (webhook push), and async mailboxes (polling). Callback endpoint enables external agents to push messages into the network. Phase 3 - Complex topologies: loop steps with convergence detection (similarity, approval, max iterations), fan-in aggregation (merge, vote, LLM summarize), and topology validation (mesh, star, ring). Phase 4 - A2A protocol alignment: Agent Card generation, JSON-RPC protocol adapter, and A2A-compatible endpoints for interoperability with Google's Agent-to-Agent protocol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1b621ec to
f2bdedb
Compare
Add discovery service that fetches remote A2A Agent Cards, registers
them in the Intuno registry, generates embeddings, and indexes them
in Qdrant. Imported A2A agents become fully discoverable, invocable,
and can join communication networks — identical to natively registered
agents.
New endpoints:
- POST /a2a/agents/import — import single agent by URL
- POST /a2a/agents/import/batch — import multiple agents
- POST /a2a/agents/{id}/refresh — re-fetch card and update
- GET /a2a/agents/fetch-card?url= — preview card without importing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add NETWORKS.md covering communication channels, topologies, workflow loops/aggregation, and the reply_url bidirectional pattern. Add A2A.md covering agent import, discovery, protocol mapping, and examples. Update PROJECT.md with new concepts and doc index. Update API_ENDPOINTS.md with all network, channel, callback, and A2A endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover the full network lifecycle: create network, add participants, exchange messages and mailbox items, verify shared context, bidirectional callbacks, multi-participant context sharing, A2A platform card, agent card generation, and agent-linked participants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add safety governance layer with kill switch and admin controls Add platform-wide emergency halt, per-agent kill switch, and admin API to enable ethical control over AI agent operations. This ensures all communication paths (broker, streaming, networks, A2A, workflows) can be shut down instantly when needed. - Add is_admin to User model with migration - Add SafetyService with Redis-backed platform halt and agent status cache - Add admin auth dependency (get_admin_user) - Add admin API: kill/reactivate agents, halt/resume platform, status - Expose is_active in AgentUpdate schema - Enforce platform halt check at all communication chokepoints - Fix streaming broker path missing is_active check - Add agent-level active checks in network channel validation - Add PlatformHaltedException (503) and AgentDisabledException (403) - Filter inactive agents in workflow resolver discovery Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add distributed halt codes and public safety endpoints Trustees can halt the platform with a code — no JWT needed. Codes are bcrypt-hashed, shown once on creation, and managed by admins. Asymmetric by design: easy to stop (code), hard to restart (admin auth). - Add HaltCode model and migration - Add public POST /safety/halt (code-authenticated) - Add public GET /safety/status - Add admin endpoints: create/list/revoke halt codes - Register safety router in main.py Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CommunicationNetwork) that groups agents into networks with shared conversational context, solving the invocability asymmetry where only orchestrators could initiate communicationreply_urlin every payload, enabling them to proactively push messages back into the network via callback endpointsloopstep type with convergence detection (similarity, approval, max iterations) for feedback cycles like writer/critic;aggregatestep type with fan-in strategies (merge, vote, LLM summarize); topology validation (mesh, star, ring)New modules
src/network/models/src/network/repositories/src/network/services/src/network/routes/src/network/utils/src/network/a2a/Modified files
src/workflow/models/dsl.py— AddedLoopConfig,AggregateConfig,ConvergenceConfigsrc/workflow/utils/orchestrator.py— Added_handle_loop()and_handle_aggregate()handlerssrc/workflow/utils/dsl_parser.py— Validation for loop/aggregate step typessrc/core/settings.py— 5 new network settingssrc/main.py— Mounted 4 new routers, updated/.well-known/agent.jsonTest plan
alembic upgrade headto verify migration applies cleanlyPOST /networks, add participants with callback URLsloopstep (writer/critic cycle) → verify convergenceaggregatestep → verify fan-in worksGET /.well-known/agent.jsonreturns updated platform cardGET /a2a/agent-card,POST /a2a/tasks/send🤖 Generated with Claude Code