@@ -411,13 +411,13 @@ def __init__(
411411 api_key : Optional [str ] = None , # Kept separate (connection/auth)
412412 # Tools
413413 tools : Optional [List [Any ]] = None ,
414- allow_delegation : bool = False ,
415- allow_code_execution : Optional [bool ] = False ,
416- code_execution_mode : Literal ["safe" , "unsafe" ] = "safe" ,
414+ allow_delegation : bool = False , # Deprecated: use handoffs= instead
415+ allow_code_execution : Optional [bool ] = False , # Deprecated: use execution=ExecutionConfig(code_execution=True)
416+ code_execution_mode : Literal ["safe" , "unsafe" ] = "safe" , # Deprecated: use execution=ExecutionConfig(code_mode="safe")
417417 handoffs : Optional [List [Union ['Agent' , 'Handoff' ]]] = None ,
418- # Session management
419- auto_save : Optional [str ] = None ,
420- rate_limiter : Optional [Any ] = None ,
418+ # Session management (deprecated standalone params - use config objects)
419+ auto_save : Optional [str ] = None , # Deprecated: use memory=MemoryConfig(auto_save="name")
420+ rate_limiter : Optional [Any ] = None , # Deprecated: use execution=ExecutionConfig(rate_limiter=obj)
421421 # ============================================================
422422 # CONSOLIDATED FEATURE PARAMS (agent-centric API)
423423 # Each follows: False=disabled, True=defaults, Config=custom
@@ -430,7 +430,7 @@ def __init__(
430430 web : Optional [Union [bool , Any ]] = None , # Union[bool, WebConfig]
431431 context : Optional [Union [bool , Any ]] = None , # Union[bool, ManagerConfig, ContextManager] - None=smart default
432432 autonomy : Optional [Union [bool , Dict [str , Any ], Any ]] = None , # Union[bool, dict, AutonomyConfig]
433- verification_hooks : Optional [List [Any ]] = None , # List of VerificationHook instances
433+ verification_hooks : Optional [List [Any ]] = None , # Deprecated: use autonomy=AutonomyConfig(verification_hooks=[...])
434434 output : Optional [Union [str , Any ]] = None , # Union[str preset, OutputConfig]
435435 execution : Optional [Union [str , Any ]] = None , # Union[str preset, ExecutionConfig]
436436 templates : Optional [Any ] = None , # TemplateConfig
@@ -453,12 +453,12 @@ def __init__(
453453 base_url: Custom LLM endpoint URL (e.g., for Ollama). Kept separate for auth.
454454 api_key: API key for LLM provider. Kept separate for auth.
455455 tools: List of tools, functions, callables, or MCP instances.
456- allow_delegation: Allow task delegation to other agents. Defaults to False .
457- allow_code_execution: Enable code execution during tasks. Defaults to False .
458- code_execution_mode: "safe" (restricted) or "unsafe" (full access). Defaults to "safe".
456+ allow_delegation: **Deprecated** — use ``handoffs=`` instead .
457+ allow_code_execution: **Deprecated** — use ``execution=ExecutionConfig(code_execution=True)`` .
458+ code_execution_mode: **Deprecated** — use ``execution=ExecutionConfig(code_mode= "safe")`` .
459459 handoffs: List of Agent or Handoff objects for agent-to-agent collaboration.
460- auto_save: Session name for automatic session saving .
461- rate_limiter: Rate limiter instance for API call throttling .
460+ auto_save: **Deprecated** — use ``memory=MemoryConfig(auto_save="name")`` .
461+ rate_limiter: **Deprecated** — use ``execution=ExecutionConfig(rate_limiter=obj)`` .
462462 memory: Memory system configuration. Accepts:
463463 - bool: True enables defaults, False disables
464464 - MemoryConfig: Custom configuration
@@ -487,7 +487,8 @@ def __init__(
487487 - bool: True enables with defaults
488488 - Dict: Configuration dict
489489 - AutonomyConfig: Custom configuration
490- verification_hooks: List of VerificationHook instances for output verification.
490+ verification_hooks: **Deprecated** — use ``autonomy=AutonomyConfig(verification_hooks=[...])``.
491+ Still works for backward compatibility.
491492 output: Output configuration. Accepts:
492493 - str: Preset name ("silent", "actions", "verbose", "json", "stream")
493494 - OutputConfig: Custom configuration
@@ -521,6 +522,11 @@ def __init__(
521522 - system_template, prompt_template, response_template → templates=
522523 - cache, prompt_caching → caching=
523524 - web_search, web_fetch → web=
525+ - allow_delegation → handoffs=
526+ - allow_code_execution, code_execution_mode → execution=
527+ - auto_save → memory=MemoryConfig(auto_save=)
528+ - rate_limiter → execution=ExecutionConfig(rate_limiter=)
529+ - verification_hooks → autonomy=AutonomyConfig(verification_hooks=)
524530 """
525531 # Add check at start if memory is requested
526532 if memory is not None :
@@ -585,6 +591,48 @@ def __init__(
585591 # AutonomyConfig is in agent/autonomy.py - use dict for config defaults
586592 autonomy = apply_config_defaults ("autonomy" , autonomy , None )
587593
594+ # ============================================================
595+ # DEPRECATION WARNINGS for params consolidated into configs
596+ # Old params still work but emit warnings pointing to new API
597+ # ============================================================
598+ import warnings as _warnings
599+
600+ if allow_delegation :
601+ _warnings .warn (
602+ "Parameter 'allow_delegation' is deprecated. Use 'handoffs=[other_agent]' instead." ,
603+ DeprecationWarning , stacklevel = 2 ,
604+ )
605+ if allow_code_execution :
606+ _warnings .warn (
607+ "Parameter 'allow_code_execution' is deprecated. "
608+ "Use 'execution=ExecutionConfig(code_execution=True)' instead." ,
609+ DeprecationWarning , stacklevel = 2 ,
610+ )
611+ if code_execution_mode != "safe" :
612+ _warnings .warn (
613+ "Parameter 'code_execution_mode' is deprecated. "
614+ "Use 'execution=ExecutionConfig(code_mode=\" unsafe\" )' instead." ,
615+ DeprecationWarning , stacklevel = 2 ,
616+ )
617+ if auto_save is not None :
618+ _warnings .warn (
619+ "Parameter 'auto_save' is deprecated. "
620+ "Use 'memory=MemoryConfig(auto_save=\" name\" )' instead." ,
621+ DeprecationWarning , stacklevel = 2 ,
622+ )
623+ if rate_limiter is not None :
624+ _warnings .warn (
625+ "Parameter 'rate_limiter' is deprecated. "
626+ "Use 'execution=ExecutionConfig(rate_limiter=obj)' instead." ,
627+ DeprecationWarning , stacklevel = 2 ,
628+ )
629+ if verification_hooks is not None :
630+ _warnings .warn (
631+ "Parameter 'verification_hooks' is deprecated. "
632+ "Use 'autonomy=AutonomyConfig(verification_hooks=[...])' instead." ,
633+ DeprecationWarning , stacklevel = 2 ,
634+ )
635+
588636 # ============================================================
589637 # CONSOLIDATED PARAMS EXTRACTION (agent-centric API)
590638 # Uses unified resolver: Instance > Config > Array > String > Bool > Default
@@ -731,6 +779,13 @@ def __init__(
731779 max_rpm = _exec_config .max_rpm
732780 max_execution_time = _exec_config .max_execution_time
733781 max_retry_limit = _exec_config .max_retry_limit
782+ # Extract consolidated fields (config takes precedence over deprecated standalone params)
783+ if _exec_config .rate_limiter is not None :
784+ rate_limiter = _exec_config .rate_limiter
785+ if _exec_config .code_execution :
786+ allow_code_execution = True
787+ if _exec_config .code_mode != "safe" :
788+ code_execution_mode = _exec_config .code_mode
734789 else :
735790 max_iter , max_rpm , max_execution_time , max_retry_limit = 20 , None , None , 2
736791
@@ -880,6 +935,9 @@ def __init__(
880935 db = _memory_config .db
881936 auto_memory = _memory_config .auto_memory
882937 claude_memory = _memory_config .claude_memory
938+ # Extract auto_save from MemoryConfig (takes precedence over standalone param)
939+ if _memory_config .auto_save is not None :
940+ auto_save = _memory_config .auto_save
883941 # Convert to internal format
884942 backend = _memory_config .backend
885943 if hasattr (backend , 'value' ):
@@ -1846,6 +1904,9 @@ def _init_autonomy(self, autonomy: Any, verification_hooks: Optional[List[Any]]
18461904 "auto_escalate" : autonomy .auto_escalate ,
18471905 }
18481906 config = autonomy
1907+ # Extract verification_hooks from AutonomyConfig if provided
1908+ if autonomy .verification_hooks and not verification_hooks :
1909+ self ._verification_hooks = autonomy .verification_hooks
18491910 else :
18501911 self .autonomy_enabled = False
18511912 self .autonomy_config = {}
0 commit comments