{"record":{"id":"f46c706740bca998","repo":"huggingface/smolagents","slug":"parameter-messages-is-deprecated-and-will-be-rem","errorCode":null,"errorMessage":"Parameter 'messages' is deprecated and will be removed in version 1.25. Please use 'steps' instead.","messagePattern":"Parameter 'messages' is deprecated and will be removed in version 1\\.25\\. Please use 'steps' instead\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"src/smolagents/agents.py","lineNumber":222,"sourceCode":"        timing (Timing): Timing details of the agent run: start time, end time, duration.\n        messages (list[dict]): The agent's memory, as a list of messages.\n            <Deprecated version=\"1.22.0\">\n            Parameter 'messages' is deprecated and will be removed in version 1.25. Please use 'steps' instead.\n            </Deprecated>\n    \"\"\"\n\n    output: Any | None\n    state: Literal[\"success\", \"max_steps_error\"]\n    steps: list[dict]\n    token_usage: TokenUsage | None\n    timing: Timing\n\n    def __init__(self, output=None, state=None, steps=None, token_usage=None, timing=None, messages=None):\n        # Handle deprecated 'messages' parameter\n        if messages is not None:\n            if steps is not None:\n                raise ValueError(\"Cannot specify both 'messages' and 'steps' parameters. Use 'steps' instead.\")\n            warnings.warn(\n                \"Parameter 'messages' is deprecated and will be removed in version 1.25. Please use 'steps' instead.\",\n                FutureWarning,\n                stacklevel=2,\n            )\n            steps = messages\n\n        # Initialize with dataclass fields\n        self.output = output\n        self.state = state\n        self.steps = steps\n        self.token_usage = token_usage\n        self.timing = timing\n\n    @property\n    def messages(self):\n        \"\"\"Backward compatibility property that returns steps.\"\"\"\n        warnings.warn(\n            \"Parameter 'messages' is deprecated and will be removed in version 1.25. Please use 'steps' instead.\",","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/agents.py#L204-L240","documentation":"MultiStepStep (agent memory step) renamed its 'messages' constructor parameter to 'steps'. Passing messages=... emits this FutureWarning (removal in 1.25) and copies the value into steps; passing both messages and steps raises a ValueError instead. It exists purely as a deprecation bridge.","triggerScenarios":"Constructing MultiStepStep(output=..., messages=[...]) or copying old serialization dicts that include a 'messages' key, after upgrading smolagents.","commonSituations":"Upgrading from pre-rename smolagents; pickled/JSON-serialized memory steps rehydrated with old field names; tutorials with legacy code.","solutions":["Rename the keyword: pass steps=[...] instead of messages=[...]","Silence during migration with warnings.filterwarnings('ignore', category=FutureWarning, module='smolagents')","Update any persistence/serialization layer that writes the old 'messages' key"],"exampleFix":"# before\nstep = MultiStepStep(output=res, messages=messages)\n\n# after\nstep = MultiStepStep(output=res, steps=messages)","handlingStrategy":"validation","validationCode":"step = MultiStepStep(output=res, **{'steps' if 'messages' in kwargs else 'steps': kwargs.get('steps', kwargs.get('messages'))) if False else MultiStepStep(output=res, steps=kwargs.get('steps', kwargs.get('messages')))","typeGuard":null,"tryCatchPattern":"import warnings\nwith warnings.catch_warnings():\n    warnings.simplefilter('ignore', FutureWarning)\n    step = MultiStepStep(output=res, messages=msgs)  # temporary shim","preventionTips":["Migrate constructors to steps= immediately after upgrade","Add a lint grep for 'messages=' against smolagents types","Pin warnings-as-errors off until migration completes"],"tags":["smolagents","deprecation","future-warning","agents"],"backgroundTag":"deprecated-parameter-renamed","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}