Skip to content

fix: implement IsCallbacksEnabled and GetType for cancelableChatModel#826

Merged
hi-pender merged 1 commit intofeat/agent_turn_loopfrom
fix/cancel_model
Mar 2, 2026
Merged

fix: implement IsCallbacksEnabled and GetType for cancelableChatModel#826
hi-pender merged 1 commit intofeat/agent_turn_loopfrom
fix/cancel_model

Conversation

@hi-pender
Copy link
Copy Markdown
Contributor

Summary

This PR adds two interface methods to cancelableChatModel to properly propagate callback and type information from the wrapped inner model.

Changes

  • Add IsCallbacksEnabled() bool method to delegate callback status check to the inner model
  • Add GetType() string method to return the type name of the inner model

Why

The cancelableChatModel wraps a model.ChatModel to add cancellation support. However, without these methods, the wrapper would lose the ability to report:

  1. Whether callbacks are enabled on the underlying model
  2. The actual type name of the inner model for logging/debugging purposes

This ensures proper functionality when using the cancelable wrapper with the component callback system and type introspection.

Testing

The implementation delegates to existing utility functions (components.IsCallbacksEnabled, components.GetType, generic.ParseTypeName) which are already tested.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feat/agent_turn_loop@a4e13f5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
adk/cancel_wrapper.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##             feat/agent_turn_loop     #826   +/-   ##
=======================================================
  Coverage                        ?   79.53%           
=======================================================
  Files                           ?      148           
  Lines                           ?    16425           
  Branches                        ?        0           
=======================================================
  Hits                            ?    13064           
  Misses                          ?     2386           
  Partials                        ?      975           

☔ 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.

@hi-pender hi-pender merged commit 39b97d8 into feat/agent_turn_loop Mar 2, 2026
16 checks passed
@hi-pender hi-pender deleted the fix/cancel_model branch March 2, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants