Symptom
crew.replay() prints [CrewAIEventsBus] Warning: Ending event 'crew_kickoff_completed' emitted with empty scope stack. Missing starting event? The replay completion event reuses the original kickoff start id.
Evidence what you'll see
- A 2-task crew with mocked
Task.execute_syncloggedevents during kickoff: start-count=1 completed-count=1, then afterreplay(task_id)loggedevents during replay: starts=0andBUG: replay emitted NO CrewKickoffStartedEvent. - The same run printed
replay completed.started_event_id == first kickoff's start id: True.
Why it happens
replay() skips prepare_kickoff, which is the only place a CrewKickoffStartedEvent is emitted, but still emits CrewKickoffCompletedEvent(started_event_id=self._kickoff_event_id) from _create_crew_output. Pull request 8366 emits a new started event after _interpolate_inputs and stores its id before tasks run.
Affected versions
Reproduced on current main with a 2-task crew. The linked issue does not name a released crewAI version, operating system, or Python version.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- After
crew.replay(task_id), the event bus does not printEnding event 'crew_kickoff_completed' emitted with empty scope stack, and the completion event'sstarted_event_idis a new start from that replay.
If it still fails
- No published release tag contains pull request 8366. Tag
1.15.28was compared against merge9c24fda7f4and does not contain it. - The linked issue does not describe a remaining warning after that pull request. Listeners that key traces by the original kickoff start id will still see two completions on an unfixed tree.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it