Skip to content

feat(AIC-3412): add the Google ADK agents handler - #106

Open
andrewklatzke wants to merge 12 commits into
mainfrom
aklatzke/AIC-3412/add-google-adk
Open

andrewklatzke wants to merge 12 commits into
mainfrom
aklatzke/AIC-3412/add-google-adk

Conversation

@andrewklatzke

Copy link
Copy Markdown
Contributor

Summary

  • Adds launchdarkly-ai-google-adk-agents, a wildcard agent handler for Google ADK. Gemini Developer API is the default. Vertex is an explicit opt-in and never shares an API key with that path.
  • Non-Gemini models go through ADK's own LiteLLM adapter (provider/model). google-adk is not a declared dependency: 2.9.2 caps OpenTelemetry below this workspace's exporter pin, so production installs add google-adk[extensions] themselves.
  • Includes google_adk_graph and to_adk_agents. The native adapter runs the root, follows transfer_to_<target> when the model calls it, and emits ld.ai.graph plus $ld:ai:graph:* when a context is present.

Test plan

  • uv run mypy packages/google-adk-agents/src
  • uv run pytest packages/google-adk-agents/tests tests/test_cross_handler_parity.py
  • Live integration against a Google-backed AI Config (the monorepo scenario key is not confirmed Google-backed)
  • Confirm a Vertex opt-in call does not send an API key, and a failed Gemini call is not retried on Vertex

Made with Cursor

andrewklatzke and others added 6 commits September 23, 2026 13:52
ADK is a wildcard agent runtime, so the handler serves any provider. Gemini is the default transport and Vertex is an explicit opt-in.

Co-authored-by: Cursor <cursoragent@cursor.com>
…-google-adk

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	.release-please-manifest.json
#	.sdk_metadata.json
#	AGENTS.md
#	tests/test_cross_handler_parity.py
#	uv.lock
…nd emit graph:node in the Google ADK adapter

Co-authored-by: Cursor <cursoragent@cursor.com>
…span

Co-authored-by: Cursor <cursoragent@cursor.com>
@andrewklatzke
andrewklatzke marked this pull request as ready for review October 21, 2026 22:03

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/google-adk-agents/src/launchdarkly_ai_google_adk_agents/native_graph.py Outdated
andrewklatzke and others added 2 commits October 21, 2026 14:13
…-google-adk

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	.release-please-manifest.json
#	.sdk_metadata.json
#	AGENTS.md
#	tests/test_cross_handler_parity.py
Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/google-adk-agents/src/launchdarkly_ai_google_adk_agents/native_graph.py Outdated
jeffdupont and others added 2 commits October 23, 2026 12:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Open the chat span in before_model_callback, end it on the first
  non-partial after_model_callback, and fail it in on_model_error_callback.
- Write gen_ai.response.finish_reasons through the shared table.
- Sum usage_metadata over every non-partial event, not only the final one.
- Stream with RunConfig(streaming_mode=SSE): ADK 2.9.2 defaults to NONE and
  yields no partial events. End the root span before yielding done.
- to_adk_agents(definition, opts) awaits the resolve_graph() result like the
  sibling adapters, resolves each node's model through _resolve_model with
  the factory auth options, and sends handler._user_message. Drop the unused
  Workflow and its import.
- google_adk_graph takes and forwards api_key.
- Commit the API report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffdupont
jeffdupont requested a review from a team as a code owner October 23, 2026 19:19
@jeffdupont

Copy link
Copy Markdown
Contributor

Pushed two commits for the GA 1.0 audit (needs a human reviewer):

  • 59ea283: merged origin/main. Resolved conflicts in release-please.yml, the manifest, README.md and AGENTS.md by keeping both the TypeSafe and ADK entries.
  • ccf7bb4:
    • The chat span now runs from before_model_callback to after_model_callback, and on_model_error_callback fails it.
    • gen_ai.response.finish_reasons is written through the shared table.
    • Usage is summed over every non-partial event.
    • Streaming passes RunConfig(streaming_mode=SSE). ADK 2.9.2 defaults to NONE, which yields no partial events.
    • The root span ends before done.
    • to_adk_agents(definition, opts) awaits the definition, resolves models through _resolve_model, and sends _user_message. Workflow is removed.
    • google_adk_graph forwards api_key.
    • Added the API report.

Two follow-ups are left open. The handler forwards no model.parameters (TESTING.md 1.12), and the never-forwarded discovery does not see it because the factory returns Any, not ProviderHandler. Gemini words such as SAFETY currently pass through the finish-reason table unmapped. Both depend on the spec PR (ai-sdks-monorepo#22).

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/google-adk-agents/src/launchdarkly_ai_google_adk_agents/native_graph.py Outdated
- ADK's FunctionTool takes only the callable and drops every argument its
  signature does not name. The tool adapter now carries a signature built
  from the AI Config JSON schema, and the tool's declaration is that schema.
- history_contents drops system turns instead of sending them as user.
- The handler seeds the variation's own user and assistant messages ahead
  of runtime history.
- Graph nodes take their instruction from system messages when
  `instructions` is empty, like the handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffdupont

Copy link
Copy Markdown
Contributor

Pushed baa83b1 for the four new Bugbot findings. AI Config tool schemas now reach ADK, both the signature and the declaration. System history is no longer seeded as user. Config user and assistant turns are seeded ahead of history. Graph nodes fall back to system messages for their instruction. Still needs a human reviewer.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit baa83b1. Configure here.

project=options.get("project"),
location=options.get("location"),
),
instruction=_instruction(config, variables),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native graph skips config conversation turns

Medium Severity

to_adk_agents now applies _instruction so system messages become the node prompt, but it still never seeds that node's user and assistant turns. The handler path prepends those templated turns before history, so google_adk_graph and to_adk_agents diverge on the same messages-mode node and few-shot or prompt turns are dropped.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit baa83b1. Configure here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 34c6f31: to_adk_agents now seeds each node templated user and assistant messages, through the same _config_turns the handler uses, ahead of history. Covered by test_config_turns_are_seeded_before_history in test_native_graph.py.

to_adk_agents now seeds a node's templated user and assistant messages
ahead of history, as the handler does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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