Skip to content

Add typed call responses and validated acknowledgements - #2

Merged
atomiechen merged 2 commits into
mainfrom
codex/typed-contract
Sep 24, 2026
Merged

atomiechen merged 2 commits into
mainfrom
codex/typed-contract

Conversation

@atomiechen

Copy link
Copy Markdown
Owner

Summary

  • Validate and serialize Pydantic request data passed to call() across sync and async Server/Client APIs.
  • Add optional response_model validation for acknowledgements and validate handler return annotations before serializing model responses.
  • Preserve native Socket.IO arguments, tuple acknowledgements, Python 3.8 support, and the existing monkey patch path.

Verification

  • 12 tests passed locally, including a real client/server round trip in both directions.
  • Python 3.8 runtime smoke check passed with the locked dependencies.
  • Ruff and Pyright type assertions passed.

Related to #1. Thanks @PythonFZ for the typed response and handler return validation proposal.

atomiechen and others added 2 commits September 24, 2026 23:19
Add request validation and model serialization to call(), validate typed acknowledgements, and serialize validated handler responses across sync and async APIs. Preserve Python 3.8 support and verify runtime and static contracts.

Co-authored-by: Fabian Zills <fzills@icp.uni-stuttgart.de>
@atomiechen
atomiechen merged commit 17b91be into main Sep 24, 2026
18 checks passed
@atomiechen
atomiechen deleted the codex/typed-contract branch September 27, 2026 12:42
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