From e4d0c62f02f4c56880f3925de9d604161aa6bc27 Mon Sep 17 00:00:00 2001 From: iabshailley Date: Tue, 31 Mar 2026 21:56:42 -0700 Subject: [PATCH] fix: pass initial state via kickoff(inputs=) for CrewAI 1.10.1 compatibility CrewAI 1.10.1 removed the setter on Flow.state, making direct assignment (`flow.state = BookingState(...)`) raise a TypeError at runtime. Pass the campaign brief through kickoff(inputs=...) instead, which is the correct API for initialising flow state in this version. Co-Authored-By: Claude Sonnet 4.6 --- src/ad_buyer/interfaces/api/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ad_buyer/interfaces/api/main.py b/src/ad_buyer/interfaces/api/main.py index 61acb72..f3eda9e 100644 --- a/src/ad_buyer/interfaces/api/main.py +++ b/src/ad_buyer/interfaces/api/main.py @@ -545,13 +545,12 @@ async def _run_booking_flow(job_id: str, request: BookingRequest) -> None: client = _create_client() flow = DealBookingFlow(client, store=_get_store()) - flow.state = BookingState(campaign_brief=request.brief.model_dump()) # Store flow reference for approval job["_flow"] = flow job["progress"] = 0.2 - result = flow.kickoff() + result = flow.kickoff(inputs={"campaign_brief": request.brief.model_dump()}) job["progress"] = 0.8 job["budget_allocations"] = {