@@ -954,6 +954,14 @@ async function resolveOverridableTriggerVariables(
954954 return result ;
955955}
956956
957+ /**
958+ * Resolves built-in environment variables that are injected into dev (CLI) task
959+ * runs. `TRIGGER_API_URL` and `TRIGGER_STREAM_URL` prefer `RUNTIME_API_ORIGIN`
960+ * over `API_ORIGIN`/`STREAM_ORIGIN` so self-hosted deployments can keep
961+ * runner-to-webapp traffic on a cluster-internal hop (bypassing tracing-enabled
962+ * gateways that rewrite the W3C `traceparent` header on egress) without
963+ * affecting the public origins exposed to external clients.
964+ */
957965async function resolveBuiltInDevVariables ( runtimeEnvironment : RuntimeEnvironmentForEnvRepo ) {
958966 let result : Array < EnvironmentVariable > = [
959967 {
@@ -966,7 +974,7 @@ async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment
966974 } ,
967975 {
968976 key : "TRIGGER_STREAM_URL" ,
969- value : env . STREAM_ORIGIN ?? env . RUNTIME_API_ORIGIN ?? env . API_ORIGIN ?? env . APP_ORIGIN ,
977+ value : env . RUNTIME_API_ORIGIN ?? env . STREAM_ORIGIN ?? env . API_ORIGIN ?? env . APP_ORIGIN ,
970978 } ,
971979 ] ;
972980
@@ -1093,6 +1101,15 @@ async function resolveOverridableOtelDevVariables(
10931101 return result ;
10941102}
10951103
1104+ /**
1105+ * Resolves built-in environment variables that are injected into managed
1106+ * (deployed) task runs. `TRIGGER_API_URL` and `TRIGGER_STREAM_URL` prefer
1107+ * `RUNTIME_API_ORIGIN` over `API_ORIGIN`/`STREAM_ORIGIN` so self-hosted
1108+ * deployments can keep runner-to-webapp traffic on a cluster-internal hop
1109+ * (bypassing tracing-enabled gateways that rewrite the W3C `traceparent`
1110+ * header on egress) without affecting the public origins exposed to external
1111+ * clients.
1112+ */
10961113async function resolveBuiltInProdVariables (
10971114 runtimeEnvironment : RuntimeEnvironmentForEnvRepo ,
10981115 parentEnvironment ?: RuntimeEnvironmentForEnvRepo
@@ -1108,7 +1125,7 @@ async function resolveBuiltInProdVariables(
11081125 } ,
11091126 {
11101127 key : "TRIGGER_STREAM_URL" ,
1111- value : env . STREAM_ORIGIN ?? env . RUNTIME_API_ORIGIN ?? env . API_ORIGIN ?? env . APP_ORIGIN ,
1128+ value : env . RUNTIME_API_ORIGIN ?? env . STREAM_ORIGIN ?? env . API_ORIGIN ?? env . APP_ORIGIN ,
11121129 } ,
11131130 {
11141131 key : "TRIGGER_RUNTIME_WAIT_THRESHOLD_IN_MS" ,
0 commit comments