{"record":{"id":"acc590e77906d48d","repo":"microsoft/autogen","slug":"current-message-list-doesn-t-match-the-recorded-me","errorCode":null,"errorMessage":"Current message list doesn't match the recorded message list. See the pagelogs for details.","messagePattern":"Current message list doesn't match the recorded message list\\. See the pagelogs for details\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/experimental/task_centric_memory/utils/chat_completion_client_recorder.py","lineNumber":134,"sourceCode":"                error_str = \"\\nNo more recorded turns to check.\"\n                self.logger.error(error_str)\n                raise ValueError(error_str)\n            rec = self.records[self._record_index]\n            if rec.get(\"mode\") != \"create\":\n                error_str = f\"\\nRecorded call type mismatch at index {self._record_index}: expected 'create', got '{rec.get('mode')}'.\"\n                self.logger.error(error_str)\n                raise ValueError(error_str)\n            recorded_messages = rec.get(\"messages\")\n            if recorded_messages != current_messages:\n                error_str = (\n                    \"\\nCurrent message list doesn't match the recorded message list. See the pagelogs for details.\"\n                )\n                assert recorded_messages is not None\n                self.logger.log_dict_list(recorded_messages, \"recorded message list\")\n                assert current_messages is not None\n                self.logger.log_dict_list(current_messages, \"current message list\")\n                self.logger.error(error_str)\n                raise ValueError(error_str)\n            self._record_index += 1\n            self._num_checked_records += 1\n\n            data = rec.get(\"response\")\n            # Populate a CreateResult from the data.\n            assert data is not None\n            result = CreateResult(\n                content=data.get(\"content\", \"\"),\n                finish_reason=data.get(\"finish_reason\", \"stop\"),\n                usage=data.get(\"usage\", RequestUsage(prompt_tokens=0, completion_tokens=0)),\n                cached=True,\n            )\n            return result\n\n        else:\n            error_str = f\"\\nUnknown mode: {self.mode}\"\n            self.logger.error(error_str)\n            raise ValueError(error_str)","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/experimental/task_centric_memory/utils/chat_completion_client_recorder.py#L116-L152","documentation":"Thrown by ChatCompletionClientRecorder in 'replay' mode when the message list sent to create() differs from the one captured in the recorded session file. The recorder is a test/replay harness that verifies deterministic agent behavior; any divergence between the live message flow and the recording aborts with this ValueError. Both lists are dumped to the pagelogs so you can diff them.","triggerScenarios":"Running a replay-mode session where the agent code, prompts, tools, or model configuration changed after the session was recorded; or where non-deterministic content (timestamps, random IDs, dict ordering) leaks into messages. Also triggered if create() is called in a different order/number of times than recorded.","commonSituations":"Editing agent logic or system prompts without re-recording the session; upgrading autogen versions that change message serialization; nondeterministic LLM responses because temperature wasn't pinned; extra middleware/tool calls adding messages between recorded turns.","solutions":["Open the pagelogs and diff the 'recorded message list' against the 'current message list' to find the first divergent message.","If the divergence is an intended code/prompt change, re-record the session in 'record' mode to produce a fresh session file.","Pin non-determinism: set temperature=0, seed if supported, and strip timestamps/UUIDs from message content before replaying.","Ensure the exact same agent pipeline (tools, memory hooks, middleware) is active during replay as during recording."],"exampleFix":"// before\nclient = ChatCompletionClientRecorder(base_client, mode=\"replay\", session_file_path=\"session.json\")\n// after: re-record after any prompt/code change\nclient = ChatCompletionClientRecorder(base_client, mode=\"record\", session_file_path=\"session.json\")\n# run the scenario once to capture, then switch mode back to \"replay\"","handlingStrategy":"validation","validationCode":"# before replay, sanity-check the session file matches the current scenario\nimport json\nwith open(session_file_path) as f:\n    records = json.load(f)\nassert all(\"messages\" in r and \"response\" in r for r in records), \"stale or corrupt session file\"","typeGuard":null,"tryCatchPattern":"try:\n    result = await recorder_client.create(messages)\nexcept ValueError as e:\n    if \"doesn't match the recorded message list\" in str(e):\n        # divergence: inspect pagelogs, then re-record the session\n        recorder_client = ChatCompletionClientRecorder(client, mode=\"record\", session_file_path=session_file_path)\n    else:\n        raise","preventionTips":["Re-record sessions whenever prompts, tools, or agent code change.","Pin temperature=0 and strip nondeterministic fields (timestamps, UUIDs) from messages before replay.","Keep the recording and replay environments on the same autogen version."],"tags":["autogen","replay","testing","determinism"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}