-
Notifications
You must be signed in to change notification settings - Fork 336
Description
What happened?
We are encountering the same dependency conflict as #187.
Multiple customers of https://github.com/strands-agents/sdk-python have been trying to integrate with A2A and have experienced the same dependency conflict.
We've observed that opentelemetry-exporter-otlp-proto-http depends on protobuf<6.0 but a2a-python requires protobuf==6.31. In turn, pinning the version of protobuf will not mitigate these dependency conflicts.
NOTE: this impacts any a2a-python consumer who uses OTEL http exporters, this is not specific to the Strands agents SDK. This PR seeks to temporarily mitigate the dependency conflict. However, the side effect of this change is that OTEL http exporting will not work if a consumer uses Strands with the A2A python dependency.
Steps to reproduce:
- Clone from fork: https://github.com/jer96/sdk-python/tree/otel-issue
hatch shell devpip install -e ".[dev]"- enter python 3.12 repl
python - enter the following snippet in the python repl
from strands import Agent
from a2a.server.apps import A2AFastAPIApplication # this can be any import from a2a
- observe log output below
Relevant log output
(dev) ~/github/sdk-python otel-issue python
Python 3.12.7 (main, Oct 16 2024, 04:37:19) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from strands import Agent
>>> from a2a.server.apps import A2AFastAPIApplication, A2AStarletteApplication
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/apps/__init__.py", line 3, in <module>
from a2a.server.apps.jsonrpc import (
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/apps/jsonrpc/__init__.py", line 3, in <module>
from a2a.server.apps.jsonrpc.fastapi_app import A2AFastAPIApplication
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/apps/jsonrpc/fastapi_app.py", line 7, in <module>
from a2a.server.apps.jsonrpc.jsonrpc_app import (
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/apps/jsonrpc/jsonrpc_app.py", line 21, in <module>
from a2a.server.request_handlers.jsonrpc_handler import JSONRPCHandler
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/request_handlers/__init__.py", line 6, in <module>
from a2a.server.request_handlers.grpc_handler import GrpcHandler
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/server/request_handlers/grpc_handler.py", line 10, in <module>
import a2a.grpc.a2a_pb2_grpc as a2a_grpc
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/grpc/a2a_pb2_grpc.py", line 5, in <module>
from . import a2a_pb2 as a2a__pb2
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/a2a/grpc/a2a_pb2.py", line 12, in <module>
_runtime_version.ValidateProtobufRuntimeVersion(
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 106, in ValidateProtobufRuntimeVersion
_ReportVersionError(
File "/local/home/jerebill/.local/share/hatch/env/virtual/strands-agents/_dXqv6H0/dev/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 50, in _ReportVersionError
raise VersionError(msg)
google.protobuf.runtime_version.VersionError: Detected mismatched Protobuf Gencode/Runtime major versions when loading a2a.proto: gencode 6.31.1 runtime 5.29.5. Same major version is required. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.Code of Conduct
- I agree to follow this project's Code of Conduct