Proposal: Add SnowflakeCortexAgent as a BaseAgent adapter
@sanketpatil06 ya está trabajando en esto.
Desde el 7/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
🔴 Required Information
Is your feature request related to a specific problem?
Snowflake Cortex Agents run their own planner and server-side tools and expose typed SSE events for text, reasoning, tool execution, citations, warnings, tables, charts, suggested queries, thread metadata, and a final aggregated response.
ADK currently has no first-party Cortex Agent adapter. The existing documented path uses Snowflake's Managed MCP server (CORTEX_AGENT_RUN) through McpToolset. That path retains the completed CallToolResult, but it represents the result as a single ADK FunctionResponse; the original Cortex event boundaries and timing are not exposed as ADK events. McpToolset also does not map the Cortex thread, run, and message lifecycle into ADK session state.
Applications therefore cannot progressively render Cortex output, retain its structured tool and citation data as ADK events, or continue a Cortex thread across turns within a persisted ADK session without a custom adapter.
Describe the Solution You'd Like
Add SnowflakeCortexAgent, a provider-specific BaseAgent that calls the Cortex Agents REST APIs and converts the typed SSE stream into ADK events. The event-conversion approach follows the existing AntigravityAgent precedent for wrapping an external agent runtime.
I propose landing this under google.adk.labs.snowflake, following the initial AntigravityAgent placement, because the public API and event mapping may still evolve. I can relocate the draft before merge if maintainers prefer google.adk.integrations.snowflake.
The initial behavior would be:
-
Run as a standalone root agent. Keep a per-agent cursor containing
thread_id,parent_message_id, and the Snowflake resource identity in session state. Only the currentctx.user_contentis sent because Snowflake owns the remote conversation history. -
Emit text and thinking deltas as
partial=Trueevents in SSE streaming mode. -
Project server-executed tool activity as ADK
FunctionCallandFunctionResponseevents. Function-response payloads are bounded before persistence. -
Retain bounded annotations, warnings, tables, charts, suggested queries, usage, and run metadata on the final event. Suggested queries are collected from Analyst suggestion deltas and from the
response.suggested_queriesevent and final content block defined in the generated Cortex Agent OpenAPI and observed during live testing. Progress events are forwarded as non-persistedpartial=Truemetadata events. -
Treat the final
responseas authoritative. Commit the cursor only whenstatus="completed"andmetadata.assistant_message_idis valid.[DONE]is treated only as an optional compatibility sentinel.cancelledandtimed_outare non-success terminal outcomes and do not produce a completed-turn cursor commit. -
Surface terminal errors without advancing the cursor.
-
Add no dependencies beyond the existing
httpxand Pydantic packages.
If the consumer closes the generator and a run_id is known, the adapter closes the upstream stream and can make one best-effort cancel request. Although cancellation can persist partial output and return an assistant_message_id, that message is not committed as the next cursor; the next turn intentionally forks from the last successfully completed assistant message. An explicit user-facing cancel and resume API is outside the first PR.
Impact on your work
This adapter would provide progressive analytics output, structured tool and citation data, and multi-turn continuity through ADK's normal Runner, Event, and Session lifecycle.
Willingness to contribute
Yes. After creating this issue, I will open a Draft PR containing Related to #<issue-number> and then add the PR link here.
🟡 Recommended Information
Describe Alternatives You've Considered
-
McpToolsetplus a callback: Returns a completed tool result but does not expose Cortex's typed SSE boundaries as ADK events. -
AgentTool: Currently uses a unary nested-agent result path, so the first PR targets standalone root-agent use. -
Provider-neutral tool streaming: Potentially useful, but larger in scope than this provider adapter.
First PR scope
The Core PR would add:
src/google/adk/labs/snowflake/- Matching unit tests
- A package README
docs/guides/labs/snowflake/snowflake_cortex_agent/index.md- An entry in
docs/guides/README.md contributing/samples/integrations/snowflake_cortex_agent/
User-facing adk.dev documentation would be proposed separately in the google/adk-docs repository.
The initial adapter supports standalone root-agent use only. AgentTool, transfer and workflow composition, client-side tools, explicit cancellation and resume APIs, background reconnection, administration APIs, multimodal input, and concurrent turns for the same agent and session are outside the first PR.
Detailed APIs, event tables, authentication, cancellation, truncation, security, test commands, and the masked live trace will be included in the Draft PR description.
Validation
The draft branch has 150 unit tests using mock SSE streams and httpx.MockTransport.
A live test on 2026-09-04 covered thread creation, two-turn continuity, text and thinking deltas, four server-side tool calls, tables, charts, suggested queries, and warnings.
In live testing, a cancel request returned 409 Agent run was already completed both immediately after closing a foreground stream and after a completed run. The adapter therefore treats this response as a benign best-effort cancellation outcome. Text annotations have not yet been exercised live and are identified as such in the Draft PR.
Additional Context
- Cortex Agents Run API
- Use threads with Cortex Agents
- Snowflake-managed MCP server
- Generated Cortex Agent OpenAPI
- AntigravityAgent PR #6040
- AgentTool event propagation issue #3984
Questions for maintainers
-
Is
google.adk.labs.snowflakethe right initial location, or should this land directly undergoogle.adk.integrations.snowflake? -
Is representing Snowflake-executed tool activity as ADK
FunctionCallandFunctionResponseevents appropriate for this adapter?
- Lenguaje dominante
- Python
- Estrellas
- 21.6k
- Forks
- 4k
- Merge medio
- 7 h 10 min
- PR fusionados (30 d)
- 7
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/adk-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google/adk-python#7266 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google/adk-python#7265 · 1 comentario ·
-
mcp
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google/adk-python#7217 · 3 comentarios · 1 asignado ·
-
tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google/adk-python#7206 · 1 comentario · 1 asignado ·
-
request clarification tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
google/adk-python#7205 · 2 comentarios · 1 asignado ·
Todos los issues de google/adk-python
Issues similares
-
agent-ready documentation needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
Add https://search.jeremyh.xyz/ Abiertoinstance instance add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
searxng/searx-instances#939 · 1 comentario ·
-
area-deployment area-integrations triage:bot-seen
Dificultad 2/5 Medio día Aptitud para principiantes 86/100