@@ -61,12 +61,29 @@ function createWorkflowDependencies(
6161 channels : { telegram : null , slack : null , discord : null , whatsapp : null } ,
6262 } ) ,
6363 getSandboxDomain : async ( ) => "https://sandbox.example.test" ,
64- forwardToNativeHandler : async ( ) => ( { ok : true , status : 200 } ) ,
64+ forwardToNativeHandler : async ( ) => ( {
65+ ok : true ,
66+ status : 200 ,
67+ durationMs : 0 ,
68+ bodyLength : 0 ,
69+ bodyHead : "" ,
70+ headers : null ,
71+ } ) ,
72+ forwardTelegramToNativeHandlerLocally : async ( ) => ( {
73+ ok : true ,
74+ status : 200 ,
75+ durationMs : 0 ,
76+ bodyLength : 0 ,
77+ bodyHead : "" ,
78+ headers : null ,
79+ error : null ,
80+ } ) ,
6581 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => ( {
6682 ok : true ,
6783 status : 200 ,
6884 attempts : 1 ,
6985 totalMs : 50 ,
86+ transport : "public" ,
7087 retries : [ ] ,
7188 } ) ,
7289 waitForTelegramNativeHandler : async ( ) : Promise < TelegramProbeResult > => ( {
@@ -108,7 +125,7 @@ test("processChannelStep skips ensureSandboxReady when boot returns running", as
108125 } ,
109126 forwardToNativeHandlerWithRetry : async ( _channel : unknown , _payload : unknown , meta : SingleMeta ) : Promise < RetryingForwardResult > => {
110127 forwardedSandboxId = meta . sandboxId ?? null ;
111- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
128+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
112129 } ,
113130 } ) ;
114131
@@ -139,7 +156,7 @@ test("processChannelStep falls back to ensureSandboxReady when boot returns non-
139156 } ,
140157 forwardToNativeHandlerWithRetry : async ( _channel : unknown , _payload : unknown , meta : SingleMeta ) : Promise < RetryingForwardResult > => {
141158 forwardedSandboxId = meta . sandboxId ?? null ;
142- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
159+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
143160 } ,
144161 } ) ;
145162
@@ -173,6 +190,7 @@ test("processChannelStep converts native forward 502 into RetryableError (Telegr
173190 status : 502 ,
174191 attempts : 6 ,
175192 totalMs : 6000 ,
193+ transport : "public" ,
176194 retries : [ { attempt : 1 , reason : "proxy-error" , status : 502 } ] ,
177195 } ) ,
178196 } ) ;
@@ -194,6 +212,7 @@ test("processChannelStep keeps native forward 404 fatal (Telegram retrying path)
194212 status : 404 ,
195213 attempts : 1 ,
196214 totalMs : 50 ,
215+ transport : "public" ,
197216 retries : [ ] ,
198217 } ) ,
199218 } ) ;
@@ -214,11 +233,11 @@ test("processChannelStep uses retrying forward for Telegram, direct forward for
214233 const telegramDeps = createWorkflowDependencies ( {
215234 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => {
216235 retryingCalled = true ;
217- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
236+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
218237 } ,
219238 forwardToNativeHandler : async ( ) => {
220239 directCalled = true ;
221- return { ok : true , status : 200 } ;
240+ return { ok : true , status : 200 , durationMs : 0 , bodyLength : 0 , bodyHead : "" , headers : null } ;
222241 } ,
223242 } ) ;
224243
@@ -232,11 +251,11 @@ test("processChannelStep uses retrying forward for Telegram, direct forward for
232251 const slackDeps = createWorkflowDependencies ( {
233252 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => {
234253 retryingCalled = true ;
235- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
254+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
236255 } ,
237256 forwardToNativeHandler : async ( ) => {
238257 directCalled = true ;
239- return { ok : true , status : 200 } ;
258+ return { ok : true , status : 200 , durationMs : 0 , bodyLength : 0 , bodyHead : "" , headers : null } ;
240259 } ,
241260 } ) ;
242261
@@ -252,6 +271,7 @@ test("processChannelStep converts retrying forward 504 (exhausted) into Retryabl
252271 status : 504 ,
253272 attempts : 6 ,
254273 totalMs : 30000 ,
274+ transport : null ,
255275 retries : [
256276 { attempt : 1 , reason : "proxy-error" , status : 503 } ,
257277 { attempt : 2 , reason : "fetch-exception" , error : "connect ECONNREFUSED" } ,
@@ -279,6 +299,7 @@ test("processChannelStep treats retrying forward 500 as retryable at workflow le
279299 status : 500 ,
280300 attempts : 1 ,
281301 totalMs : 100 ,
302+ transport : "public" ,
282303 retries : [ ] ,
283304 } ) ,
284305 } ) ;
@@ -515,7 +536,7 @@ test("processChannelStep forward captures Telegram webhook secret and correct po
515536 capturedPayload = payload ;
516537 capturedMeta = meta ;
517538 capturedGetSandboxDomain = getSandboxDomain ;
518- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
539+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
519540 } ,
520541 } ) ;
521542
@@ -554,7 +575,7 @@ test("processChannelStep forward passes meta with portUrls from boot result", as
554575 meta : SingleMeta ,
555576 ) : Promise < RetryingForwardResult > => {
556577 forwardedPortUrls = ( meta . portUrls as Record < string , string > ) ?? null ;
557- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
578+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
558579 } ,
559580 } ) ;
560581
@@ -610,7 +631,7 @@ test("processChannelStep uses local Telegram native handler readiness before for
610631 } ,
611632 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => {
612633 forwardCalledAfterLocalProbe = localProbeCallCount > 0 ;
613- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
634+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "local" , retries : [ ] } ;
614635 } ,
615636 } ) ;
616637
@@ -680,7 +701,7 @@ test("processChannelStep falls back to public Telegram probe when local handler
680701 } ,
681702 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => {
682703 forwardCalled = true ;
683- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
704+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
684705 } ,
685706 } ) ;
686707
@@ -726,7 +747,7 @@ test("processChannelStep still forwards when both Telegram probes time out", asy
726747 } ,
727748 forwardToNativeHandlerWithRetry : async ( ) : Promise < RetryingForwardResult > => {
728749 forwardCalled = true ;
729- return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , retries : [ ] } ;
750+ return { ok : true , status : 200 , attempts : 1 , totalMs : 50 , transport : "public" , retries : [ ] } ;
730751 } ,
731752 } ) ;
732753
0 commit comments