From 63c53e157f525e2043bfa3b0ca009152b9193905 Mon Sep 17 00:00:00 2001 From: David Nicholas Date: Thu, 6 Aug 2026 17:38:37 -0700 Subject: [PATCH] Enable the Temporal engine by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last step of docs/adr/0036's rollout, and the first one that changes behaviour: every turn runs on the Temporal engine instead of the in-process LangGraph loop. DO NOT MERGE until the e2e suite has run under AGENT_ENGINE=temporal. The ADR names that suite as the acceptance test and it has not been run. Opened as a draft so the shape of the change is reviewable while the evidence is gathered. ## AGENT_ENGINE had no chart path — that is fixed here PR #197 added the config value and the engine client, but never gave the chart a way to set the env var, so the flip could not actually be expressed in values. agent-orchestrator's deployment now renders AGENT_ENGINE and AGENT_TEMPORAL_ENGINE_URL, both omitted entirely when unset — verified in both states, so an unset chart is byte-identical to before. ## Both halves, because neither does anything alone temporal-engine.enabled: true deploys worker + gateway agent-orchestrator.config.agentEngine: temporal routes turns to it That separation is the rollback story, and it is recorded in the values file where an operator will actually find it: clearing agentEngine alone returns every turn to the LangGraph loop, and leaving the subchart enabled costs two idle pods. Rolling back the subchart is the slower, optional second step. ## Known rough edge, flagged rather than hidden The gateway Service is -temporal-engine-gateway, so the URL here is coupled to the release being named agent-controller. agent-orchestrator uses fullnameOverride to avoid exactly this; temporal-engine should too. Left as a follow-up rather than restructuring a just-merged chart inside a draft. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_018Uj1SJ41DJJ8woZM7fd3DQ --- .../templates/deployment.yaml | 11 ++++++++ .../charts/agent-orchestrator/values.yaml | 14 ++++++++++ charts/agent-controller/values.yaml | 27 ++++++++++++++++--- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/charts/agent-controller/charts/agent-orchestrator/templates/deployment.yaml b/charts/agent-controller/charts/agent-orchestrator/templates/deployment.yaml index b2837fc..e4dcf7d 100644 --- a/charts/agent-controller/charts/agent-orchestrator/templates/deployment.yaml +++ b/charts/agent-controller/charts/agent-orchestrator/templates/deployment.yaml @@ -67,6 +67,17 @@ spec: - name: AGENT_CALLER_TOOL_TOP_K value: {{ .Values.config.callerToolTopK | quote }} {{- end }} + {{- if .Values.config.agentEngine }} + # Which agent loop runs a turn (docs/adr/0036). Unset or + # "langgraph" keeps the in-process graph; "temporal" forwards to + # the temporal-engine subchart, which must also be enabled. + - name: AGENT_ENGINE + value: {{ .Values.config.agentEngine | quote }} + {{- end }} + {{- if .Values.config.temporalEngineUrl }} + - name: AGENT_TEMPORAL_ENGINE_URL + value: {{ .Values.config.temporalEngineUrl | quote }} + {{- end }} {{- if .Values.config.callerToolTtlSeconds }} - name: AGENT_CALLER_TOOL_TTL_SECONDS value: {{ .Values.config.callerToolTtlSeconds | quote }} diff --git a/charts/agent-controller/charts/agent-orchestrator/values.yaml b/charts/agent-controller/charts/agent-orchestrator/values.yaml index 1475fa7..b8b25d5 100644 --- a/charts/agent-controller/charts/agent-orchestrator/values.yaml +++ b/charts/agent-controller/charts/agent-orchestrator/values.yaml @@ -58,6 +58,20 @@ config: callerToolTopK: "" callerToolTtlSeconds: "" callerToolPruneIntervalSeconds: "" + # Which agent loop runs a turn (docs/adr/0036). Empty or "langgraph" keeps + # the in-process graph, which is the default and the behaviour this app has + # always had. "temporal" forwards each turn to the temporal-engine subchart + # instead — which must also be enabled, and which needs a reachable Temporal + # cluster. + # + # Process-wide rather than per-request: the two engines keep conversation + # state in different places (a Redis session record vs. workflow state), so + # alternating between them mid-conversation would lose whichever one it left. + agentEngine: "" + # Base URL of the temporal-engine gateway Service. Required when + # agentEngine is "temporal"; the app refuses to start without it rather + # than silently falling back to the other engine. + temporalEngineUrl: "" # Base URL Job pods use to reach the callback receiver. Leave empty to # default to the in-cluster callback Service DNS name (ADR 0006). callbackBaseUrl: "" diff --git a/charts/agent-controller/values.yaml b/charts/agent-controller/values.yaml index 7607b59..a798201 100644 --- a/charts/agent-controller/values.yaml +++ b/charts/agent-controller/values.yaml @@ -19,6 +19,21 @@ agent-orchestrator: # openwebui.openaiBaseApiUrl below and the in-cluster callback URL both # depend on `agent-orchestrator-invoke` / `agent-orchestrator-callback`. fullnameOverride: agent-orchestrator + config: + # Route turns to the Temporal engine (docs/adr/0036). + # + # BOTH halves are required and neither does anything alone: the + # `temporal-engine` subchart below deploys the worker and gateway, and this + # tells the orchestrator to use them. Setting only one is a no-op in either + # direction — which is deliberate, so the engine can be deployed and watched + # before any turn depends on it. + agentEngine: temporal + # NOTE: this Service name is `-temporal-engine-gateway`, so it is + # coupled to the release being named `agent-controller`. The + # agent-orchestrator subchart avoids that with `fullnameOverride` (see + # above) for exactly this reason; temporal-engine should get the same + # treatment as a follow-up, at which point this becomes a stable name. + temporalEngineUrl: http://agent-controller-temporal-engine-gateway:8080 # Common overrides live under here, e.g.: # image: { tag: latest } # qdrant: { enabled: true } @@ -40,10 +55,11 @@ core-controller: # --------------------------------------------------------------------------- # The Temporal-workflow agent engine (charts/temporal-engine, docs/adr/0036). # -# OFF by default, and enabling it is TWO steps on purpose: +# ON as of docs/adr/0036's rollout. Enabling is TWO independent steps, and +# this is the first: # 1. temporal-engine.enabled=true -- deploy worker + gateway # 2. agent-orchestrator.config.agentEngine=temporal -# -- route turns to it +# -- route turns to it (above) # # Step 1 alone changes no behaviour, which is what makes the rollout # reversible: the engine can be deployed, watched, and rolled back before any @@ -51,10 +67,15 @@ core-controller: # /invoke, identity, RBAC, credentials, both launchers) stays in # agent-orchestrator either way. # +# TO ROLL BACK: clear agent-orchestrator.config.agentEngine above. That alone +# returns every turn to the in-process LangGraph loop; leaving this subchart +# enabled costs two idle pods and nothing else. Rolling back the subchart too +# is the slower, optional second step. +# # Assumes a reachable Temporal cluster; no server is bundled. # --------------------------------------------------------------------------- temporal-engine: - enabled: false + enabled: true # Common overrides live under here, e.g.: # temporal: { address: temporal-frontend.temporal.svc:7233 } # qdrant: { host: agent-controller-qdrant, collectionPrefix: te- }