Skip to content

Avoid pickle in LangGraph rollout logging#711

Open
Kovbo wants to merge 1 commit into
mainfrom
fix/langgraph-in-memory-logs
Open

Avoid pickle in LangGraph rollout logging#711
Kovbo wants to merge 1 commit into
mainfrom
fix/langgraph-in-memory-logs

Conversation

@Kovbo
Copy link
Copy Markdown
Collaborator

@Kovbo Kovbo commented Jun 4, 2026

A better solution for this issue.

Summary

Removes pickle serialization/deserialization from the LangGraph rollout logger. Structured LangGraph log entries now stay in memory for the duration of the wrapped rollout, while the existing readable text log is still written to disk.

Changes

  • Store structured FileLogger entries in memory instead of appending them to a .pkl file.
  • Pass the active FileLogger instance through wrap_rollout() into create_messages_from_logs() so LangChain objects are preserved without deserialization.
  • Add focused tests covering non-JSON-serializable log entries and the wrapper log-reader contract.

Test plan

  • uv run pytest tests/unit/test_langgraph_logging.py
  • uv run ruff check src/art/langgraph/logging.py src/art/langgraph/llm_wrapper.py tests/unit/test_langgraph_logging.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant