pub(crate) async fn relay_inject(
base_url: &str,
http: &Client,
token: &str,
source_agent: &str,
target_agent: &str,
message: &str,
priority: &str,
wan: Option<&WanCarried>,
) -> RelayOutcomeExpand description
POST one injection to the cloud relay.
Deliberately takes base_url and token rather than resolving them
internally: that keeps this function a pure HTTP operation with no globals,
so the tests can point it at a stub relay without mutating process-wide env
(which would race the rest of the test binary).
§Contract (verified against the cloud relay)
source_agenttravels in theX-Agent-IDheader, not the body — the route 400s without it and derives the sender from it alone.X-Client-Wrapped: trueis required. Without it the cloud wraps the message in its own[JEKT:...]marker before storing; the receiving srv then wraps it again inHandler::inject_message, so the recipient sees a doubled marker. Sending raw + telling the cloud not to wrap yields exactly one marker, applied by the receiver — identical to how tiers 2 and 3 already behave.