+
    jHàjÇP  ã            	      ó(  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ]P                  ! R4      tRtRt]! 0 R"m4      tR#t]R$,           t]R%,           t]! ]P*                  ]P,                  ]P.                  ]P0                  ]P2                  ]P4                  ]P6                  04      tR R	 ltR
 R ltR R ltR R lt R R lt!R R lt" ! R R4      t#R R lt$R&t%R R lt&]'! 4       t(R])R&   R R lt*R R lt+^ R I,H-t. ^ R!I,H/t0 R# )'aÝ  Cron pre-run preflight: transient provider-resolution error classification, provider-key /
delivery-target / skills checks, and the shared-route adapter view used by satellite profiles.

Split out of ``cron.scheduler``. Import names from this module directly (``cron.scheduler`` only
imports the few it calls itself). Origin-resident helpers and sibling split modules are reached
late-bound (``_sched`` / module refs at the bottom) so monkeypatching the defining module works.
)ÚannotationsN)ÚOptional)Úcron_env_settingzcron.schedulerz[blocked_config]z[blocked_config:silent]c               ó    € V ^8„  d   QhRRRR/# )é   ÚexcÚBaseExceptionÚreturnÚbool© )Úformats   "Ú=/home/ubuntu/.hermes/hermes-agent/cron/scheduler_preflight.pyÚ__annotate__r   )   s   € ÷ $ñ $¨mð $Àñ $ó    c                óÚ  aa€ ^ RI pR
 Uu0 uF!  p\        W4      '       g   K  \        W4      kK#  	  pp\        4       pT pVEe"   \	        V4      V9  Ed   VP                  \	        V4      4       \        V4      P                  ;'       g    Ro\        V4      P                  4       o\        V4      P                  \        9   d   R# \        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       dK   \        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       d   R# \        V\        4      '       d’   \        WQP                   4      '       d   VP"                  V9   d   R# M\        VRR4      \$        9   d   R# \        ;QJ d#    V3R l\&         4       F  '       g   K   RM	  RM! V3R l\&         4       4      '       d   R# \        ;QJ d#    V3R	 l\(         4       F  '       g   K   RM	  RM! V3R	 l\(         4       4      '       d   R# VP*                  ;'       g    VP,                  pEK&  R# u upi )zþTrue when primary provider resolution failed for a transient network reason (DNS blip,
ConnectError...). Must be eligible for ``fallback_providers`` like AuthError, else a healthy
fallback rung is never tried and the job dies before the first model call.NÚ Tc              3  ó,   <"  € T F	  qS9   x € K  	  R # 5i©Nr   )Ú.0ÚmÚmodules   & €r   Ú	<genexpr>Ú7_is_transient_provider_resolve_error.<locals>.<genexpr>>   s   øé € ÐEÑ$D˜q�FŽ{Ó$Dùó   ƒFc              3  ó,   <"  € T F	  qS9   x € K  	  R # 5ir   r   ©r   ÚneedleÚmsgs   & €r   r   r   >   s   øé € ð NAÙ(?˜f�cŽMÓ(?ùr   Úerrnoc              3  ó,   <"  € T F	  qS9   x € K  	  R # 5ir   r   r   s   & €r   r   r   G   s   øé € ÐJÑ/I V˜S–=Ó/Iùr   c              3  ó,   <"  € T F	  qS9   x € K  	  R # 5ir   r   r   s   & €r   r   r   J   s   øé € Ð@Ñ+? ˜Ž}Ó+?ùr   )Ú
EAI_NONAMEÚ	EAI_AGAINÚEAI_FAILÚ
EAI_NODATA)ÚhttpxÚhttpcoreÚaiohttp)ÚsocketÚhasattrÚgetattrÚsetÚidÚaddÚtypeÚ
__module__ÚstrÚlowerÚ__name__Ú_TRANSIENT_NET_EXC_NAMESÚanyÚ_TRANSIENT_HTTP_NEEDLESÚ
isinstanceÚOSErrorÚgaierrorr   Ú_TRANSIENT_ERRNOSÚ_TRANSIENT_OSERROR_NEEDLESÚ_DNS_FAILURE_NEEDLESÚ	__cause__Ú__context__)r   r(   ÚnÚeai_transientÚseenÚcurr   r   s   &     @@r   Ú$_is_transient_provider_resolve_errorrB   )   s³  ù€ ó ñ
 %ZóÙ$Y˜qÜ�6×ô 	Œ�ÖÑ$Yð ð ô
 “U€DØ#&€CØ
