Repository navigation
Conversation
Strix Security ReviewWarning This pull request has 23 commits after the last Strix review ( ✅ No open security findings. PR summary: Adds a `_parse_status_timestamp` helper in the A2A task utilities that normalizes task status timestamps to aware UTC datetimes, and uses it for both the `list_tasks` timestamp filter and sort key, plus normalizing a naive `status_timestamp_after` cutoff. This removes the `TypeError` raised when tasks mixed aware timestamps with missing ones, and adds tests for the mixed, naive-cutoff, and aware-cutoff cases. Review summaryThis PR fixes a crash in the A2A Review 1 on this PR · Reviewed by Strix |
2f3babb to
faf2a21
Compare
|
Friendly ping for a review when you have a moment. All bot checks are green and the PR is mergeable; happy to adjust anything. |
faf2a21 to
f547cd2
Compare
Related issue
Fixes #8735
Summary
list_tasksraisedTypeError: can't compare offset-naive and offset-aware datetimeswhen the task list mixed tasks carrying aware ISO timestamps with tasks without a timestamp (the sort key returned naivedatetime.min), and when callers passed a naivestatus_timestamp_after. This PR normalizes status timestamps to aware UTC in a single helper used by both the sort key and the timestamp filter, and normalizes a naive cutoff at entry. Missing timestamps still sort as the oldest instant and are still exempt from the time filter — semantics unchanged, crash removed.Verification
lib/crewai/tests/a2a(104 passed): new tests cover mixed aware/missing-timestamp sorting, a naive cutoff, and an aware cutoff. The mixed-sort and naive-cutoff tests fail withTypeErroron the old code.ruff checkclean on changed files.Disclosure: this PR was produced with AI assistance (ZCode agent) and human-reviewed — please apply the
llm-generatedlabel.Additional context
None
From ZCode
Note
Low Risk
Targeted datetime normalization in an A2A listing utility with preserved behavior and new regression tests; no auth or data-path changes.
Overview
Fixes
TypeErrorwhenlist_taskssorted or filtered tasks whose status timestamps mixed timezone-aware ISO strings with missing timestamps, or when callers passed a naivestatus_timestamp_after.Introduces
_parse_status_timestampso every comparison uses UTC-aware datetimes: missing timestamps map to the oldest instant, naive parsed values are treated as UTC, and the cutoff datetime is normalized at entry. Sorting and the “updated after” filter both go through this helper; ordering and filter semantics for missing timestamps are unchanged.Adds unit tests for mixed aware/missing-timestamp sort order, naive cutoffs, and aware time filtering.
Reviewed by Cursor Bugbot for commit f547cd2. Bugbot is set up for automated code reviews on this repo. Configure here.