feat(resilience): guard OmniRoute peer routing loops (#7555)

* feat(resilience): guard OmniRoute peer routing loops

* refactor(resilience): fold peer-loop log+response into rejectPeerRequest helper (file-size budget on chat.ts)

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: Isiah Wheeler <2122839+isiahw1@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
This commit is contained in:
Isiah Wheeler
2026-07-18 20:19:50 -04:00
committed by GitHub
parent b5134f0b18
commit 987b6448f7
7 changed files with 352 additions and 0 deletions

View File

@@ -88,6 +88,14 @@ PORT=20128
# Used by: src/sse/utils/backpressure.ts — disabled when unset/0.
# OMNI_MAX_CONCURRENT_CONNECTIONS=0
# Optional OmniRoute-to-OmniRoute peer chaining guard. Give every instance a
# unique ID and allowlist only the other OmniRoute base URLs it may call.
# Requests to allowlisted peers carry X-OmniRoute-Peer-Trace; repeated instances
# and exhausted hop budgets are rejected with HTTP 508 before provider routing.
# OMNIROUTE_INSTANCE_ID=gateway-a
# OMNIROUTE_PEER_URLS=http://gateway-b:20128/v1
# OMNIROUTE_PEER_MAX_HOPS=4
# Port for the real-time WebSocket live monitoring server.
# Used by: src/server/ws/liveServer.ts, src/app/api/v1/ws/route.ts
# Default: 20132