‹/œb ›g¨TÕ1Ø�‰”�C“ÔÜ�c“×%Ñ%×+Ð+¨ˆÜ�#‹h�n‰nÓˆÜ�‹9×ÑÔ!9Ô9Ùß‹3ÔEÑ$DÓE�3�3Š3ÔEÑ$DÓE×EÒEÏ#Ë#ô NAÝ(?óNAÏ#Ï#Ê#ô NAÝ(?óNA÷ KAò KAáÜ�cœ7×#Ò#Ü˜#Ÿ™×/Ò/Ø—9‘9 Ô-Ùð .ä˜˜g tÓ,Ô0AÔAÙß‹sÔJÕ/IÓJ�s�sŠsÔJÕ/IÓJ×JÒJÙç‹3Ô@Õ+?Ó@�3�3Š3Ô@Õ+?Ó@×@Ò@ÙØ�m‰m×.Ð.˜sŸ™‹Ùùò9s
   ‹I(£I(c               ó    € V ^8„  d   QhRRRR/# )r   ÚcfgÚdictr	   r
   r   )r   s   "r   r   r   P   s   € ÷ Zñ Z ð Z¨$ñ Zr   c                óš   € T ;'       g    / P                  R4      p\        V\        4      '       * ;'       g    VP                  RR4      RJ# )zAPreflight is ON unless ``cron.preflight`` is literally ``false``.ÚcronÚ	preflightTF)Úgetr6   rE   )rD   Úcron_cfgs   & r   Ú_cron_preflight_enabledrK   P   s?   € à—	�	�r�‰˜vÓ&€HÜ˜(¤DÓ)Ô)×YÐY¨X¯\©\¸+ÀtÓ-LÐTYÐ-YÐYr   c               ó$   € V ^8„  d   QhRRRRRR/# ©r   ÚjobrE   rD   r	   úOptional[str]r   )r   s   "r   r   r   V   s!   € ÷ $ñ $ tð $°$ð $¸=ñ $r   c           	     ó4  €  \         P                  ! W4      '       d   R#  \        TP	                  R4      \
        4      '       d   TP	                  R4      M/ pT P	                  R4      ;'       gG    \        T;'       g    / P	                  R4      ;'       g    R4      P                  4       ;'       g    RpT P	                  R4      ;'       g    \        R4      ;'       g    Rp^ RI	H
pHp  ^ R	IHp R
TRT/pT P	                  R4      '       d   T P	                  R4      TR&   T! R/ TB  R#   \         d     R# i ; i  T dB   p	T! T	4      '       d    Rp	?	R# RT	 R\        4        RT P	                  R4       R2u Rp	?	# Rp	?	i\         d     R# i ; i)uT  READ-ONLY probe: would provider resolution fail for lack of a key? Mirrors run_job's
requested-provider computation. Skipped when the job has a fallback chain â€” auth-fallback may
legitimately rescue a missing primary key. A pinned job has none (``_job_fallback_chain``), so
its missing key blocks even when the global chain is configured.NrG   ÚproviderÚmodel_providerr   ÚmodelÚHERMES_MODEL)Ú	AuthErrorÚis_rate_limited_auth_error)Úresolve_runtime_providerÚ	requestedÚtarget_modelÚbase_urlÚexplicit_base_urlzprovider credential missing: Ú zv. Set the provider API key in .env (or `hermes setup`) for that home, or pin a working provider via `hermes cron edit r,   z --provider <p>`.r   )Ú_schedÚ_job_fallback_chainÚ	Exceptionr6   rI   rE   r0   Ústripr   Úhermes_cli.authrU   rV   Úhermes_cli.runtime_providerrW   Ú_credential_store_scope_label)
rN   rD   Ú	_cron_cfgrX   rS   rU   rV   rW   Úkwargsr   s
   &&        r   Ú_preflight_check_provider_keyrf   V   su  € ð
