@@ -22,8 +22,6 @@ const Env = z.object({
2222 // Set at runtime
2323 TRIGGER_WORKLOAD_CONTROLLER_ID : z . string ( ) . default ( `controller_${ randomUUID ( ) } ` ) ,
2424 TRIGGER_ENV_ID : z . string ( ) ,
25- TRIGGER_RUN_ID : z . string ( ) . optional ( ) , // This is only useful for cold starts
26- TRIGGER_SNAPSHOT_ID : z . string ( ) . optional ( ) , // This is only useful for cold starts
2725 OTEL_EXPORTER_OTLP_ENDPOINT : z . string ( ) . url ( ) ,
2826 TRIGGER_WARM_START_URL : z . string ( ) . optional ( ) ,
2927 TRIGGER_WARM_START_CONNECTION_TIMEOUT_MS : z . coerce . number ( ) . default ( 30_000 ) ,
@@ -38,6 +36,8 @@ const Env = z.object({
3836 TRIGGER_DEQUEUED_AT_MS : DateEnv ,
3937
4038 // May be overridden
39+ TRIGGER_RUN_ID : z . string ( ) . optional ( ) , // This is set for cold starts and restores
40+ TRIGGER_SNAPSHOT_ID : z . string ( ) . optional ( ) , // This is set for cold starts and restores
4141 TRIGGER_SUPERVISOR_API_PROTOCOL : z . enum ( [ "http" , "https" ] ) ,
4242 TRIGGER_SUPERVISOR_API_DOMAIN : z . string ( ) ,
4343 TRIGGER_SUPERVISOR_API_PORT : z . coerce . number ( ) ,
@@ -94,12 +94,6 @@ export class RunnerEnv {
9494 get TRIGGER_ENV_ID ( ) {
9595 return this . env . TRIGGER_ENV_ID ;
9696 }
97- get TRIGGER_RUN_ID ( ) {
98- return this . env . TRIGGER_RUN_ID ;
99- }
100- get TRIGGER_SNAPSHOT_ID ( ) {
101- return this . env . TRIGGER_SNAPSHOT_ID ;
102- }
10397 get TRIGGER_WARM_START_URL ( ) {
10498 return this . env . TRIGGER_WARM_START_URL ;
10599 }
@@ -126,6 +120,12 @@ export class RunnerEnv {
126120 }
127121
128122 // Overridable values
123+ get TRIGGER_RUN_ID ( ) {
124+ return this . env . TRIGGER_RUN_ID ;
125+ }
126+ get TRIGGER_SNAPSHOT_ID ( ) {
127+ return this . env . TRIGGER_SNAPSHOT_ID ;
128+ }
129129 get TRIGGER_SUCCESS_EXIT_CODE ( ) {
130130 return this . env . TRIGGER_SUCCESS_EXIT_CODE ;
131131 }
@@ -163,6 +163,14 @@ export class RunnerEnv {
163163
164164 /** Overrides existing env vars with new values */
165165 override ( overrides : Metadata ) {
166+ if ( overrides . TRIGGER_RUN_ID ) {
167+ this . env . TRIGGER_RUN_ID = overrides . TRIGGER_RUN_ID ;
168+ }
169+
170+ if ( overrides . TRIGGER_SNAPSHOT_ID ) {
171+ this . env . TRIGGER_SNAPSHOT_ID = overrides . TRIGGER_SNAPSHOT_ID ;
172+ }
173+
166174 if ( overrides . TRIGGER_SUCCESS_EXIT_CODE ) {
167175 this . env . TRIGGER_SUCCESS_EXIT_CODE = overrides . TRIGGER_SUCCESS_EXIT_CODE ;
168176 }
0 commit comments