pub fn resolve_user_id(
messages: &[Message],
provided: Option<&str>,
) -> Option<String>Expand description
Resolve the acting user id for a batch of messages, mirroring
ScopedContentProcessor._map_messages’s resolution order (minus the
bearer-token-JWT fallback this port doesn’t perform — see the crate
docs):
- The first message whose
additional_properties["user_id"]is a valid GUID wins outright. - Otherwise, the first message whose
author_nameis a valid GUID is remembered as a fallback candidate (scanning continues, in case a later message has an explicituser_id). - If neither produced a value,
providedis used if it is itself a valid GUID. - Otherwise
None— callers must treat this as “cannot evaluate; do not block” (seeContentProcessor::evaluate), matching Python’s fail-open behavior when no resolvable user id exists.