Ü×%Ò% c×/Ò/Ùð 0ô
 $.¨c¯g©g°f«o¼t×#DÒ#D�—‘˜”È"€Ià�‰�
Ó×aÐaœs I§O O°×#8Ñ#8Ð9IÓ#J×#PÐ#PÈbÓQ×WÑWÓY×aÐaÐ]að à�G‰G�GÓ×FÐFÔ 0°Ó @×FÐFÀB€EçEðÝHØ˜y¨.¸%Ð@ˆØ�7‰7�:×ÒØ*-¯'©'°*Ó*=ˆFÐ&Ñ'Ù Ñ* 6Ò*ñ øô9 ô Úðûð ô 

Ù% c×*Ò*õ à+¨C¨5°Ô2OÓ2QÐ1Rð S6ð �w‰w�t‹}ˆoÐ.ð0õ	
ûô ô ÚðúsG   ‚D0 Ã/"E ÄE Ä0D?Ä>D?ÅFÅ	FÅ"FÅ?FÆFÆFÆFc               ó   € V ^8„  d   QhRR/# )r   r	   r0   r   )r   s   "r   r   r   }   s   € ÷ 
dñ 
d sñ 
dr   c                 óT   € ^ RI Hp  ^ RIHp RV ! 4       ;'       g    R RV! 4        R2# )a¸  ``[profile '<name>', HERMES_HOME <path>]`` for the home this preflight read credentials from.

