mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-22 07:15:10 +00:00
fix: keep crew output typed across boundary hook dispatch
`_create_crew_output` reassigned `crew_output` from the hook contexts' `payload`, which is typed `Any`, so mypy flagged `no-any-return` at the function's return. Cast the payload back to `CrewOutput` after each dispatch and split the `ExecutionEndContext` construction to satisfy `ruff format`'s line-length limit.
This commit is contained in:
@@ -1920,11 +1920,13 @@ class Crew(FlowTrackable, BaseModel):
|
||||
|
||||
output_ctx = OutputContext(crew=self, output=crew_output, payload=crew_output)
|
||||
dispatch(InterceptionPoint.OUTPUT, output_ctx)
|
||||
crew_output = output_ctx.payload
|
||||
crew_output = cast(CrewOutput, output_ctx.payload)
|
||||
|
||||
end_ctx = ExecutionEndContext(crew=self, output=crew_output, payload=crew_output)
|
||||
end_ctx = ExecutionEndContext(
|
||||
crew=self, output=crew_output, payload=crew_output
|
||||
)
|
||||
dispatch(InterceptionPoint.EXECUTION_END, end_ctx)
|
||||
crew_output = end_ctx.payload
|
||||
crew_output = cast(CrewOutput, end_ctx.payload)
|
||||
|
||||
# Ensure background memory saves finish (and emit their
|
||||
# completed/failed events) before the kickoff-completed event below
|
||||
|
||||
Reference in New Issue
Block a user