Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 81.85% 81.89% +0.04%
==========================================
Files 96 96
Lines 9164 9190 +26
==========================================
+ Hits 7501 7526 +25
- Misses 1663 1664 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fernandocorreia-galileo
left a comment
There was a problem hiding this comment.
I have 2 minor points plus one concern about tool run_id collision.
| [tool.poetry.dependencies] | ||
| python = "^3.10,<3.15" | ||
| pydantic = "^2.12.0" | ||
| pydantic = "^2.11.9" |
There was a problem hiding this comment.
pydantic lower bound was changed from ^2.12.0 to ^2.11.9. The PR description doesn't explain why. If this is a crewai compatibility requirement, it should be mentioned. Widening dependency bounds without explanation risks introducing subtle compatibility issues.
There was a problem hiding this comment.
I've widened due to crew-ai constraints, so it would have a matching version.
There was a problem hiding this comment.
@Focadecombate what is the crew-ai constraint? Does it not work with pydantic >= 2.12.0?
There was a problem hiding this comment.
It was 2.11.9 as of yesterday.
Include agent_id in tool event hash to prevent UUID collisions when different agents call the same tool with identical arguments. Add type guard to memory query event detection to prevent false positives from other events that happen to have a query attribute.
The test was failing because error_event lacked agent_id which is used in the run_id hash computation for tool events.
User description
Shortcut: https://app.shortcut.com/galileo/story/56095
Description:
Adds support for CrewAI 1.9.3 with three key fixes:
crewai.utilities.events.*tocrewai.events.*. The handler now detects theinstalled version and imports from the correct path, with lazy imports preserved to
avoid pytest-xdist worker hangs.
__bases__assignment error: The lazy import approach from chore: change crew ai imports to be lazy #477dynamically reassigned
CrewAIEventListener.__bases__, which CPython rejects when thebase class has a different deallocator. Replaced with direct event bus registration
in
__init__— same behavior, no inheritance required._handle_llm_call_completednow extractsprompt_tokens,completion_tokens, andtotal_tokensfrom the response object (viaresponse.usage,response.model_extra["usage"], orsource._token_usagedictfallback).
event_id(unique peremission), producing different IDs for start vs finish events since CrewAI 1.9.3
doesn't populate
started_event_id/previous_event_idon end events. Now usesdeterministic
tool_name + tool_argshash soend_nodealways finds the matchingstarted node.
Tests:
user-facing feature, or fixing a bug)
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Updates the
CrewAIEventListenerto support CrewAI 1.9.3 by adapting to new event module paths and resolving a CPython error related to dynamic base class assignment. Enhances tracing accuracy and observability by implementing a robust, deterministic ID generation strategy for various event types and extracting detailed LLM token usage metrics.CrewAIEventListenerto register directly with the event bus instead of using dynamic inheritance, which resolves a CPython deallocator error. This also updates core dependencies to support the new CrewAI version.Modified files (3)
Latest Contributors(2)
CrewAIEventListenerby introducing a static_hash_to_uuidhelper and refining the_generate_run_idmethod. This new logic provides deterministic run ID generation for memory, LLM (usingcall_idfor CrewAI >= 1.0), and tool events (usingtool_name + tool_argshash), ensuring accurate linking of start and end events. Additionally, it enhances LLM call completion handling to extractprompt_tokens,completion_tokens, andtotal_tokensfrom various response structures, and adds support for logging memory retrieval failures. Robustness for parent ID resolution in agent, task, and tool events is also improved for CrewAI >= 1.0.Modified files (2)
Latest Contributors(2)