The verdict must name the store it judged: a scheduler process whose home differs from the
shell where "the same credential works" (Docker HOME vs HERMES_HOME, a multiplexed satellite
profile, a gateway launched without the shell's env) otherwise reports a bare "No credentials
stored" that cannot be told apart from a real login gap (#116213).
)Úget_active_profile_name)Úget_hermes_homez
[profile 'Údefaultz', HERMES_HOME Ú])Úhermes_cli.profilesri   Úhermes_constantsrj   )ri   rj   s     r   rc   rc   }   s1   € õ <Ý0ØÑ/Ó1×>Ð>°YÐ?¸ÉÓO`ÐNaÐabÐcÐcr   c               ó   € V ^8„  d   QhRR/# )r   r	   Úlistr   )r   s   "r   r   r   Š   s   € ÷ *ñ *°$ñ *r   c                 óð  €  ^ RI Hp Hp V ! 4       p\        P                  ! V! 4       4      pVP                  4       P                  RR7      VP                  4       P                  RR7      8X  d   . # ^ RIHp V! VP                  4       4      pVP                  R4      pVf>   \        VP                  R4      \        4      '       d   VR,          P                  R4      p\        V\        4      '       g   . # ^ RIHp ^ RIHp V! V4       U	u. uF3  p	V	P"                  '       g   K  V! V	P$                  4      '       g   K1  V	NK5  	  up	# u up	i   \&         d    \(        P+                  R	R
R7       . u # i ; i)u_  Primary gateway ``profile_routes`` targeting the profile being served; ``[]`` if this IS the
primary home. Satellite crons are ticked and delivered by the primary gateway (a satellite
holding its own token is a ``duplicate_credential`` fatal). Reads the primary home's YAML
layers (user file + managed-scope overlay, top-level or nested ``gateway.``) through the same
loader ``load_gateway_config()`` uses, without bridging platform config into this process.
Shared by preflight rescue and delivery-time resolution so they cannot drift.

Under ``gateway.multiplex_profiles`` a satellite profile's cron jobs are ticked by the primary gateway's
in-process ticker (#69377) and delivered through the primary gateway's live adapters â€” the satellite
home never holds the platform credentials itself (giving it a token of its own is a
``duplicate_credential`` fatal).
)Úget_default_hermes_rootrj   F)Ústrict)Úread_yaml_layersÚprofile_routesÚgateway)Úparse_profile_routes)Úprofile_matches_homez0primary-gateway profile-route lookup unavailableT©Úexc_info)rn   rr   rj   r]   ÚPathÚ
expanduserÚresolveÚgateway.config_loaderrt   rI   r6   rE   rp   Úgateway.profile_routingrw   rm   rx   ÚenabledÚprofiler_   ÚloggerÚdebug)
rr   rj   Úprimary_homeÚcurrent_homert   ÚlayeredÚ
routes_rawrw   rx   Úroutes
             r   Ú(_primary_profile_routes_for_current_homer‰   Š   s?  € ðßMÙ.Ó0ˆÜ—{’{¡?Ó#4Ó5ˆà×#Ñ#Ó%×-Ñ-°UÐ-Ó;Ø×&Ñ&Ó(×0Ñ0¸Ð0Ó>ô?ð ˆIõ
 	;Ù" <×#:Ñ#:Ó#<Ó=ˆØ—[‘[Ð!1Ó2ˆ
ØÒ¤*¨W¯[©[¸Ó-CÄT×"JÒ"JØ  Õ+×/Ñ/Ð0@ÓAˆJÜ˜*¤d×+Ò+ØˆIå@Ý<á3°JÔ?ó
Ù?�eØ�}�}ô Ù!5°e·m±m×!D÷ ˆEÑ?ñ
ð 	
ùò 
øô ô Ü�‰ÐGÐRVˆÔWØŠ	ðús=   ‚A.E Á1BE Ã7E ÄE	Ä&E	Å E	ÅE Å	E Å$E5Å4E5c               ó    € V ^8„  d   QhRRRR/# )r   Úplatform_namer0   r	   r
   r   )r   s   "r   r   r   ·   s   € ÷ 	ñ 	À#ð 	È$ñ 	r   c                ó¸   a€ V P                  4       o\        ;QJ d'    V3R l\        4        4       F  '       g   K   R# 	  R# ! V3R l\        4        4       4      # )zŒTrue when the primary gateway routes this platform to the profile being served.

scheduler is currently serving (preflight rescue, #97476).
c              3  óp   <"  € T F+  p\        VP                  4      P                  4       S8H  x € K-  	  R # 5ir   )r0   Úplatformr1   )r   rˆ   Úplatform_keys   & €r   r   ÚA_delivery_platform_routed_from_primary_gateway.<locals>.<genexpr>½   s/   øé € ð á?ˆEô 	ˆE�N‰NÓ×!Ñ!Ó# |Ö3Û?ùs   ƒ36TF)r1   r4   r‰   )r‹   r�   s   &@r   Ú._delivery_platform_routed_from_primary_gatewayr‘   ·   sT   ø€ ð
 !×&Ñ&Ó(€Lß‹3ô ä=Ô?ó�3Œ3ð Š3ð ˆ3ô ä=Ô?óó ð r   c                  ó<   € ] tR t^ÃtRtR R ltR R ltR	R ltRtR# )
ÚSharedRouteAdaptersud  Read-only adapter map for a credentialless satellite profile. ``get(platform, target)``
resolves the PRIMARY adapter iff the inbound route matcher (``ProfileRoute.matches``) accepts
the target; anything else (unmatched target, disabled route, other profile, or target-less
``get(platform)``) is a miss â€” fail closed, never the default bot.

See #101113.
c               ó   € V ^8„  d   QhRR/# )r   r	   ÚNoner   )r   s   "r   r   Ú SharedRouteAdapters.__annotate__Ì   s   € ÷ *ñ *°Dñ *r   c                	ón   € \        T;'       g    / 4      V n        \        T;'       g    . 4      V n        R # r   )rE   Ú_primaryrp   Ú_routes)ÚselfÚprimary_adaptersÚroutess   &&&r   Ú__init__ÚSharedRouteAdapters.__init__Ì   s)   € ÜÐ-×3Ð3°Ó4ˆŒÜ˜FŸL˜L bÓ)ˆŽr   c               ó   € V ^8„  d   QhRR/# )r   r	   r
   r   )r   s   "r   r   r–   Ð   s   € ÷ :ñ :˜$ñ :r   c                	óf   € \        V P                  4      ;'       d    \        V P                  4      # r   )r
   r˜   r™   )rš   s   &r   Ú__bool__ÚSharedRouteAdapters.__bool__Ð   s"   € Ü�D—M‘MÓ"×9Ð9¤t¨D¯L©LÓ'9Ð9r   Nc                	óˆ  € V'       g   V# V P                   P                  V4      pVf   V# \        \        VRV4      4      P	                  4       p\        VP                  R4      ;'       g    R4      ;'       g    R pVP                  R4      pV'       d   \        V4      MR pV P
                   FŽ  p\        VP                  4      P	                  4       V8w  d   K-  VP                  '       g   VP                  '       g   KS  VP                  \        VP                  4      VP                  WgR7      '       g   KŒ  Vu # 	  V# )NÚvalueÚchat_idr   Ú	thread_id)Úguild_idr¥   r¦   )r˜   rI   r0   r*   r1   r™   rŽ   r¥   r¦   Úmatchesr§   )	rš   rŽ   Útargetrk   Úadapterr�   r¥   r¦   rˆ   s	   &&&&     r   rI   ÚSharedRouteAdapters.getÓ   sû   € ßØˆNØ—-‘-×#Ñ# HÓ-ˆØŠ?ØˆNÜœ7 8¨W°hÓ?Ó@×FÑFÓHˆÜ�f—j‘j Ó+×1Ð1¨rÓ2×:Ð:°dˆØ—J‘J˜{Ó+ˆ	ß&/”C˜	”N°Tˆ	ð —\”\ˆEÜ�5—>‘>Ó"×(Ñ(Ó*¨lÔ:ÙØ—M—M�M U§_§_ _ÙØ�}‰}Ü�E—N‘NÓ#¨e¯n©nÀgð ÷ ô ð ’ñ "ð ˆr   )r˜   r™   )NN)	r2   r/   Ú__qualname__Ú__firstlineno__Ú__doc__r�   r¡   rI   Ú__static_attributes__r   r   r   r“   r“   Ã   s   † ñõ*õ:÷ð r   r“   c               ó    € V ^8„  d   QhRRRR/# ©r   rN   rE   r	   rO   r   )r   s   "r   r   r   ì   s   € ÷ 9ñ 9 4ð 9¨Mñ 9r   c                ó   € \         P                  ! V P                  RR4      4      p\         P                  ! \         P                  ! V RR7      4      pV.pW!8w  d   VP	                  V4       . pV Fš  pVP                  R4       F‚  pVP                  4       pV'       d   VP                  4       R9   d   K2  \         P                  ! V4      e   KL  VP	                  VP                  R^4      ^ ,          P                  4       4       K„  	  Kœ  	  V'       g   R# RpV F®  p\         P                  ! V4      '       g	   RV R	2u # VfT    ^ R
I
Hp	 V	! 4       p
V
P                  4        Uu0 uF  q»P                  kK  	  ppV\         P                  ! V4      ,          pVP                  4       V9  g   K•  \%        V4      '       d   K¨  RV R2u # 	  R# u upi   \         d    \         P#                  RRR7         R# i ; i)u–  Check delivery targets resolve to configured platforms. ``local``/``origin``/``all`` are
never checked (no gateway-config load). Unknown platform always blocks; known platform blocks
only if the gateway config loads AND reports it unconnected; config load failures fail OPEN.
``failure_deliver`` gets the same rules â€” a typo'd failure platform would otherwise only
surface when a failure occurs (NS-788).ÚdeliverÚlocalT)Úfor_failureÚ,NÚ:zdelivery platform 'zu' is not a known cron delivery target. Fix the job's `deliver` value or configure the platform's gateway credentials.)Úload_gateway_configuL   preflight: gateway config unavailable â€” skipping delivery credential checkry   z~' has no gateway credentials configured (not connected). Configure it via `hermes setup` or change the job's `deliver` target.>   Úallr´   Úorigin)Ú	_deliveryÚ_normalize_deliver_valuerI   Ú_delivery_lane_valueÚappendÚsplitr`   r1   Úparse_bot_chat_deliver_tokenÚ_is_known_delivery_platformÚgateway.configr¸   Úget_connected_platformsr¤   Ú!_relay_fronted_delivery_platformsr_   r‚   rƒ   r‘   )rN   Údeliver_valueÚfailure_deliver_valueÚlane_valuesÚplatform_partsÚ
lane_valueÚpartÚ	connectedr‹   r¸   Úgateway_configÚps   &           r   Ú_preflight_check_deliveryrÎ   ì   sÚ  € ô ×6Ò6°s·w±w¸yÈ'Ó7RÓS€MÜ%×>Ò>Ü×&Ò& s¸Ô=ó?Ðà �/€KØÔ-Ø×ÑÐ0Ô1Ø "€NÛ!ˆ
Ø×$Ñ$ SÖ)ˆDØ—:‘:“<ˆDß˜4Ÿ:™:›<Ð+EÔEÙä×5Ò5°dÓ;ÒGÙØ×!Ñ! $§*¡*¨S°!Ó"4°QÕ"7×"=Ñ"=Ó"?Ö@ó *ñ "÷ Ùà#€IÛ'ˆÜ×4Ò4°]×CÒCà% m _ð 56ð 6òð
 Òð	Ý>Ù!4Ó!6�Ø.<×.TÑ.TÔ.VÓWÑ.V¨ŸWœWÑ.V�	ÐWØœY×HÒHÈÓSÕS�	ð ×ÑÓ!¨Ö2ô CÀ=×QÔQð & m _ð 5Gð Gòñ5 (ñ> ùò) Xøäô Ü—‘ð0Ø:>ð ô @ó ð	ús$   Å	GÅ(GÅ<GÇGÇ"G=Ç<G=c               ó    € V ^8„  d   QhRRRR/# r±   r   )r   s   "r   r   r   /  s   € ÷ ñ  ð ¨-ñ r   c           
     ó^  € ^ RI Hp V! V 4      pV'       g   R# ^ RIHp V Fî  p \        P
                  ! V! V4      4      p\        T\        4      '       d   TP                  R4      '       g   KO  TP                  R4      '       g   TP                  R4      R8X  g   K~  \         UUUu. uF8  w  rgTP                  T4      ;'       g    .  F  pTP                  T4      NK  	  K:  	  p	pppRP                  T	4      ;'       g    Rp
R	T R
T
 R2u # 	  R#   \         d     EK  i ; iu upppi )z¯Block only on an affirmative ``setup_needed`` verdict from ``skill_view``; skills that fail
to load fall through to ``_build_job_prompt``'s skipped-skill handling (fail-open).)Ú_job_skill_namesN)Ú
skill_viewÚsuccessÚsetup_neededÚreadiness_statusú, zrequired setup incompletezattached skill 'z' is not ready: missing zF. Provide the missing prerequisites or detach the skill from this job.)Úcron.scheduler_promptrÑ   Útools.skills_toolrÒ   ÚjsonÚloadsr_   r6   rE   rI   Ú_SKILL_MISSING_FIELDSr   Újoin)rN   rÑ   Úskill_namesrÒ   Ú
skill_nameÚpayloadÚkeyÚfmtÚnameÚmissingÚdetails   &          r   Ú_preflight_check_skillsrå   /  s  € õ 7Ù" 3Ó'€KßÙÝ,Û!ˆ
ð	Ü—j’j¡¨JÓ!7Ó8ˆGô ˜'¤4×(Ò(°·±¸I×0FÒ0FÙØ�;‰;�~×&Ò&¨'¯+©+Ð6HÓ*IÈ^Ö*[õ !6õá 5‘H�CØ#ŸK™K¨Ó,×2Ð2°Ò2�Dð —
‘
˜4Ö á2ñ !Ù 5ð ò ð
 —Y‘Y˜wÓ'×FÐFÐ+FˆFà" : ,Ð.FØ�(ð 'ð'òñ "ñ& øô! ô 	Ûð	üô
s   ¥DÂ)D(
ÃD(
ÄD%Ä$D%r+   Ú_RECONNECTING_WARNEDc               ó$   € V ^8„  d   QhRRRRRR/# rM   r   )r   s   "r   r   r   Q  s!   € ÷ /ñ / tð /°$ð /¸=ñ /r   c                óR  aa	a
€ V P                  R4      ;'       g    .  Uu. uF  p\        V4      NK  	  ppV'       g   R# ^ RIHp ^ RIHp ^ RIHo	 V Uu. uF#  pW$! V4      9   g   K  V! V4      '       d   K!  VNK%  	  pp\        V	3R lV 4       4      o
\        V P                  RR4      4      o\        P                  VV
3R	 l\        \        4       4       4       S
 Uu. uF  pSV3\        9  g   K  VNK  	  ppV'       dF   \        P                  V3R
 lV 4       4       \        P                  RSRP                  V4      4       S
'       d   V Uu. uF  q"S
9  g   K  VNK  	  ppV'       g   R# RRP                  \        V4      4       R2# u upi u upi u upi u upi )aÍ  Reason when an MCP server the job's own ``enabled_toolsets`` names resolves to zero tools.

Runs AFTER cron MCP discovery. The server's toolset alias is process-global while its tools
are registered per profile overlay, so under a multiplexer a job can name a server that is
connected for another profile and build a tool-less agent that ``quiet_mode`` never reports.
Only servers the job explicitly asked for count; the implicit enabled-server merge does not.
Úenabled_toolsetsN)Úenabled_mcp_server_names)Úresolve_toolset)Úmcp_server_reconnectingc              3  óH   <"  € T F  pS! V4      '       g   K  Vx € K  	  R # 5ir   r   )r   râ   rì   s   & €r   r   Ú0_empty_requested_mcp_toolsets.<locals>.<genexpr>e  s   øé € ÐT©7 4Ñ6MÈd×6SŸ$š$«7ùs   ƒ"˜
"r,   Ú?c              3  óf   <"  € T F&  q^ ,          S8X  g   K  V^,          S9  g   K"  Vx € K(  	  R# 5i)é    Nr   )r   rà   Újob_idÚreconnectings   & €€r   r   rî   i  s/   øé € ð +fÙ1�¸µV¸vÑ5EŒÈ#ÈaÍ&ÐXdÑJd�ŠÓ1ùs   ƒ1—1§
1c              3  ó,   <"  € T F	  pSV3x € K  	  R # 5ir   r   )r   râ   rò   s   & €r   r   rî   m  s   øé € Ð#H¹x°t V¨T¥N»xùr   u¶   Job '%s': MCP server(s) %s named in enabled_toolsets are reconnecting â€” running without their tools until they recover (a server parked on a permanent error blocks the job instead)rÖ   zMCP server(s) u�   named in this job's enabled_toolsets resolved to zero tools for this profile (never connected for this profile, or connected for another profile only). If the server is only temporarily unreachable this clears by itself â€” the check re-runs on every dispatch and the job resumes once the server reconnects. If the name is wrong or belongs to another profile, fix the server or remove it from the job's toolsets.)rI   r0   Úhermes_cli.tools_configrê   Útoolsetsrë   Útools.mcp_tool_discoveryrì   Úsortedræ   Údifference_updaterp   Úupdater‚   ÚwarningrÜ   )rN   rD   râ   rX   rê   rë   rã   Úunwarnedrò   rì   ró   s   &&      @@@r   Ú_empty_requested_mcp_toolsetsrý   Q  sˆ  ú€ ð ),¯©Ð0BÓ(C×(IÐ(IÀrÐ(IÓKÑ(I˜t”�T–Ñ(I€IÐKßÙÝ@Ý(Ý@Ù )ó W¡	˜ØÐ2°3Ó7Ñ7ô Ù@OÐPT×@U÷ ˆt¡	€Gð Wô ÔT©7ÓTÓT€LÜ�—‘˜˜sÓ#Ó$€Fô ×*Ñ*õ +fÜÔ0Ô1ó+fô fá!-Ó\¡˜°&¸$°ÔG[Ñ1[—�¡€HÐ\ßÜ×#Ñ#Ô#H¹xÓ#HÔHÜ�‰ðà &¨¯	©	°(Ó(;ô	=÷ Ù$+ÓH¡G˜D¸<Ñ/G—4�4¡GˆÐHßÙð ˜Ÿ™¤6¨'£?Ó3Ð4ð 5ð 	ðùòC LùòWùò ]ùò Is/   ¡FÁFÁ*FÁ:FÃ#FÃ7FÅF$Å%F$c               ó$   € V ^8„  d   QhRRRRRR/# rM   r   )r   s   "r   r   r   ƒ  s!   € ÷ ñ ˜tð ¨$ð °=ñ r   c                óÈ   a a€ RVV 3R l3RV 3R l3RV 3R l33 F  w  r# V! 4       pT'       g   K  Tu # 	  R
#   \          d    \        P                  RTRR	7        KE  i ; i)u¯  Pre-dispatch validation: return a reason (missing key, unconfigured delivery, unready skill)
so the caller refuses BEFORE building agent machinery or burning an LLM call. Every check fails
open â€” preflight blocks only on an affirmative misconfiguration verdict.

