Skip to content

feat: add proto-plus message serialization support in EventSerializer…#485

Merged
Focadecombate merged 7 commits intomainfrom
bug/sc-55119/galileo-callback-does-not-show-tool-when-run
Feb 25, 2026
Merged

feat: add proto-plus message serialization support in EventSerializer…#485
Focadecombate merged 7 commits intomainfrom
bug/sc-55119/galileo-callback-does-not-show-tool-when-run

Conversation

@Focadecombate
Copy link
Contributor

@Focadecombate Focadecombate commented Feb 23, 2026

User description

Shortcut: sc-55119

Description:

The GalileoCallback (and other handlers using EventSerializer) would produce empty objects {} when serializing proto-plus messages (e.g. google.cloud.aiplatform
types). This happens because proto-plus Message objects store their data internally via protobuf descriptors rather than in __dict__, so the generic __dict__ fallback
in EventSerializer would find nothing to serialize.

This PR adds explicit handling for proto.Message instances in EventSerializer, using proto.Message.to_dict() to correctly convert them to plain dictionaries before JSON
encoding. The proto dependency check is lazy to avoid impacting users who don't use Google Cloud AI Platform or other proto-plus libraries.

Changes:

  • Add is_proto_plus_available dependency check in dependencies.py
  • Add proto.Message serialization branch in EventSerializer.default(), placed before the __slots__ fallback
  • Add tests covering simple, empty, and nested proto-plus message serialization

After change
image

Tests:

  • Unit Tests Added
  • E2E Test Added (if it's a user-facing feature, or fixing a bug)

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Enhances the GalileoCallback to correctly capture tool calls and token metrics when using ChatVertexAI by adding support for proto-plus message serialization. Updates the EventSerializer and LangChain handlers to handle GCP-specific metadata and ensure proper status code reporting for various node types.

TopicDetails
Proto-Plus Support Implements proto.Message serialization in EventSerializer to prevent empty objects when processing Google Cloud AI Platform types.
Modified files (3)
  • src/galileo/utils/dependencies.py
  • src/galileo/utils/serialization.py
  • tests/utils/test_serialization.py
Latest Contributors(2)
UserCommitDate
Focadecombatefeat-add-serialization...February 09, 2026
mikebrancfix-Tool-calls-not-app...November 18, 2025
LangChain Handlers Refactors parse_llm_result to support GCP-style token keys (input_tokens/output_tokens) and adds status_code tracking to LangChain callback handlers.
Modified files (4)
  • src/galileo/handlers/langchain/async_handler.py
  • src/galileo/handlers/langchain/handler.py
  • src/galileo/handlers/langchain/utils.py
  • tests/test_langchain.py
Latest Contributors(2)
UserCommitDate
AnkushMalakerfix-update-handler-to-...January 30, 2026
Focadecombatefeat-Implement-update_...December 18, 2025
This pull request is reviewed by Baz. Review like a pro on (Baz).

Render proto enum fields as readable strings (e.g. "OBJECT", "STRING")
instead of opaque integers when serializing proto-plus messages.
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 73.84615% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.78%. Comparing base (0e364eb) to head (4463b10).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/galileo/handlers/langchain/handler.py 55.55% 8 Missing ⚠️
src/galileo/handlers/langchain/async_handler.py 70.00% 3 Missing ⚠️
src/galileo/handlers/langchain/utils.py 90.32% 3 Missing ⚠️
src/galileo/utils/serialization.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #485      +/-   ##
==========================================
- Coverage   81.85%   81.78%   -0.07%     
==========================================
  Files          96       96              
  Lines        9164     9197      +33     
==========================================
+ Hits         7501     7522      +21     
- Misses       1663     1675      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ents

Address PR review feedback:
- Wrap proto.Message.to_dict result with self.default() to ensure nested
  values are recursively processed like all other serialization branches
- Clarify Sequence comment to distinguish bare protobuf from proto-plus
- Fix misleading test docstring for empty message serialization
@Focadecombate Focadecombate merged commit 5cabda5 into main Feb 25, 2026
33 of 34 checks passed
@Focadecombate Focadecombate deleted the bug/sc-55119/galileo-callback-does-not-show-tool-when-run branch February 25, 2026 16:30
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.

3 participants