Expand description
SinkMiddleware — the SpawnerLayer for the Data plane (Big Response
handling).
§Role
A SpawnerLayer that bridges crate::store::output (the Data owner) and
the Agent execution boundary. Just before spawn it injects a Data-plane
endpoint hint into Ctx.meta.runtime, giving SubAgents a place to POST
Big Response bodies (4k-token payloads, files, intermediate artifacts)
directly into the store, bypassing MainAgent.
It does not touch the Domain path (the engine’s submit_output /
output_tail / dispatch verdict). The flow stays as-is; this layer is
strictly additive and runs alongside (the Data / Domain separation axis).
For the canonical narrative see the crate::store::output module doc.
§Pattern
Same shape as AgentResolver and ProjectNameAliasMiddleware: edit ctx,
call the inner spawner, done. Engine state is not touched.
§Implementation status
- Current (scaffold):
SpawnerLayertrait impl plus the endpoint hint injection intoCtx.meta.runtime. TheArc<dyn OutputStore>reference is held in config, but the real intake path (thePOST /v1/data/emitHTTP handler routed toOutputStore::append) is still a carry. - Carry: add the Big Data endpoint on the
mlua-swarm-serverside, wire the SubAgent-side EMIT tool call driven by theagent.mdcontract, and thread it through end-to-end.
Structs§
- Sink
Middleware - Data-plane
SpawnerLayer. Config: the store to reference plus the endpoint hint.
Constants§
- DATA_
SINK_ ENDPOINT_ KEY - Key under
ctx.meta.runtimethat carries the Data-plane endpoint hint.