Skip to main content

Module correlation

Module correlation 

Source
Expand description

Opaque correlation ids and tool-class labels the node mints for a session’s provider events.

The ids are part of the wire contract: NodeRequest::ResolveInteraction answers an AgentStreamChunkKindV1::InteractionPrompt::correlation_id, and a client that derives its own telemetry from NodeEvent::Control must mint the very same id to line the two up. They live here, next to the request that consumes them, so the node and every client compute them through one function.

Every id is a short prefix plus the first eight bytes of a SHA-256 over the session identity and the provider’s own id, so the provider’s raw request or tool id never reaches the wire.

Functions§

interaction_correlation
Correlation id of one interaction (approval or question) of a session.
process_correlation
Correlation id of the provider process a session owns.
sanitize_progress_tool_label
Collapses a provider tool name into a small class label (Read, Write, Shell, …). Returns None for an empty name; sets truncated whenever the label differs from the trimmed input, so a reader can tell a generalised label from a verbatim one.
subagent_correlation
Correlation id of one provider-side subagent.
tool_class_label
The class label for a tool or request method, "Tool" when the name is empty.
tool_correlation
Correlation id of one provider tool call carried by event.
truncate_text
Cuts value to at most max_bytes on a character boundary. The returned flag says whether a cut happened; a caller that cuts is responsible for reporting it.