@@ -499,6 +499,55 @@ async def read_trigger_impl(trigger: UiPathResumeTrigger) -> dict[str, Any]:
499499 # Delegate should have been executed only once (no auto-resume)
500500 assert runtime_impl .execution_count == 1
501501
502+ @pytest .mark .asyncio
503+ async def test_resumable_skips_inbox_triggers_on_auto_resume_check (self ) -> None :
504+ """Inbox triggers should be skipped when checking for auto-resume after suspension.
505+
506+ Inbox triggers are async-external (payload delivered via Integration
507+ Services), so calling read_trigger on them at suspend time would hit a
508+ 404 and fault the run. They should behave like API triggers here.
509+ """
510+
511+ runtime_impl = MultiTriggerMockRuntime ()
512+ storage = StatefulStorageMock ()
513+ trigger_manager = make_trigger_manager_mock ()
514+
515+ def create_inbox_trigger (data : dict [str , Any ]) -> UiPathResumeTrigger :
516+ return UiPathResumeTrigger (
517+ interrupt_id = "" , # Will be set by resumable runtime
518+ trigger_type = UiPathResumeTriggerType .INBOX ,
519+ payload = data ,
520+ )
521+
522+ trigger_manager .create_trigger = AsyncMock (side_effect = create_inbox_trigger ) # type: ignore[method-assign]
523+
524+ # Track whether read_trigger is ever called — it must NOT be, otherwise
525+ # the filter is broken and we'd hit the payload endpoint prematurely.
526+ read_trigger_guard = AsyncMock (
527+ side_effect = AssertionError (
528+ "read_trigger must not be called for Inbox triggers pre-resume"
529+ )
530+ )
531+ trigger_manager .read_trigger = read_trigger_guard # type: ignore[method-assign]
532+
533+ resumable = UiPathResumableRuntime (
534+ delegate = runtime_impl ,
535+ storage = storage ,
536+ trigger_manager = trigger_manager ,
537+ runtime_id = "runtime-1" ,
538+ )
539+
540+ result = await resumable .execute ({})
541+
542+ assert result .status == UiPathRuntimeStatus .SUSPENDED
543+ assert result .triggers is not None
544+ assert len (result .triggers ) == 2
545+ assert all (
546+ t .trigger_type == UiPathResumeTriggerType .INBOX for t in result .triggers
547+ )
548+ trigger_manager .read_trigger .assert_not_called ()
549+ assert runtime_impl .execution_count == 1
550+
502551 @pytest .mark .asyncio
503552 async def test_resumable_auto_resumes_task_triggers_but_not_api_triggers (
504553 self ,
0 commit comments