Skip to content

Handle unresolved JSON parameter types#16

Open
adsharma wants to merge 1 commit into
mainfrom
issue_495
Open

Handle unresolved JSON parameter types#16
adsharma wants to merge 1 commit into
mainfrom
issue_495

Conversation

@adsharma
Copy link
Copy Markdown
Contributor

Summary

  • serialize Python JSON parameters under to_json() only when they contain unresolved type shapes like empty lists, empty dicts, or nulls
  • keep homogeneous arrays such as {"tags": [1, 2, 3]} on the normal typed binding path to avoid unnecessary stringify overhead
  • add regression coverage for empty nested lists and for preserving typed binding on homogeneous lists

Root Cause

Persisting a Python dict through to_json() can bind nested empty lists as LIST. The engine rejects vectors with ANY because binding is expected to resolve concrete types before persistence.

Validation

  • uv run pytest test/test_json.py -q
  • uv run pytest test.py -q
  • commit hooks: black, ruff check

Serialize to_json parameters only when Python JSON values contain unresolved type shapes such as empty lists, empty dicts, or nulls. This avoids LIST<ANY> failures while keeping homogeneous arrays on the normal typed binding path.
@adsharma adsharma changed the title [codex] Handle unresolved JSON parameter types Handle unresolved JSON parameter types May 18, 2026
@adsharma adsharma marked this pull request as ready for review May 18, 2026 00:50
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