From 918654318b2fef9562bbbfc028c73eabe79c94fb Mon Sep 17 00:00:00 2001 From: Lucas Gomide Date: Wed, 25 Mar 2026 22:43:24 -0300 Subject: [PATCH] feat: add request_id to HumanFeedbackRequestedEvent (#5092) * feat: add request_id to HumanFeedbackRequestedEvent Allow platforms to attach a correlation identifier to human feedback requests so downstream consumers can deterministically match spans to their corresponding feedback records * feat: add request_id to HumanFeedbackReceivedEvent for correlation Without request_id on the received event, consumers cannot correlate a feedback response back to its originating request. Both sides of the request/response pair need the correlation identifier. --------- Co-authored-by: Alex --- lib/crewai/src/crewai/events/types/flow_events.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/crewai/src/crewai/events/types/flow_events.py b/lib/crewai/src/crewai/events/types/flow_events.py index 3eea1bbdd..d820b8a05 100644 --- a/lib/crewai/src/crewai/events/types/flow_events.py +++ b/lib/crewai/src/crewai/events/types/flow_events.py @@ -178,12 +178,15 @@ class HumanFeedbackRequestedEvent(FlowEvent): output: The method output shown to the human for review. message: The message displayed when requesting feedback. emit: Optional list of possible outcomes for routing. + request_id: Platform-assigned identifier for this feedback request, + used for correlating the request across system boundaries. """ method_name: str output: Any message: str emit: list[str] | None = None + request_id: str | None = None type: str = "human_feedback_requested" @@ -198,9 +201,12 @@ class HumanFeedbackReceivedEvent(FlowEvent): method_name: Name of the method that received feedback. feedback: The raw text feedback provided by the human. outcome: The collapsed outcome string (if emit was specified). + request_id: Platform-assigned identifier for this feedback request, + used for correlating the response back to its originating request. """ method_name: str feedback: str outcome: str | None = None + request_id: str | None = None type: str = "human_feedback_received"