[AAASM-4839] ♻️ (examples): Use public google_adk adapter API, drop private internals#340
Merged
Merged
Conversation
Rewrite google-adk governance wiring against the SDK's public GoogleADKAdapter.register_hooks / unregister_hooks — the same entrypoint init_assembly uses to install ADK governance — instead of the underscore- prefixed google_adk.patch internals (_apply_tool_run_async_patch / _revert_tool_run_async_patch), which the SDK labels internal and ships unversioned. The public adapter only auto-discovers concrete tools exported from google.adk.tools, so the example's local DemoTool subclass is registered into that public discovery scope before the hooks apply. Documented as an SDK gap: no public per-class governance entrypoint. Refs AAASM-4839
Refresh the "Adapter / version note" to describe the public GoogleADKAdapter concrete-tool patching now used by src/governance.py, replacing the stale description of the removed private-patch mechanism. Refs AAASM-4839
|
Contributor
Author
🤖 Claude Code — PR reviewScope (AAASM-4839, MED): ✅ google-adk example uses the public
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
The
google-adkexample's governance wiring (python/google-adk/src/governance.py) called underscore-prefixed SDK internals —agent_assembly.adapters.google_adk.patch._apply_tool_run_async_patch/_revert_tool_run_async_patch— which the SDK labels internal, not intended for SDK users and ships unversioned, so the example would break on any point release with no deprecation path. It now uses the SDK's publicGoogleADKAdapter.register_hooks()/unregister_hooks()— the same entrypointinit_assembly()uses to install ADK governance in a live deployment. The README's "Adapter / version note" is updated to match.SDK gap (documented, not worked around): the public adapter only auto-discovers concrete tools exported from
google.adk.tools; it has no public entrypoint to govern a single caller-supplied tool class. This example'sDemoToolis a localBaseToolsubclass, sogovern_tool_classregisters it into the adapter's public discovery scope before applying the hooks (a production agent exposing realgoogle.adk.toolstools needs no such bridging). A future public per-class governance API — or migrating the demo tool to a realgoogle.adk.tools.FunctionTool(outside this ticket's single-file scope) — would remove even that step.Only public exports are used:
GoogleADKAdapteris inagent_assembly.adapters.google_adk.__all__.Related ticket
Closes AAASM-4839
Jira: https://lightning-dust-mite.atlassian.net/browse/AAASM-4839
How to verify
python -m py_compile src/governance.pypasses;grepconfirms no underscore-prefixed /.patchinternals remain ingovernance.py.Checklist
[AAASM-XXXX] <GitEmoji> (<scope>): <summary>.envfiles committedREADME.mdwith prerequisites and run instructions🤖 Generated with Claude Code