Skip to content

Add mypy typechecking and improve error handling#247

Open
rocky-jaiswal wants to merge 6 commits into
mainfrom
chore/adopt-mypy-and-minor-fixes
Open

Add mypy typechecking and improve error handling#247
rocky-jaiswal wants to merge 6 commits into
mainfrom
chore/adopt-mypy-and-minor-fixes

Conversation

@rocky-jaiswal

Copy link
Copy Markdown
Contributor

Summary

Adopts static type checking (mypy) for the eggai package as a CI gate, plus the annotation cleanups required to make it pass. Along the way this fixes a couple of error paths.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

QualOps Code Quality Analysis

Status: ⚠️ FAILED - Critical or high severity issues found

Summary

  • Total Issues: 27
  • Critical: 0 🔴
  • High: 4 🟠
  • Medium: 16 🟡
  • Low: 7 🟢
  • Files Analyzed: 20

🟠 High Issues (4)

  • sdk/eggai/channel.py:104 - bug
    Transport is subscribed before the connection is established, which may cause the subscription to fail or behave incorrectly if the transport requires an active connection first.

  • sdk/eggai/hooks.py:90 - bug
    Signal handler lambda captures sig loop variable incorrectly, always using the last value of sig in the fallback signal.signal path.

  • sdk/eggai/transport/redis.py:562 - bug
    When retry_on_idle_ms is set but group is None (i.e., handler_id is None and no explicit group was passed), the reclaimer is set up with group=None, which will likely cause a runtime error or silent misbehavior in the reclaimer and the Redis XAUTOCLAIM/XPENDING commands that require a valid group name.

  • sdk/eggai/transport/kafka.py:148 - performance
    The force_metadata_update() call is made synchronously on the internal aiokafka client without any timeout, which can block the event loop if the Kafka broker is slow or unreachable.

🟡 Medium Issues (16)

  • sdk/eggai/adapters/a2a/executor.py:36 - security
    A2A error response leaks the complete list of registered skill handler names to any caller, enabling full skill-surface enumeration.

  • sdk/eggai/adapters/a2a/executor.py:54 - bug
    When data_type has __args__ but validation fails, the code still attempts to instantiate data_type(source=..., type=..., data=validated_data) with the raw dict, which may raise a TypeError or validation error if the constructor expects a validated model instance.

  • sdk/eggai/adapters/a2a/plugin.py:50 - bug
    subscribe() raises ValueError when data_type is None, but register_skill() accepts data_type: type | None, making the None case unreachable through the normal path and the error message misleading.

...and 13 more medium issues

📊 Full Report

View detailed report


Powered by QualOps

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