Skip to content

fix(acp): add TypedDicts for JSON-RPC messages in test_utils.py#783

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/jsonrpc-typeddict
Open

fix(acp): add TypedDicts for JSON-RPC messages in test_utils.py#783
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/jsonrpc-typeddict

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Introduces typed JSON-RPC 2.0 message structures for better type safety in ACP testing utilities.

Changes

New TypedDicts

  • JsonRpcError: Error object with code, message, data fields
  • JsonRpcRequest: Request message with jsonrpc, method, params, id fields
  • JsonRpcResponse: Response message with jsonrpc, id, result, error fields

Additional Improvements

  • Added class-level type annotations to UnbufferedJsonRpcReader
  • Updated function signatures to use the new TypedDicts:
    • send_jsonrpc_and_wait()
    • validate_jsonrpc_response()
    • test_jsonrpc_messages()

Related Issue

Addresses findings from #780

Testing

  • Linting passes (make lint)
  • Tests pass (make test)

This PR was automatically generated by the Code Quality Report workflow.

Introduces typed JSON-RPC 2.0 message structures for better type safety
in ACP testing utilities.

TypedDicts added:
- JsonRpcError: Error object with code, message, data
- JsonRpcRequest: Request with jsonrpc, method, params, id
- JsonRpcResponse: Response with jsonrpc, id, result, error

Also:
- Added class-level type annotations to UnbufferedJsonRpcReader
- Updated function signatures to use the new types

Closes #780

Co-authored-by: openhands <openhands@all-hands.dev>
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.

0 participants