2.5 KiB
2.5 KiB
Bridge Sequence Flows (v1.1)
Actors
- Dingo (human)
- agentchattr
- bridge
- shard-adapter -> Shard runtime
- prime-adapter -> Prime runtime
Conversation-ID behavior note
- Inherit existing
conversation_idfor mapped reply/thread/job by default. - Create new
conversation_idfor new top-level conversation starts. - Fork to new
conversation_idonly on explicit fork or policy-triggered drift split.
Flow A: Unmentioned message (fanout to both)
- Dingo posts in
#general: "Status check" - bridge reads event from chattr
- bridge resolves targets =
[shard, prime](fanout policy) - bridge assigns/reuses
conversation_id - bridge builds envelope + handoff (if needed)
- bridge sends
POST /ingestto shard-adapter and prime-adapter - adapters inject into existing runtime sessions
- runtimes may respond (0/1/2 responses are all valid)
- adapters return response events with same
correlation_id - bridge posts responses back to chattr channel/thread
- bridge records audit + dedupe state
Flow B: Explicit mention to one actor
- Dingo posts: "@prime please review routing"
- bridge parses explicit target =
prime - bridge sends only to prime-adapter
- Prime response posted back with attribution
prime
Flow C: Cross-agent relay (prefer explicit mention)
- Prime response includes explicit
@shardask - bridge routes to shard-adapter (increment
hop_count) - Shard responds
- bridge posts response
- if loop controls trigger (hop/cycle/cooldown), bridge halts relay and posts loop-guard notice
Note: Agent-to-agent relay should generally require explicit mention to reduce noisy ping-pong.
Flow D: Surface switch handoff (Telegram -> chattr)
- Ongoing context exists on Telegram
- First message for same logical task arrives on chattr
- bridge attaches handoff packet:
- conversation_id
- task summary
- recent context window
- participants
- memory refs
- adapter injects handoff + message into existing runtime
- runtime answers with continuity preserved by handoff context
Flow E: Dedupe handling
- Duplicate delivery/event replay received by bridge
- dedupe_key matches processed entry
- bridge drops duplicate
- optional debug log entry only; no reroute
Suggested defaults
- max_hop_count: 4
- dedupe_ttl_sec: 600
- handoff_inactivity_min: 30
- handoff_max_msgs_without_refresh: 40
- handoff_max_payload_kb: 16
- adapter_timeout_sec: 45
- retry_max_attempts: 8
- relay_cooldown_sec: 5