diff --git a/src/controlflow/decorators.py b/src/controlflow/decorators.py index 9629218..8cbf703 100644 --- a/src/controlflow/decorators.py +++ b/src/controlflow/decorators.py @@ -76,7 +76,7 @@ def flow( sig = inspect.signature(fn) def create_flow_context(bound_args): - flow_kwargs: dict[str, Any] = {} + flow_kwargs: dict[str, Any] = kwargs.copy() if thread is not None: flow_kwargs["thread_id"] = thread if tools is not None: @@ -143,7 +143,7 @@ def task( retries: Optional[int] = None, retry_delay_seconds: Optional[Union[float, int]] = None, timeout_seconds: Optional[Union[float, int]] = None, - **kwargs: Any, + **task_kwargs: Any, ) -> Callable[[Callable[P, R]], PrefectTask[P, R]]: """ A decorator that turns a Python function into a Task. The Task objective is @@ -204,7 +204,7 @@ def _get_task(*args, **kwargs) -> Task: result_type=result_type, interactive=interactive or False, tools=tools or [], - **kwargs, + **task_kwargs, ) if asyncio.iscoroutinefunction(func):