Same fail-before-spend spirit as the fail-loud-on-hidden-tools direction in #27948; alert dedup
follows the alert-once pattern from the dead-pin auto-pause (#73506).
Úprovider_keyc                 ó   <€ \        SS 4      # r   )rf   )rD   rN   s   €€r   Ú<lambda>Ú'_preflight_job_config.<locals>.<lambda>Œ  s   ø€ Ô!>¸sÀCÔ!Hr   Úskillsc                 ó   <€ \        S 4      # r   )rå   ©rN   s   €r   r  r  �  s   ø€ Ô2°3Ô7r   Údeliveryc                 ó   <€ \        S 4      # r   )rÎ   r  s   €r   r  r  Ž  s   ø€ Ô6°sÔ;r   u*   preflight check %s raised â€” failing openTry   N)r_   r‚   rƒ   )rN   rD   râ   ÚcheckÚreasons   ff   r   Ú_preflight_job_configr  ƒ  ss   ù€ ð 
ÕHÐIØ	Ô7Ð8Ø	Ô;Ð<ó>‰ˆð	Ù“WˆF÷ ‰6ØŠMñ>ñ øô ô 	Ü�L‰LÐEÀtÐVZˆLÔ[Úð	ús   ¡:º#A!Á A!)Ú	scheduler)Úscheduler_delivery>   ÚPoolTimeoutÚReadTimeoutÚConnectErrorÚNetworkErrorÚWriteTimeoutÚClientOSErrorÚConnectTimeoutÚTimeoutExceptionÚServerTimeoutErrorÚClientConnectorErrorÚClientConnectorDNSError)znodename nor servnamezname or service not known)z$temporary failure in name resolutionznetwork is unreachable)zfailed to resolvezconnection refusedz	timed outÚtimeout))Ú&missing_required_environment_variableszenv ${})Úmissing_required_commandszcommand '{}')Úmissing_credential_fileszcredential file {})1Ú__conditional_annotations__r®   Ú
__future__r   r   rÙ   ÚloggingÚosÚtypingr   Úcron.env_settingsr   Ú	getLoggerr‚   ÚBLOCKED_CONFIG_MARKERÚBLOCKED_CONFIG_SILENT_MARKERÚ	frozensetr3   r;   r:   r5   ÚECONNREFUSEDÚ
ECONNRESETÚEHOSTUNREACHÚENETUNREACHÚENETDOWNÚ	ETIMEDOUTÚEAGAINr9   rB   rK   rf   rc   r‰   r‘   r“   rÎ   rÛ   rå   r+   ræ   Ú__annotations__rý   r  rG   r  r]   r  r»   )r  s   @r   Ú<module>r/     s*  øðôõ #ã Û Û Û 	Ý å .ð 
×	Ò	Ð+Ó	,€ð +Ð Ø8Ð á$ò &ó Ð ð NÐ Ø1ð 5Fõ FÐ à4ð 8Gõ GÐ áØ	×Ñ˜×(Ñ(¨%×*<Ñ*<¸e×>OÑ>OÐQV×Q_ÑQ_Ø	‡O�O�U—\‘\ð#ó $Ð õ
$õNZõ$õN
dõ*õZ	÷&ñ &õR9ðz8Ð õñ>  ›EÐ �cÓ !õ/õdõ0 %ß 0r   