helpers/persist_chat.py.dox.md
persist_chat.py helper module.persist_chat.py because this directory is intentionally flat.persist_chat.py owns the runtime implementation.persist_chat.py.dox.md owns durable notes about responsibilities, contracts, side effects, and verification for that implementation._fallback_datetime_iso() -> str_parse_persisted_datetime(value: str | None) -> datetimeget_chat_folder_path(ctxid: str): Get the folder path for any context (chat or task).get_chat_msg_files_folder(ctxid: str)save_tmp_chat(context: AgentContext): Save context to the chats foldersave_tmp_chats(): Save all contexts to the chats folderload_tmp_chats(): Load all contexts from the chats folder_get_chat_file_path(ctxid: str)_convert_v080_chats()load_json_chats(jsons: list[str]): Load contexts from JSON stringsexport_json_chat(context: AgentContext): Export context as JSON stringremove_chat(ctxid): Remove a chat or task contextremove_msg_files(ctxid): Remove all message files for a chat or task context_serialize_context(context: AgentContext)_serialize_agent(agent: Agent)_serialize_log(log: Log)_deserialize_context(data)_deserialize_agent_config(agent_data: dict[str, Any], fallback_config: AgentConfig) -> AgentConfig_deserialize_agents(agents: list[dict[str, Any]], config: AgentConfig, context: AgentContext) -> Agent_deserialize_log(data: dict[str, Any]) -> 'Log'_safe_json_serialize(obj, **kwargs)CHATS_FOLDER, LOG_SIZE, CHAT_FILE_NAME.agent, collections, datetime, helpers, helpers.localization, helpers.log, initialize, json, typing, uuid.agent_profile both at the context level for the main chat and on each serialized agent so subordinate profiles survive server restart.chat.json; malformed existing chat files still report load errors.datetime.fromtimestamp.isoformat, datetime.fromisoformat, files.get_abs_path, _get_chat_file_path, files.make_dirs, _serialize_context, _safe_json_serialize, files.write_file, _convert_v080_chats, files.list_files, get_chat_folder_path, files.delete_dir, get_chat_msg_files_folder, agent.history.serialize, initialize_agent, _deserialize_log, AgentContext, _deserialize_agent_config, _deserialize_agents, Log, log.set_initial_progress.tests/test_api_chat_lifetime.pytests/test_browser_agent_regressions.pytests/test_persist_chat_log_ids.pytests/test_subagent_profiles.pytests/test_tool_action_contracts.pyNo child DOX files.