Skip to content

fix(predict-rlm): serialize Pydantic JSPI tool results - #56

Merged
magix022 merged 1 commit into
mainfrom
fix/jspi-pydantic-tool-results
Jul 22, 2026
Merged

fix(predict-rlm): serialize Pydantic JSPI tool results#56
magix022 merged 1 commit into
mainfrom
fix/jspi-pydantic-tool-results

Conversation

@magix022

Copy link
Copy Markdown
Collaborator

Rationale

JSPI converted Pydantic host-tool results to model repr strings and could not serialize Pydantic values nested in otherwise JSON-shaped results. This prevented sandbox code from consuming retrieval results as mappings.

Summary

  • Normalize JSPI tool results with to_plain_data() before JSON-RPC serialization.
  • Cover top-level Pydantic results and Pydantic values nested in a returned mapping/list.

Test Plan

  • uv run pytest tests/test_interpreter.py::TestPydanticSerialization -v
  • uv run pytest tests/test_interpreter.py -v
  • uv run ruff check src/predict_rlm/backends/jspi/backend.py tests/test_interpreter.py

@magix022
magix022 merged commit 28f38c4 into main Jul 22, 2026
8 checks passed
@magix022
magix022 deleted the fix/jspi-pydantic-tool-results branch July 22, 2026 18:34
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