From 52037212dcc1cde89a880c82627b9297f580cffa Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Fri, 4 Sep 2026 17:27:16 +0000 Subject: [PATCH] ces: add proactive_execution_enabled to agent callbacks --- mmv1/products/ces/Agent.yaml | 54 ++++++++++ mmv1/products/ces/AppVersion.yaml | 100 ++++++++++++++++++ .../terraform/services/ces/ces_agent_test.go | 12 +++ 3 files changed, 166 insertions(+) diff --git a/mmv1/products/ces/Agent.yaml b/mmv1/products/ces/Agent.yaml index a12a8c07eb1d..178120963701 100644 --- a/mmv1/products/ces/Agent.yaml +++ b/mmv1/products/ces/Agent.yaml @@ -91,6 +91,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true @@ -114,6 +123,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true @@ -137,6 +155,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true @@ -159,6 +186,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true @@ -182,6 +218,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true @@ -205,6 +250,15 @@ properties: description: |- Whether the callback is disabled. Disabled callbacks are ignored by the agent. + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. - name: pythonCode type: String required: true diff --git a/mmv1/products/ces/AppVersion.yaml b/mmv1/products/ces/AppVersion.yaml index 929fd2930560..4c3ff3bace14 100644 --- a/mmv1/products/ces/AppVersion.yaml +++ b/mmv1/products/ces/AppVersion.yaml @@ -116,6 +116,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -142,6 +152,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -168,6 +188,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -193,6 +223,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -219,6 +259,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -245,6 +295,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -1416,6 +1476,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -1437,6 +1507,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -1458,6 +1538,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. @@ -1479,6 +1569,16 @@ properties: Whether the callback is disabled. Disabled callbacks are ignored by the agent. output: true + - name: proactiveExecutionEnabled + type: Boolean + description: |- + If enabled, the callback will also be executed on intermediate model + outputs. This setting only affects after model callback. + **ENABLE WITH CAUTION**. Typically after model callback only needs to be + executed after receiving all model responses. Enabling proactive execution + may have negative implication on the execution cost and latency, and + should only be enabled in rare situations. + output: true - name: pythonCode type: String description: The python code to execute for the callback. diff --git a/mmv1/third_party/terraform/services/ces/ces_agent_test.go b/mmv1/third_party/terraform/services/ces/ces_agent_test.go index 7ce330148fdc..1bec0e6542db 100644 --- a/mmv1/third_party/terraform/services/ces/ces_agent_test.go +++ b/mmv1/third_party/terraform/services/ces/ces_agent_test.go @@ -172,36 +172,42 @@ resource "google_ces_agent" "ces_agent_basic" { description = "Example callback" disabled = true python_code = "def before_agent_callback(callback_context): return None" + proactive_execution_enabled = false } after_agent_callbacks { description = "Example callback" disabled = true python_code = "def after_agent_callback(callback_context): return None" + proactive_execution_enabled = false } before_model_callbacks { description = "Example callback" disabled = true python_code = "def before_model_callback(callback_context, llm_request): return None" + proactive_execution_enabled = false } after_model_callbacks { description = "Example callback" disabled = true python_code = "def after_model_callback(callback_context, llm_response): return None" + proactive_execution_enabled = false } before_tool_callbacks { description = "Example callback" disabled = true python_code = "def before_tool_callback(tool, input, callback_context): return None" + proactive_execution_enabled = false } after_tool_callbacks { description = "Example callback" disabled = true python_code = "def after_tool_callback(tool, input, callback_context, tool_response): return None" + proactive_execution_enabled = false } tools = [ @@ -341,36 +347,42 @@ resource "google_ces_agent" "ces_agent_basic" { description = "Example callback" disabled = false python_code = "def before_agent_callback(callback_context): return None" + proactive_execution_enabled = true } after_agent_callbacks { description = "Example callback" disabled = false python_code = "def after_agent_callback(callback_context): return None" + proactive_execution_enabled = true } before_model_callbacks { description = "Example callback" disabled = false python_code = "def before_model_callback(callback_context, llm_request): return None" + proactive_execution_enabled = true } after_model_callbacks { description = "Example callback" disabled = false python_code = "def after_model_callback(callback_context, llm_response): return None" + proactive_execution_enabled = true } before_tool_callbacks { description = "Example callback" disabled = false python_code = "def before_tool_callback(tool, input, callback_context): return None" + proactive_execution_enabled = true } after_tool_callbacks { description = "Example callback" disabled = false python_code = "def after_tool_callback(tool, input, callback_context, tool_response): return None" + proactive_execution_enabled = true } // tools = [