Repository navigation
Align Snowflake Cortex Agent hook with the Common AI managed-agent contract - #74672
Draft
SameerMesiah97 wants to merge 1 commit into
Draft
SameerMesiah97 wants to merge 1 commit into
SameerMesiah97 wants to merge 1 commit into
Conversation
SameerMesiah97
force-pushed
the
SnowflakeCortexAgentHook-Common-Interface
branch
3 times, most recently
from
October 15, 2026 22:08
696226a to
a85d54b
Compare
Implement agent resolution, capabilities and stateless invocation. Test request conversion, validation, error handling and optional imports.
SameerMesiah97
force-pushed
the
SnowflakeCortexAgentHook-Common-Interface
branch
from
October 15, 2026 23:12
6694370 to
477824c
Compare
This branch has not been deployed
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.
Description
This change aligns
SnowflakeCortexAgentHookwith theBaseManagedAgentHookcontract introduced in PR #73532.The hook now implements
resolve_agent(),get_agent_capabilities()andinvoke_agent(), allowing Cortex Agents to be consumed through the Common AI managed-agent interface. Invocation delegates to the existingrun_agent()method and returns a standardized response containing answer text and the raw Snowflake payload.Rationale
The common contract allows shared consumers, such as
ManagedAgentToolsetand failover clients, to invoke Cortex Agents without implementing Snowflake-specific integration logic.Adopting the contract on the existing hook keeps connection handling, authentication and API invocation in one place.
Tests
Added unit tests verifying that:
ManagedAgentInvocationError, while other HTTP errors propagate unchanged.Notes
The managed-agent adapter is stateless and supports
tool_choiceas its only vendor option. Thread management remains available throughrun_agent().Common AI support is optional through the Snowflake provider’s
common.aiextra. Its minimum dependency is raised to0.11.0, which introducesBaseManagedAgentHookand has not yet been released. Installing this extra from released packages therefore requires Common AI 0.11.0 to be published.Documentation
The hook docstring describes the Common AI integration, supported inputs and stateless behaviour.
Backwards Compatibility
The existing Snowflake-specific methods retain their current behaviour. Error translation applies only to the new managed-agent invocation method, and the hook can still be imported and used without Common AI installed.
Users installing the
common.aiextra will require Common AI 0.11.0 or later.Was generative AI tooling used to co-author this PR?
Generated-by: [GPT 6.1] following the guidelines