[BUG] Crew.akickoff still does not await async kickoff callbacks (follow-up to #6481)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 58.8k
- Forks
- 8.5k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 109
Description
Description
Crew.akickoff() does not await async before/after kickoff callbacks. An async before-callback's body is not executed when called by synchronous preparation; an async after-callback replaces the result with an unawaited coroutine before post-processing. This report continues #6481, which was closed for inactivity, not because a fix was merged.
Steps to Reproduce
- Create an otherwise working sequential Crew with a task and its assigned agent.
- Attach the async callback below to
after_kickoff_callbacks. - Run
result = await crew.akickoff(). - Check whether the callback executed and the result remains a
CrewOutput. Repeat with an async before-callback returning the input dict.
Expected behavior
The native async path awaits awaitable callback results, applies returned inputs/output, and executes each callback once. Synchronous callbacks retain their existing behavior. Offloading blocking synchronous callbacks is outside this report's scope.
Screenshots/Code snippets
called = False
async def after_callback(output):
global called
called = True
return output
# Given an otherwise working Crew:
crew.after_kickoff_callbacks = [after_callback]
result = await crew.akickoff()
assert called
Operating System
Original report: macOS Sonoma. Current verification is source inspection, not a new OS-specific runtime reproduction.
Python Version
Original report: 3.12.
crewAI Version
Originally reported on 1.15.2; source inspected again on 2026-09-19 at main commit 3831e8b6c86f78cb3cde18ebf7be0d197b958f0e.
crewAI Tools Version
Not required: this concerns core Crew kickoff callbacks.
Virtual Environment
Venv (original report).
Evidence
Current main still calls synchronous prepare_kickoff in akickoff and directly assigns result = after_callback(result) without awaiting it: https://github.com/crewAIInc/crewAI/blob/3831e8b6c86f78cb3cde18ebf7be0d197b958f0e/lib/crewai/src/crewai/crew.py#L1275-L1289 . No fresh full-suite test run is claimed here.
Independent historical verification by ErenAta16 on #6500 covered (1) a callback returning None, (2) empty callbacks with inputs=None, and (3) the synchronous control case. The reviewer confirmed the distinct sentinel prevents duplicate callback execution and recommended retaining it: https://github.com/crewAIInc/crewAI/pull/6500#issuecomment-5049732531 . This is historical review evidence, not a maintainer approval of the latest rebased revision.
Possible Solution
Resume review of #6500: await an async preparation entry point and await after-callback results when awaitable. Preserve callback-chain None semantics and exactly-once execution. Validate current hook ordering and regressions against current main before merging.
Additional context
Five related implementation attempts are #6482, #6494, #6500, #6547, and #6697. All five are currently closed and none is recorded as merged. This is not a claim that their technical merits are identical.
Original report: #6481. It was automatically closed for inactivity on August 28. On September 17, #6500 was automatically closed because first-time contributors require an associated OPEN issue. The bot explicitly allows reopening after linking an open issue: https://github.com/crewAIInc/crewAI/pull/6500#issuecomment-5709744042 . This report supplies that active tracking issue while preserving the existing review history.
At inspection, #6500 head 7c202258fde62b7502403c09204f304062fb79e9 is 9 commits behind main; it is not claimed to be fully up to date.
AI disclosure: this issue was prepared with OpenAI Codex. The llm-generated label is requested per CONTRIBUTING.md.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The relevant entry point is lib/crewai/src/crewai/crew.py, especially akickoff and the synchronous prepare_kickoff path. Read the callback handling and historical #6500 discussion first, then verify hook ordering and callback-chain None behavior on current main. Done means async before/after callbacks execute once, awaitable results are applied, CrewOutput remains intact, and synchronous behavior is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100