Skip to content

fix: A2A v1.0 protobuf compatibility for executor and message validator#67

Merged
beonde merged 3 commits into
mainfrom
fix/a2a-v1-compatibility
May 13, 2026
Merged

fix: A2A v1.0 protobuf compatibility for executor and message validator#67
beonde merged 3 commits into
mainfrom
fix/a2a-v1-compatibility

Conversation

@beonde
Copy link
Copy Markdown
Member

@beonde beonde commented May 13, 2026

Summary

Fixes the SDK executor and message validator to work with A2A v1.0 protobuf format (migrated from v0.3 Pydantic). This was causing all test_real_executor.py tests to fail in CI (capiscio-e2e-tests "Cross-Product E2E Tests" job).

Production Changes

executor.py

  • Removed preserving_proto_field_name=True from MessageToDict — A2A v1 uses standard camelCase (per ADR-001 ProtoJSON serialization)
  • Added always_print_fields_with_no_presence=True to ensure empty fields serialize correctly
  • Updated field access to use camelCase (messageId instead of message_id)
  • Added getattr fallback chain for identifier extraction to handle both protobuf and non-protobuf message objects

validators/message.py

  • Updated VALID_ROLES from ["user", "agent"] to ["ROLE_USER", "ROLE_AGENT"] (A2A v1 protobuf enum format)
  • Rewrote _validate_parts() to use protobuf oneof detection (checks for presence of text/raw/url/data fields) instead of requiring a kind discriminator
  • Fixed oneof detection to filter with part.get(f) is not None instead of f in part to avoid false positives from None-valued keys
  • Updated optional field checks to use camelCase (contextId, taskId)

_rpc/process.py

  • Bumped CORE_VERSION from 2.6.0 to 2.7.0

Test Changes

  • Updated message validator fixtures to use A2A v1 format
  • Fixed process manager tests to mock workspace binary detection (dev binary at capiscio-core/bin/capiscio was bypassing mocked paths)
  • Added gRPC channel readiness check to MCP service integration tests
  • Added server health check fixtures to DV integration tests

Verification

All 477 tests pass locally (0 failed, 82 skipped for expected reasons like no running server/gRPC).

Breaking Changes

None. MessageValidator and VALID_ROLES are internal implementation details — no downstream repos import them directly. Checked: capiscio-mcp-python, a2a-demos, langchain-capiscio, capiscio-e2e-tests.

beonde added 2 commits May 13, 2026 13:31
- Remove preserving_proto_field_name from MessageToDict (use standard camelCase)
- Add always_print_fields_with_no_presence for empty field serialization
- Update VALID_ROLES to ROLE_USER/ROLE_AGENT (A2A v1 enum format)
- Rewrite _validate_parts() for protobuf oneof detection instead of kind discriminator
- Fix process manager _find_binary to handle None return from shutil.which
- Update message validator fixtures to use ROLE_USER/ROLE_AGENT and oneof parts
- Fix process manager tests to mock workspace binary detection
- Add gRPC channel readiness check to MCP service integration tests
- Add server health check fixtures to DV integration tests
Copilot AI review requested due to automatic review settings May 13, 2026 17:32
@github-actions
Copy link
Copy Markdown

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Aligns the SDK with the A2A v1.0 protobuf/ProtoJSON conventions (camelCase keys, SCREAMING_SNAKE_CASE enums, oneof-based Part content) so that the executor and message validator interop with messages produced by the new A2A v1 stack. This was breaking the cross-product E2E executor tests. Also bumps the bundled capiscio-core version to 2.7.0 and stabilizes a few integration tests.

Changes:

  • executor.py: switch MessageToDict to camelCase + always-print no-presence, and read messageId from the converted dict.
  • validators/message.py: replace kind-discriminator validation with protobuf oneof detection across text/raw/url/data, update VALID_ROLES to ROLE_USER/ROLE_AGENT, and use camelCase optional-field lookups.
  • Test/infra: bump CORE_VERSION to 2.7.0, harden process-manager unit tests against a present dev binary, add gRPC readiness check and server health-check fixtures to integration tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
capiscio_sdk/executor.py Use ProtoJSON camelCase when converting protobuf messages and reading messageId.
capiscio_sdk/validators/message.py Rewrite parts validation for A2A v1 oneof content; update valid roles and optional-field keys to camelCase.
capiscio_sdk/_rpc/process.py Bump CORE_VERSION from 2.6.0 to 2.7.0.
tests/unit/test_message_validator.py Update fixtures and tests to the A2A v1 ProtoJSON format and oneof semantics.
tests/unit/test_process.py Mock Path.exists for capiscio-core/bin so dev binary doesn't bypass the patched search path.
tests/integration/test_mcp_service.py Add channel_ready_future readiness probe so the fixture properly skips when gRPC server is absent.
tests/integration/test_dv_sdk.py Add module-scoped autouse server-health skip fixture.
tests/integration/test_dv_order_api.py Require server_health_check in the anonymous-order test for consistent skipping.

Comment thread capiscio_sdk/_rpc/process.py
Comment thread capiscio_sdk/executor.py Outdated
Comment thread capiscio_sdk/validators/message.py
@github-actions
Copy link
Copy Markdown

✅ All checks passed! Ready for review.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
capiscio_sdk/validators/message.py 83.33% 3 Missing ⚠️
capiscio_sdk/executor.py 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

✅ SDK server contract tests passed (test_server_integration.py). Cross-product scenarios are validated in capiscio-e2e-tests.

- executor.py: use getattr fallback for message_id/messageId to handle
  both protobuf and non-protobuf message objects
- validators/message.py: filter with part.get(f) is not None instead of
  f in part to avoid false positives from None-valued keys
@github-actions
Copy link
Copy Markdown

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link
Copy Markdown

✅ All checks passed! Ready for review.

@github-actions
Copy link
Copy Markdown

✅ SDK server contract tests passed (test_server_integration.py). Cross-product scenarios are validated in capiscio-e2e-tests.

@beonde beonde merged commit 1aa1e91 into main May 13, 2026
12 of 13 checks passed
@beonde beonde deleted the fix/a2a-v1-compatibility branch May 13, 2026 17:45
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.

2 participants