Skip to content

Release v0.26.4#868

Merged
thomashebrard merged 2 commits into
mainfrom
release/v0.26.4
May 6, 2026
Merged

Release v0.26.4#868
thomashebrard merged 2 commits into
mainfrom
release/v0.26.4

Conversation

@thomashebrard
Copy link
Copy Markdown
Member

@thomashebrard thomashebrard commented May 6, 2026

Release v0.26.4

Bumps version from 0.26.3 to 0.26.4.

Changelog

Fixed

  • Temporal storage delivery no longer fails when working_memory_raw contains rehydrated Pydantic instances. WorkingMemory.dump_for_temporal() embeds __class__/__module__ markers on ListContent items so the receiving workflow can hydrate them. Kajson's Temporal data converter then eagerly rebuilds those dicts back into BaseModel instances (e.g. PageContent from Page[] outputs) on the activity worker that runs delivery — even though working_memory_raw is typed as dict[str, Any]. clean_json_content() previously walked only dicts/lists/scalars and let BaseModel instances reach json.dumps, which raised TypeError: Object of type PageContent is not JSON serializable and aborted act_deliver. clean_json_content now reduces any BaseModel it encounters via model_dump(serialize_as_any=True) (the canonical smart_dump path) before continuing the recursive walk.

Summary by cubic

Fixes a crash in Temporal delivery when working_memory_raw includes rehydrated Pydantic models by serializing them to JSON-safe dicts. Bumps version to 0.26.4.

  • Bug Fixes
    • clean_json_content now converts any BaseModel via model_dump(serialize_as_any=True) before recursion to avoid TypeError during json.dumps.
    • Added a unit test that includes PageContent in working_memory_raw and verifies the JSON output in delivery.

Written for commit dbe4a50. Summary will update on new commits.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 6, 2026

Greptile Summary

Bugfix release (0.26.30.26.4) that patches a TypeError in act_deliver when Kajson's Temporal data converter eagerly rehydrates BaseModel instances inside working_memory_raw.

  • clean_json_content (json_utils.py): adds an early isinstance(content, BaseModel) guard that flattens any rehydrated Pydantic model via model_dump(serialize_as_any=True) before the recursive dict/list walk, consistent with the existing purify_json/purify_json_dict approach.
  • New unit test: pins the exact regression — a PageContent object nested inside working_memory_raw[\"root\"][\"cv_pages\"][\"content\"] — and asserts the delivery output contains the expected field values.

Confidence Score: 5/5

Safe to merge — the change is a focused one-line guard with recursive fallback, well-tested, and consistent with established patterns in the file.

The fix is minimal and targeted: a single isinstance check added before the existing dict/list walk, using the same model_dump(serialize_as_any=True) path already used by purify_json and purify_json_dict. A dedicated regression test pins the exact failure mode. No other callsites are affected, and the version bump is consistent across pyproject.toml, uv.lock, and CHANGELOG.md.

No files require special attention.

Important Files Changed

Filename Overview
pipelex/tools/misc/json_utils.py Adds BaseModel guard at the top of clean_json_content; approach is correct and consistent with existing purify_json handling.
tests/unit/pipelex/pipe_run/test_delivery_executor.py New regression test accurately reproduces the Kajson-rehydration scenario and asserts correct output fields in working_memory.json.
pyproject.toml Version bumped from 0.26.3 to 0.26.4; no other changes.
CHANGELOG.md Changelog entry added for v0.26.4 with accurate description of the fix.

Sequence Diagram

sequenceDiagram
    participant TW as Temporal Worker
    participant KJ as Kajson Converter
    participant DE as DeliveryExecutor
    participant CJ as clean_json_content

    TW->>KJ: Deserialize working_memory_raw (dict[str, Any])
    KJ-->>TW: Rehydrates __class__ markers → BaseModel instances inside dict
    TW->>DE: act_deliver(working_memory_raw with BaseModel values)
    DE->>CJ: clean_json_dumps(working_memory_raw)
    CJ->>CJ: isinstance(content, BaseModel)? YES
    CJ->>CJ: model_dump(serialize_as_any=True) → plain dict
    CJ->>CJ: Recurse on plain dict (no more BaseModel)
    CJ-->>DE: JSON-safe structure
    DE-->>TW: working_memory.json delivered successfully
Loading

Reviews (1): Last reviewed commit: "Release v0.26.4" | Re-trigger Greptile

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@thomashebrard thomashebrard merged commit dba4d7f into main May 6, 2026
32 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
@thomashebrard thomashebrard deleted the release/v0.26.4 branch May 11, 2026 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants