@@ -170,6 +170,18 @@ type AgentOptions struct {
170170 PromptTemplate * v1alpha2.PromptTemplateSpec
171171}
172172
173+ func pythonRuntime () * v1alpha2.DeclarativeRuntime {
174+ r := v1alpha2 .DeclarativeRuntime_Python
175+ return & r
176+ }
177+
178+ func requireAgentRuntime (t * testing.T , cli client.Client , agent * v1alpha2.Agent , want v1alpha2.DeclarativeRuntime ) {
179+ t .Helper ()
180+ got := & v1alpha2.Agent {}
181+ require .NoError (t , cli .Get (t .Context (), client .ObjectKeyFromObject (agent ), got ))
182+ require .Equal (t , want , got .Spec .Declarative .Runtime )
183+ }
184+
173185// setupAgentWithOptions creates and returns an agent resource with custom options
174186func setupAgentWithOptions (t * testing.T , cli client.Client , modelConfigName string , tools []* v1alpha2.Tool , opts AgentOptions ) * v1alpha2.Agent {
175187 agent := generateAgent (modelConfigName , tools , opts )
@@ -1079,12 +1091,11 @@ func TestE2EInvokeCrewAIAgent(t *testing.T) {
10791091}
10801092
10811093func TestE2EInvokeSTSIntegration (t * testing.T ) {
1082- runE2EInvokeSTSIntegration (t , "python " , nil )
1094+ runE2EInvokeSTSIntegration (t , "go " , nil )
10831095}
10841096
1085- func TestE2EGoInvokeSTSIntegration (t * testing.T ) {
1086- goRuntime := v1alpha2 .DeclarativeRuntime_Go
1087- runE2EInvokeSTSIntegration (t , "go" , & goRuntime )
1097+ func TestE2EPythonInvokeSTSIntegration (t * testing.T ) {
1098+ runE2EInvokeSTSIntegration (t , "python" , pythonRuntime ())
10881099}
10891100
10901101func runE2EInvokeSTSIntegration (t * testing.T , runtimeName string , runtimeOverride * v1alpha2.DeclarativeRuntime ) {
@@ -1133,6 +1144,9 @@ func runE2EInvokeSTSIntegration(t *testing.T, runtimeName string, runtimeOverrid
11331144 },
11341145 },
11351146 })
1147+ if runtimeOverride == nil {
1148+ requireAgentRuntime (t , cli , agent , v1alpha2 .DeclarativeRuntime_Go )
1149+ }
11361150
11371151 // access token for test user with the may act claim allowing system:serviceaccount:kagent:test-sts to
11381152 // perform operations on behalf of the test user
@@ -1273,12 +1287,11 @@ func TestE2ESkillImagePullSecrets(t *testing.T) {
12731287}
12741288
12751289func TestE2EDeclarativeAgentNetworkAllowlistWithSkills (t * testing.T ) {
1276- runDeclarativeAgentNetworkAllowlistWithSkills (t , "python " , nil )
1290+ runDeclarativeAgentNetworkAllowlistWithSkills (t , "default " , nil )
12771291}
12781292
1279- func TestE2EGoDeclarativeAgentNetworkAllowlistWithSkills (t * testing.T ) {
1280- goRuntime := v1alpha2 .DeclarativeRuntime_Go
1281- runDeclarativeAgentNetworkAllowlistWithSkills (t , "go" , & goRuntime )
1293+ func TestE2EPythonDeclarativeAgentNetworkAllowlistWithSkills (t * testing.T ) {
1294+ runDeclarativeAgentNetworkAllowlistWithSkills (t , "python" , pythonRuntime ())
12821295}
12831296
12841297func runDeclarativeAgentNetworkAllowlistWithSkills (t * testing.T , runtimeName string , runtimeOverride * v1alpha2.DeclarativeRuntime ) {
@@ -1377,29 +1390,21 @@ func TestE2EInvokePassthroughAgent(t *testing.T) {
13771390 })
13781391}
13791392
1380- func TestE2EInvokeGolangADKAgent (t * testing.T ) {
1381- // Setup mock server
1393+ func TestE2EAgentDefaultRuntimeIsGo (t * testing.T ) {
13821394 baseURL , stopServer := setupMockServer (t , "mocks/invoke_golang_adk_agent.json" )
13831395 defer stopServer ()
13841396
1385- // Setup Kubernetes client
13861397 cli := setupK8sClient (t , false )
1387-
1388- // Setup model config pointing at mock server
13891398 modelCfg := setupModelConfig (t , cli , baseURL )
13901399
1391- // Create a declarative agent that uses the Go ADK runtime
1392- goRuntime := v1alpha2 .DeclarativeRuntime_Go
13931400 agent := setupAgentWithOptions (t , cli , modelCfg .Name , nil , AgentOptions {
1394- Name : "golang-adk -test" ,
1401+ Name : "default-runtime -test" ,
13951402 SystemMessage : "You are a helpful test agent. Answer concisely." ,
1396- Runtime : & goRuntime ,
13971403 })
1404+ requireAgentRuntime (t , cli , agent , v1alpha2 .DeclarativeRuntime_Go )
13981405
1399- // Setup A2A client
14001406 a2aClient := setupA2AClient (t , agent )
14011407
1402- // Run tests
14031408 t .Run ("sync_invocation" , func (t * testing.T ) {
14041409 runSyncTest (t , a2aClient , "What is 2+2?" , "4" , nil )
14051410 })
@@ -1450,19 +1455,16 @@ func runMemoryAgentTest(t *testing.T, extraOpts AgentOptions) {
14501455}
14511456
14521457// TestE2EMemoryWithAgent runs the agent with memory enabled against the mock
1453- // (invoke_memory_agent.json). Two ModelConfigs are used: one for chat (gpt-4.1-mini)
1454- // and one for embeddings (text-embedding-3-small) so LiteLLM calls the correct APIs.
1458+ // (invoke_memory_agent.json) using the default (Go) ADK runtime.
14551459func TestE2EMemoryWithAgent (t * testing.T ) {
14561460 runMemoryAgentTest (t , AgentOptions {Name : "memory-test-agent" })
14571461}
14581462
1459- // TestE2EMemoryWithGoADKAgent is the same as TestE2EMemoryWithAgent but uses
1460- // the Go ADK runtime to verify memory works end-to-end with the Go runtime.
1461- func TestE2EMemoryWithGoADKAgent (t * testing.T ) {
1462- goRuntime := v1alpha2 .DeclarativeRuntime_Go
1463+ // TestE2EMemoryWithPythonAgent verifies memory with the Python ADK runtime.
1464+ func TestE2EMemoryWithPythonAgent (t * testing.T ) {
14631465 runMemoryAgentTest (t , AgentOptions {
1464- Name : "memory-go-adk -test" ,
1465- Runtime : & goRuntime ,
1466+ Name : "memory-python -test" ,
1467+ Runtime : pythonRuntime () ,
14661468 })
14671469}
14681470
@@ -1583,6 +1585,7 @@ func TestE2EIAgentRunsCode(t *testing.T) {
15831585 modelCfg := setupModelConfig (t , cli , baseURL )
15841586 agent := setupAgentWithOptions (t , cli , modelCfg .Name , nil , AgentOptions {
15851587 ExecuteCode : new (true ),
1588+ Runtime : pythonRuntime (),
15861589 })
15871590
15881591 // Setup A2A client
@@ -1603,6 +1606,7 @@ func TestE2ESandboxAgentNetworkAllowlistWithExecuteCode(t *testing.T) {
16031606 t .Run ("deny_by_default" , func (t * testing.T ) {
16041607 agent := setupSandboxAgentWithOptions (t , cli , modelCfg .Name , nil , AgentOptions {
16051608 ExecuteCode : new (true ),
1609+ Runtime : pythonRuntime (),
16061610 })
16071611
16081612 a2aClient := setupSandboxA2AClient (t , agent )
@@ -1612,6 +1616,7 @@ func TestE2ESandboxAgentNetworkAllowlistWithExecuteCode(t *testing.T) {
16121616 t .Run ("allowlist_enables_access" , func (t * testing.T ) {
16131617 agent := setupSandboxAgentWithOptions (t , cli , modelCfg .Name , nil , AgentOptions {
16141618 ExecuteCode : new (true ),
1619+ Runtime : pythonRuntime (),
16151620 Sandbox : & v1alpha2.SandboxConfig {
16161621 Network : & v1alpha2.NetworkConfig {
16171622 AllowedDomains : []string {controllerHost },
0 commit comments