Skip to content

fix: handle unserializable objects in serialize_defaults#1527

Merged
ionmincu merged 3 commits intomainfrom
fix/serialize-defaults-unpicklable-dataclass
Mar 30, 2026
Merged

fix: handle unserializable objects in serialize_defaults#1527
ionmincu merged 3 commits intomainfrom
fix/serialize-defaults-unpicklable-dataclass

Conversation

@ionmincu
Copy link
Copy Markdown
Contributor

@ionmincu ionmincu commented Mar 30, 2026

Summary

  • Wraps serialize_defaults core logic in _serialize_defaults_inner with a top-level try/except that falls back to str(obj) on any failure
  • Prevents serialization errors (e.g. copy.deepcopy on unpicklable objects like _queue.SimpleQueue in httpx clients) from crashing callers like the tracing decorator
  • Root cause: dataclasses.asdict() uses copy.deepcopy internally, which fails when a dataclass (like LangGraph's ToolCallRequest) contains objects with unpicklable state
  • Bumps uipath-core to 0.5.10

Test plan

  • Added test for dataclass with unpicklable SimpleQueue field
  • All existing serialization tests pass (37 passed, 1 skipped)
  • Verify joke-agent sample runs without tracing crash

🤖 Generated with Claude Code

ionmincu and others added 2 commits March 30, 2026 17:34
Wrap the core logic in _serialize_defaults_inner and catch any exception
in the outer serialize_defaults, falling back to str(). This prevents
serialization failures (e.g. copy.deepcopy on unpicklable objects like
_queue.SimpleQueue in httpx clients) from crashing callers like tracing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime labels Mar 30, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ionmincu ionmincu merged commit 8c38313 into main Mar 30, 2026
159 of 161 checks passed
@ionmincu ionmincu deleted the fix/serialize-defaults-unpicklable-dataclass branch March 30, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants