+
    5mjS c                  	   ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIt^ RIHtHt R R ltR R lt]P0                  R	 R
 l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 l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& lt']PP                  PS                  R'R(R).R*R+.R,.R-.R...4      R/ R0 l4       t*R1 R2 lt+R3 R4 lt,R5 R6 lt-]PP                  PS                  R. RO4      R8 R9 l4       t.]PP                  PS                  R:. RO4      R; R< l4       t/R= R> lt0R? R@ lt1RA RB lt2RC RD lt3RE RF lt4]PP                  PS                  R. RO4      RG RH l4       t5]PP                  PS                  R:. RO4      ]PP                  PS                  R. RO4      RJ RK l4       4       t6]PP                  PS                  RIRLRM.4      RN RO l4       t7]PP                  PS                  RIRLRM.4      RP RQ l4       t8]PP                  PS                  R:. RO4      ]PP                  PS                  RIRLRM.4      RR RS l4       4       t9]PP                  PS                  R:. RO4      RT RU l4       t:]PP                  PS                  RVRWR7.RXR7.RY.RZ..4      R[ R\ l4       t;]PP                  PS                  RR^R_.R^R`.3RaR_.RaR`.3Rb.Rc.3Rd.Re.3.4      Rf Rg l4       t<Rh Ri lt=Rj Rk lt>Rl Rm lt?]PP                  PS                  Rn. RO4      Ro Rp l4       t@]PP                  PS                  Rn. RO4      Rq Rr l4       tARs Rt ltBRu Rv ltCRw Rx ltDRy Rz ltER{ R| ltF]PP                  PS                  R]R^R}.RaR}.R~.R.R..4      R R l4       tGR R ltHR R ltIR R ltJR R ltK]PP                  PS                  R. RO. ROR7      R R l4       tLR R ltMR R ltN]PP                  PS                  RRR.4      ]PP                  PS                  RRR.4      R R l4       4       tOR R ltPR R ltQR R ltRR R ltSR R ltTR R ltUR R ltVR R ltWR R ltXR R ltYR R ltZR 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 ltaR R ltbR R ltcR R ltdR R lteR R ltfR R ltgR R lthR R ltiR R ltjR# )    )annotationsN)Path)AccountSnapshotHealthStatusc               $    V ^8  d   QhRRRRRR/# )   base_dirr   payloadzdict[str, object]returnNone )formats   "c/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/tests/test_command_router.py__annotate__r      s"      $ ): t     c                    V R ,          pVP                  RRR7       W!R,          ,          P                  \        P                  ! VR,          4      RR7       R# )%.local/state/overdeck/systray/runtimeTparentsexist_okfilenamerulesutf-8encodingNmkdir
write_textjsondumps)r   r	   tray_dirs   && r   write_rulesr!      sL    AAHNN4$N/
##//

77#$ 0 r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r	   zdict[str, dict[str, object]]r   strr
   r   r   )r   s   "r   r   r      s1     L L4 L*F LRU LZ^ Lr   c                    V R ,          pVP                  RRR7       W2,          P                  \        P                  ! V4      RR7       R# )r   Tr   r   r   Nr   )r   r	   r   r    s   &&& r   write_healthr%      s<    AAHNN4$N/$$TZZ%87$Kr   c               $    V ^8  d   QhRRRRRR/# )r   tmp_pathr   monkeypatchpytest.MonkeyPatchr
   r   )r   s   "r   r   r   "   s"      4 &8 T r   c                R   a  VP                  \        P                  R V 3R l4       S # )homec                    < S # Nr   )r'   s   r   <lambda>home.<locals>.<lambda>#   s    Xr   )setattrcommand_routerr   )r'   r(   s   f&r   r+   r+   !   s!    ++V5EFOr   c                   V ^8  d   QhRR/# r   r
   r   r   )r   s   "r   r   r   '   s     D DD Dr   c                 f   \         P                  p ^ pRq ! W4      p\        P                  qCV8H  qU'       Egg   \        P
                  ! RV3RW434      RR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR	\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR	R
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;rT\         P                  p ^pRq ! W4      p^qV8H  qU'       Eg   \        P
                  ! RV3RW834      RR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p ;p;p;p;rX\         P                  p ^ pRq ! W4      p^ qV8H  qU'       Eg   \        P
                  ! RV3RW834      RR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p ;p;p;p;rXR# )r   zresult missingpy0r1   py2py4py6py8py10remote_dispatchpy12assert %(py14)spy14Npy11zassert %(py13)spy13==)z%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s._result_transport_exit_code
}(%(py4)s, %(py6)s)
} == %(py12)s
{%(py12)s = %(py10)s.EXIT_MIRROR
})zk%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s._result_transport_exit_code
}(%(py4)s, %(py6)s)
} == %(py11)s)r1   _result_transport_exit_coder;   EXIT_MIRROR
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)@py_assert1@py_assert3@py_assert5@py_assert7@py_assert11@py_assert9@py_format13@py_format15@py_assert10@py_format12@py_format14s              r   Btest_result_transport_failure_overrides_only_successful_agent_exitrX   '   s@   55iai9Ii5aJioNiNiiNiiiiiiJiiiiii>iiii>iii5iiiaiii9IiiiJiiiiiioiiiioiiiNiiiiiiiiii55QbQ:JQ5bKQrQrQQQQQKQQQQQQ>QQQQ>QQQ5QQQbQQQ:JQQQKQQQrQQQQQQQQQ55CaCC5a>C!C!CCCCC>CCCCCC>CCCC>CCC5CCCaCCCCCC>CCC!CCCCCCCCCr   c               (    V ^8  d   QhRRRRRRRR/# 	r   r+   r   r(   r)   capsyspytest.CaptureFixture[str]r
   r   r   )r   s   "r   r   r   -   s6     .\ .\
.\#.\ '.\ 
	.\r   c                j  a \        V R RRRRR/RRRR	.R
RR^d//4       R/ F1  pV R,          R,          V,          R,          P                  RR7       K3  	  \        V RRRR^
R^//R4       VP                  \        RR0R l4       \        P
                  ! \        P                  ! 4       \        P                  R7      pRoR V3R llpVP                  \        P                  RV4       VP                  RR .4      pVP                  4       p^qV8H  q'       g   \        P                  ! R1V	3R2Wh34      R!R"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR"R#\        P                   ! V4      /,          p
R$R%V
/,          p\#        \        P$                  ! V4      4      hR;rRpSVJ q'       g   \        P                  ! R3V	3R4SV34      R!R&\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR&R#\        P                   ! V4      /,          p
R$R%V
/,          p\#        \        P$                  ! V4      4      hR;rVP&                  qP(                  q! 4       pR'qV8H  q'       g   \        P                  ! R1V3R5W34      R!R(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR(R)\        P                   ! V	4      R*\        P                   ! V4      R+\        P                   ! V4      R,\        P                   ! V4      /,          pR-R.V/,          p\#        \        P$                  ! V4      4      hR;p	;p;p;rR# )6r   routing_rules.jsonr   projectszync.isavidefaultrafafallback_chainroyfallback_triggerbroken_or_quota_exhaustedquota_exhausted_threshold_pctr   accounts
CODEX_HOMETr   statusokprimary_used_pctsecondary_used_pcthealth_cache.jsondetect_project_nameNc                    R # r`   r   cwds   &r   r.   Utest_codex_router_rejects_missing_project_account_using_known_slugs.<locals>.<lambda>H       PYr   rq   Fc               (    V ^8  d   QhRRRRRRRR/# 	r   filer#   args	list[str]envdict[str, str]r
   r   r   )r   s   "r   r   Ytest_codex_router_rejects_missing_project_account_using_known_slugs.<locals>.__annotate__P   (      3 i n  r   c                   < R oR# TNr   r{   r|   r~   exec_calleds   &&&r   fake_execvpeYtest_codex_router_rejects_missing_project_account_using_known_slugs.<locals>.fake_execvpeP       r   execvpecdxchatr5   	exit_codepy3assert %(py5)spy5r   z6cdx: no healthy account available: avi=unknown-accountcapturedr6   r7   r8   py9assert %(py11)sr?   rc   re   r-   rA   z%(py0)s == %(py3)sisz%(py0)s is %(py3)sz]%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.err
}.strip
}()
} == %(py9)s)r!   r   r%   r0   r1   CommandRouterCodexAdapterrq   osmain
readouterrrE   rF   rG   rH   rI   rJ   rK   rL   errstrip)r+   r(   r[   slugrouterr   r   r   @py_assert2rM   @py_format4@py_format6rN   rO   @py_assert8rP   @py_format10rV   r   s   &&&               @r   Ctest_codex_router_rejects_missing_project_account_using_known_slugsr   -   s   
 ,Y.6 5'"$?/		
  	7	7*	Dt	Kl	Zaajnao  Xt%7=QSUV	
 	 (=?YZ))##%*>>F
 K  ))9lCUFO,I  "H>999;%;%;;%<<[[[#[[#[[[[[[[[[[[[8[[[[8[[[<[[[[[[[[[#[[[[[[[[[[r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   ^   s0     '& '&
'&#'& ''& 
	'&r   c                *  a \        V R RRR/ RRRR.RR	R
^d//4       VP                  \        RR"R l4       \        V / R4       \        P                  ! \        P
                  ! 4       \        P                  R7      pRoR V3R llpVP                  \        P                  RV4       VP                  RR.4      pVP                  4       p^quV8H  q'       g   \        P                  ! R#V3R$WW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\!        \        P"                  ! V
4      4      hR;rRpSVJ q'       g   \        P                  ! R%V3R&SV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\!        \        P"                  ! V
4      4      hR;rRqP$                  qV9   qw'       g   \        P                  ! R'V3R(W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p
RR V
/,          p\!        \        P"                  ! V4      4      hR;p;r|R!qP$                  qV9  qw'       g   \        P                  ! R)V3R*W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p
RR V
/,          p\!        \        P"                  ! V4      4      hR;p;r|R# )+r   claude_routing_rules.jsonr   r_   rb   ra   rd   re   rf   rg   rh   rq   Nc                    R # unknownr   rt   s   &r   r.   Btest_cld_router_prefixes_errors_without_cdx_leak.<locals>.<lambda>p   rw   r   claude_health_cache.jsonrx   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Ftest_cld_router_prefixes_errors_without_cdx_leak.<locals>.__annotate__y   r   r   c                   < R oR# r   r   r   s   &&&r   r   Ftest_cld_router_prefixes_errors_without_cdx_leak.<locals>.fake_execvpey   r   r   r   cldr   r5   r   r   r   r   r   z6cld: no healthy account available: avi=unknown-accountpy1r   assert %(py7)spy7zcdx:r-   rA   r   r   r   inz+%(py1)s in %(py5)s
{%(py5)s = %(py3)s.err
}not inz/%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.err
})r!   r0   r1   r%   r   ClaudeAdapterrq   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   )r+   r(   r[   r   r   r   r   r   rM   r   r   @py_assert0@py_assert4@py_format8r   s   &&&           @r   0test_cld_router_prefixes_errors_without_cdx_leakr   ^   ss   
 3B5 5'"$?/		
 (=?YZr56))$$&*>>F
 K  ))9lCUFO,I  "H>999;%;%;;%CS||S|SSSSSCSSSCSSSSSSxSSSSxSSS|SSSSSSSS%%%%%%%6%%%6%%%%%%%%%%%%%%%%%%%%%r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r      s      D r   c                 6   \        \        P                  ^Z^PRRR7      p \        P                  pRq!! WR7      pRqCV8H  qU'       EgJ   \
        P                  ! RV3RVV34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      R	R
\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MR
R\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;p;p;rTR# )Z   g   @TAg  ?TA)primary_reset_atsecondary_reset_at)nowz$5h: 90% (0m left), 7d: 80% (0m left)r5   r1   r6   r   snapshotr   r   r:   assert %(py12)sr<   NrA   )zm%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s._format_cli_usage_summary
}(%(py3)s, now=%(py5)s)
} == %(py10)s)r   r   OKr1   _format_cli_usage_summaryrE   rF   rG   rH   rI   rJ   rK   rL   )r   rM   r   @py_assert6rR   r   @py_format11rS   s           r   :test_cli_usage_summary_uses_zero_minutes_for_expired_resetr      s_   

(*H 33 / 3HR ..   R.    >   >   3     H   H   /   R   .       r   c               $    V ^8  d   QhRRRRRR/# r   r+   r   r(   r)   r
   r   r   )r   s   "r   r   r      s&     ; ;
;#; 
;r   c           	        V R ,          R,          R,          R,          pVP                  RR7       V R ,          R,          P                  \        P                  ! RRRRR	/./4      R
R7       \        P
                  ! \        P                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       VP                  . RO4      p\        P                  qTV8H  qf'       Eg   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRRR\        P                  ! 4       9   g!   \        P                   ! \        4      '       d   \        P"                  ! \        4      MRR\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR;reR# ).codex-trayri   
legacyacctrj   Trk   accounts.jsonr   aliasLegacyr   r   rx   sync_before_execc                    R # r-   r   selfr   s   &&r   r.   Wtest_codex_router_explicit_override_resolves_via_legacy_candidate_dir.<locals>.<lambda>       tr   r5   r   r6   r;   r7   assert %(py6)sr8   N)r   	--accountr   r   rA   z:%(py0)s == %(py4)s
{%(py4)s = %(py2)s.EXIT_UNCONTAINABLE
})r   r   r   r   r1   r   r   rq   r0   r   r;   EXIT_UNCONTAINABLErE   rF   rG   rH   rI   rJ   rK   rL   )	r+   r(   legacy_homer   r   rN   rM   @py_format5@py_format7s	   &&       r   Etest_codex_router_explicit_override_resolves_via_legacy_candidate_dirr      sM    &3lB\QKd#	MO+77

J&,!J KLM 8  ))##%*>>F ### FGI':::::::::9::::::9::::9:::::::::::::::::::::::r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r      s&     7 7
7#7 
7r   c                   V R ,          pR F*  pVR,          V,          R,          P                  RR7       K,  	  VR,          P                  \        P                  ! RRRR	R
/RRR	R/./4      RR7       \        P
                  ! \        P                  ! 4       4      pVP                  R4      pVRVR,          R,          R,          3qeV8H  qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;rvVP                   qwP"                  p
RqV8H  q'       g   \        P                  ! RV3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p
;rR# )r   re   workri   rj   Trk   r   r   r   PersonalOfficer   r   zpersonal,OFFICEr5   resolvedr   r   r   Nr   r6   r7   r   assert %(py9)sr   re   r   rA   r   zN%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s._last_route
}.chain
} == %(py7)sr   r   r   r   r1   r   r   _resolve_accountrE   rF   rG   rH   rI   rJ   rK   rL   _last_routechain)r+   r(   trayr   r   r   r   rM   r   r   rN   r   rO   r   r   s   &&             r   Atest_codex_router_explicit_override_resolves_labels_to_slug_chainr      s    99D	
	T	!L	0777E  	O''

65':>QXZb@cde	
 	 (  )).*E*E*GHF&&'89HeTJ%6%>%MNNNNNNNN8NNNNNN8NNNN8NNNNNNNNNNNN6##6666666#666666666666666666#66666666666r   c                    V ^8  d   QhRRRR/# r   r+   r   r
   r   r   )r   s   "r   r   r      s     7 7
7	7r   c                    V R ,          pR F*  pVR,          V,          R,          P                  RR7       K,  	  VR,          P                  \        P                  ! RRRR	R
/RRR	R/./4      RR7       VR,          P                  RRR7       \        P
                  ! \        P                  ! 4       4      pVP                  R4      pRqTVJqf'       g   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reVP                   qfP"                  p	RqV
8H  q'       g   \        P                  ! R V3R!W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p	;rR# )"r   re   r   ri   rj   Trk   r   r   r   r   r   r   r   default_slugzwork
zPersonal,dynamicNr5   r   r   r   r   r   r6   r7   r   r   r   r   is notz%(py0)s is not %(py3)srA   r   r   r+   r   r   r   r   r   rM   r   r   rN   r   rO   r   r   s   &             r   Atest_codex_router_explicit_override_resolves_dynamic_after_labelsr      s    99D	
	T	!L	0777E  	O''

65':>QXZb@cde	
 	 (  
N&&x'&B)).*E*E*GHF&&'9:H488846##6666666#666666666666666666#66666666666r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s       $ r   c                x   \         P                  ! 4       pV R ,          pVP                  RR7       VP                  R\	        V4      /4      p\
        P                  pRpRpRpW',          q! VVVR7      qV	8H  q'       Eg   \        P                  ! RV
3RW934      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
R\        P                  ! 4       9   g!   \        P                  ! \
        4      '       d   \        P                  ! \
        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p
;p;p;p;p;rR# )z>.local/state/overdeck/systray/runtime/accounts/acct/CODEX_HOMETrk   rj   codexacct	auth.jsonruntimer   pathr5   
credentialr6   r;   r7   r8   r9   r   account_homer?   r>   assert %(py16)spy16NrA   z%(py0)s == %(py14)s
{%(py14)s = %(py4)s
{%(py4)s = %(py2)s.Credential
}(runtime=%(py6)s, slug=%(py8)s, path=(%(py9)s / %(py11)s))
})r1   r   r   r  r#   r;   
CredentialrE   rF   rG   rH   rI   rJ   rK   rL   r+   adapterr  r  rN   rO   rP   rU   @py_assert12@py_assert13rM   rT   @py_format17s   &            r   6test_codex_adapter_credential_builds_expected_identityr     s   ))+GZZLt$##\3|3D$EFJ(33  ( '3'      	:   	  	:   	:   	  	   	   	3   	  	  	  	   	   	 (  	       	   r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s      $ 4 r   c                x   \         P                  ! 4       pV R ,          pVP                  RR7       VP                  R\	        V4      /4      p\
        P                  pRpRpRpW',          q! VVVR7      qV	8H  q'       Eg   \        P                  ! RV
3RW934      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
R\        P                  ! 4       9   g!   \        P                  ! \
        4      '       d   \        P                  ! \
        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p
;p;p;p;p;rR# )zF.local/state/overdeck/systray/runtime/claude-accounts/acct/CLAUDE_HOMETrk   CLAUDE_CONFIG_DIRclauder  z.credentials.jsonr  r5   r  r6   r;   r7   r8   r9   r   r  r?   r>   r  r	  NrA   r
  )r1   r   r   r  r#   r;   r  rE   rF   rG   rH   rI   rJ   rK   rL   r  s   &            r   7test_claude_adapter_credential_builds_expected_identityr     s   **,GWW  t$##%8#l:K$LMJ(33  0 /3/      	:   	  	:   	:   	  	   	   	3   	  	  	  	   	   	 0  	       	   r   c               $    V ^8  d   QhRRRRRR/# r   r+   r   r[   r\   r
   r   r   )r   s   "r   r   r      s+     C C
C&C 
Cr   c                
   V R ,          pR F*  pVR,          V,          R,          P                  RR7       K,  	  VR,          P                  \        P                  ! RRRR	R
/RRR	R/./4      RR7       \        P
                  ! \        P                  ! 4       4      pVP                  . RO4      pVP                  4       p^ quV8H  q'       g   \        P                  ! RV3R WW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                   ! V
4      4      hR;r\        P"                  qP$                  q! V4      pRR/qV8H  q'       EgI   \        P                  ! RV3R!W34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;p;rR# )"r   re   r   ri   rj   Trk   r   r   r   r   r   r   r   r5   r   r   r   r   Nprofilezdynamic,workr   r6   r   r   r:   r   r<   r   )r   route--canonicalz--profile=dynamic,OFFICErA   r   ze%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.loads
}(%(py5)s
{%(py5)s = %(py3)s.out
})
} == %(py10)s)r   r   r   r   r1   r   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   loadsout)r+   r[   r   r   r   r   r   r   rM   r   r   r   r   rR   r   r   rS   s   &&               r   Gtest_codex_route_canonical_maps_labels_to_ids_and_keeps_dynamic_literalr      s    99D	
	T	!L	0777E  	O''

65':>QXZb@cde	
 	 (  )).*E*E*GHFWXI  "H>999::BllB:l#B	>'BB'BBBBBB#BBBBBB4BBBB4BBB:BBBBBBhBBBBhBBBlBBB#BBB'BBBBBBBBBBr   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r     s&     & &
&&& 
&r   c                   V R ,          pVR,          R,          R,          P                  RR7       VR,          P                  \        P                  ! RRRRR	/./4      R
R7       \        P
                  ! \        P                  ! 4       4      pVP                  . RO4      pVP                  4       p^qdV8H  qw'       g   \        P                  ! RV3R WF34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rvRqP"                  qV9   qf'       g   \        P                  ! R!V3R"W34      R\        P                  ! V
4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RRV	/,          p\        \        P                   ! V4      4      hR;p
;rkVP$                  qwP&                  q! 4       pRqV8H  pV'       g   \        P                  ! RV3R#W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;p;ppR# )$r   ri   re   rj   Trk   r   r   r   r   r   r   r5   r   r    r   r   Nzunknown account: ghostr   r   r   r   r6   r7   r8   r   r   r?   )r   r  r  z--profile=ghostrA   r   r   r   )z]%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.out
}.strip
}()
} == %(py9)s)r   r   r   r   r1   r   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r  r   )r+   r[   r   r   r   r   r   rM   r   r   r   r   r   rN   rO   r   rP   r   rV   s   &&                 r   8test_codex_route_canonical_fails_closed_on_unknown_tokenr$    s    99D	J-44T4B	O''

J&%*!E FGH (  )).*E*E*GHFNOI  "H>999#3||3|33333#333#333333x3333x333|33333333<<%%%2%2%%%%%%%%%%%8%%%%8%%%<%%%%%%%%%2%%%%%%%%%r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   !  s     Q Q$ Qr   c                    \         P                  p . ROq! V4      q"'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;r\         P                  p R .q! V4      q"'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;r\         P                  p . ROq! V4      q"'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;r\         P                  p . ROq! V4      q"'       g   RRR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;r\         P                  p R	.q! V4      q"'       * qD'       g   R
RR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;p;r$\         P                  p . q! V4      q"'       * qD'       g   R
RR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;p;r$\         P                  p R.q! V4      q"'       * qD'       g   R
RR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;p;r$\         P                  p RR .q! V4      q"'       * qD'       g   R
RR\        P                  ! 4       9   g!   \        P
                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p ;p;r$R# )execzTassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.is_exec_invocation
}(%(py4)s)
}r5   r1   r6   r7   r8   N--ask-for-approvalr   zXassert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.is_exec_invocation
}(%(py4)s)
}z--statusr'  -mgpt-5.4prompt)r(  neverr'  r,  )z--profile=workr'  r,  )	r1   is_exec_invocationrG   rH   rE   rI   rJ   rK   rL   )rM   rN   rO   r   rP   r   s         r   0test_is_exec_invocation_detects_exec_after_flagsr/  !  s   ,,Q-PQ,-PQQQQQQQQQ>QQQQ>QQQ,QQQ-PQQQQQQQQQQ,,6fX6,X666666666>6666>666,666X6666666666,,_-^_,-^_________>____>___,___-^__________,,R-QR,-QRRRRRRRRR>RRRR>RRR,RRR-QRRRRRRRRRR00:&:0:::::::::::~::::~:::0::::::::::::::0044044444444444~4444~44404444444444444400>*>0>>>>>>>>>>>~>>>>~>>>0>>>>>>>>>>>>>>00P2F1OP01OPPPPPPPPPPP~PPPP~PPP0PPP1OPPPPPPPPPPPr   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   ,  s       r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r(  r5   r1   r6   r7   r8   r   r   r?   N)r(  r-  r'  r*  r+  r,  )	r(  r-  r'  	--sandboxdanger-full-access--skip-git-repo-checkr*  r+  r,  rA   z`%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.normalize_codex_exec_flags
}(%(py4)s)
} == %(py9)s
r1   normalize_codex_exec_flagsrE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   r   rP   r   rV   s          r   /test_codex_preserves_global_options_before_execr9  ,  s   44 J4J 



    

    >   >   4   J      

       r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   <        4 r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   Nr)  r'  r2  r3  r4  r*  r+  r,  rA   r5  r6  r8  s          r   1test_codex_injects_sandbox_and_git_check_for_execr>  <  s   44 
+
4+ 




 
 
 
 

 
 
 
 
> 
 
 
> 
 
 
4 
 
 
+
 
 
  
 
 


 
 
 
 
 
 
 
r   restrictiver2  z	read-onlyz-szworkspace-writez--sandbox=read-onlyz-s=workspace-writez-sread-onlyc                    V ^8  d   QhRRRR/# )r   r?  r}   r
   r   r   )r   s   "r   r   r   T  s      X XX	Xr   c                h   \         P                  pR .V ORNq!! V4      p. ROqCV8H  qU'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;p;rTR
# )r'  r,  r5   r1   r6   r7   r8   r   r   r?   N)r'  r2  r3  r4  r,  rA   r5  r6  )r?  rM   rN   rO   r   rP   r   rV   s   &       r   :test_codex_forces_danger_full_access_over_restrictive_flagrB  J  sQ    44 X	(+(x(X4( X	WX	WX X XFWFWX 	WX XQWQWX X?W?WX> X XNWiX> X XNWiX4 X XNWiX(X XNWiX  X XNWiX	WX X X X XDWDWX X Xr   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   \  s      4 r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  *--dangerously-bypass-approvals-and-sandboxr,  )r'  r4  rE  r,  rA   r5  r6  r8  s          r   9test_codex_preserves_bypass_flag_and_does_not_add_sandboxrF  \  s   44 H4H 

    
    >   >   4   H      
       r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   g  r;  r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r4  r*  r+  r,  r=  rA   r5  r6  r8  s          r   1test_codex_does_not_duplicate_skip_git_repo_checkrI  g  s   44 
D
4D 




 
 
 
 

 
 
 
 
> 
 
 
> 
 
 
4 
 
 
D
 
 
  
 
 


 
 
 
 
 
 
 
r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   u  s     K KT Kr   c                 \   \         P                  p R .q! V4      pR .q2V8H  qD'       g   \        P                  ! R
V3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r   r5   r1   r6   r7   r8   r   r   r?   NrA   r5  r6  r8  s          r   3test_codex_default_does_not_change_claude_argumentsrL  u  s    44JfXJ4X>J6(J(JJJJJ>JJJJJJ>JJJJ>JJJ4JJJXJJJ>JJJ(JJJJJJJJJr   gpt-5.6-solc               $    V ^8  d   QhRRRRRR/# )r   r   r#   
full_modelr
   r   r   )r   s   "r   r   r     s)     F FFF	Fr   c                   R RV R.R RVR.3R RV R.R RVR.3R RV  2R.R RV 2R.3R RV  2R.R RV 2R.3.pV EF  w  r4\         P                  qU! V4      qfV8H  qw'       Egk   \        P                  ! RV3RWd34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR	\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rgEK  	  R# )r'  r*  r,  --model-m=r5   r1   r6   r   argvr   r   expectedr   r   NrA   z[%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.resolve_model_aliases
}(%(py3)s)
} == %(py7)s
r1   resolve_model_aliasesrE   rF   rG   rH   rI   rJ   rK   rL   )
r   rO  casesrS  rT  rM   r   r   r   r   s
   &&        r   4test_codex_resolves_aliases_in_every_model_flag_formrY  y  sY    $x	(64X*NOYx0Y
H5	
 Cw-	*Vs:,5G,RS
Bug,	)Fb4Ex+PQE  33E3D9EXEEEEE9EEEEEE~EEEE~EEE3EEEEEEDEEEEDEEE9EEEEEEXEEEEXEEEEEEEE  r   modelc                    V ^8  d   QhRRRR/# )r   rZ  r#   r
   r   r   )r   s   "r   r   r     s     	B 	B# 	B$ 	Br   c                t   R RV R.R RV R.R RV  2R.R RV  2R..pV EF  p\         P                  q3! V4      qDV8H  qU'       Egk   \        P                  ! RV3RWB34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR	\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      RR	\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	/,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rEEK  	  R# )r'  r*  r,  rQ  rR  r5   r1   r6   r   rS  r   r   r   r   NrA   rU  rV  )rZ  rX  rS  rM   r   r   r   r   s   &       r   6test_codex_model_alias_resolution_preserves_full_namesr]    s   
 
uh'	E8,	3ug)	2eWx(	E 33A3D9ATAAAAA9AAAAAA~AAAA~AAA3AAAAAADAAAADAAA9AAAAAATAAAATAAAAAAAA r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s     ) )T )r   c                    \         P                  ! \        4      ;_uu_ 4       p \        P                  ! . RO4       RRR4       RpX P
                  p\        V4      q1V9   qD'       Eg3   \        P                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          pR
RV/,          p\        \        P                  ! V4      4      hR;p;p;r#R EF  pV P
                  p\        V4      qV	9   q'       Egk   \        P                  ! RV
3RWy34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p
;rEK  	  R#   + '       g   i     EL; i)r'  bananaNr   r   r#   r7   errorr8   r9   assert %(py10)sr:   r5   r   r6   r   r   r   r   )r'  r*  r`  r,  r   )zK%(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
})solterraluna)zK%(py0)s in %(py7)s
{%(py7)s = %(py2)s(%(py5)s
{%(py5)s = %(py3)s.value
})
})pytestraises
ValueErrorr1   rW  valuer#   rE   rF   rJ   rG   rH   rI   rK   rL   )ra  r   rO   rP   r   @py_format9r   r   r   r   rM   r   r   s                r   +test_codex_rejects_unknown_bare_model_aliasrk    s   	z	"	"e,,-OP 
# '5;;'s;''''''''8'''8''''''s''''s'''''''5''''5''';'''''''''''')!KK(K((((((((u((((((u((((u((((((((((((((((((E((((E(((K(((((((((((( *	 
#	"	"s   MM	c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s     T Tt Tr   c            	        \         P                  ! R R.4      p RqV 9  q"'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rR	qV 9  q"'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rR
 V  4       p\        V4      qf'       * qw'       g   RRR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rgR# )r'  r,  r*  r   r   
normalizedr   r   NrQ  c              3  ,   "   T F
  pR V9   x  K  	  R# 5i)model_reasoning_effortNr   ).0arguments   & r   	<genexpr>Ptest_codex_exec_without_model_does_not_inject_model_or_effort.<locals>.<genexpr>  s     S
H+x7
s   z0assert not %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}r5   anyr6   r7   r   )z%(py1)s not in %(py3)s)r1   r7  rE   rF   rJ   rG   rH   rI   rK   rL   ru  )rn  r   r   r   r   rM   rN   rO   s           r   =test_codex_exec_without_model_does_not_inject_model_or_effortrv    sA   ::FH;MNJ!z!!!!!4!!!4!!!!!!z!!!!z!!!!!!!!&J&&&&&9&&&9&&&&&&J&&&&J&&&&&&&&S
SSsSSSSSSSSSSSSsSSSSsSSSSSSSSSSSSSSSr   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      T r   c                 `   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  rc  r,  )	r'  r2  r3  r4  -cmodel_reasoning_effort=lowr*  rM  r,  rA   r5  r6  r8  s          r   ;test_codex_sol_alias_receives_resolved_model_default_effortr{    s   44 
5T 
45TU 
 
Z 
 
Z 
 
 
 
U 
 
 
 
 
> 
 
 
> 
 
 
4 
 
 
5T 
 
 
U 
 
 
 
Z 
 
 
 
 
 
 
 
r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      d r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  re  ry  model_reasoning_effort=xhighr,  )	r'  r2  r3  r4  r*  gpt-5.6-lunary  r~  r,  rA   r5  r6  r8  s          r   Dtest_codex_luna_alias_accepts_extended_effort_after_early_resolutionr    s   44 N4N 



    

    >   >   4   N      

       r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s       r   c                    . ROp \         P                  q! V 4      p. ROq2V8H  qD'       Eg3   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\        P
                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;rC\         P                  ! V 4      RR
 p. ROqV8H  q'       gy   \        P                  ! RV	3RWx34      R\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR
;p;rR
# )r'  r5   r1   r6   r   rS  r   r9   rb  r:   Nr   r7   r   r8   )r'  r*  rc  --rQ  r`  rc  )r'  r*  rM  r  rQ  r`  rc  rA   )z[%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.resolve_model_aliases
}(%(py3)s)
} == %(py8)s)r  rQ  r`  rc  z%(py1)s == %(py4)s)r1   rW  rE   rF   rG   rH   rI   rJ   rK   rL   r7  )rS  rM   r   rP   r   rj  r   r   rN   r   r   r   s               r   .test_codex_alias_resolution_stops_at_separatorr    s   BD// /5  :  :    5     >   >   /           5    :         44T:23?  D  D   
 ?  
 ?  
  D     
   r   c               $    V ^8  d   QhRRRRRR/# )r   rZ  r#   default_effortr
   r   r   )r   s   "r   r   r     s&       
r   c                z   \         P                  pR RV R.q2! V4      pR RRRRRV 2RV R.	qTV8H  qf'       g   \        P                  ! RV3RVV34      RR	\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR	R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;reR# )r'  rQ  r,  r2  r3  r4  ry  model_reasoning_effort=r5   r1   r6   r7   r8   r   r   r?   NrA   r5  r6  )	rZ  r  rM   rN   rO   r   rP   r   rV   s	   &&       r   -test_codex_injects_known_model_default_effortr    sI    44 	E8,4,  	
!.!12



    

    >   >   4   ,      

       r   effortc               (    V ^8  d   QhRRRRRRRR/# )r   rZ  r#   r  	canonicalr
   r   r   )r   s   "r   r   r     s0        
	r   c                   \         P                  pR RV RRV 2R.qC! V4      pR RRRRV RRV 2R.	qeV8H  qw'       g   \        P                  ! RV3RVV34      RR	\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR	R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;p;rvR# )r'  r*  ry  r  r,  r2  r3  r4  r5   r1   r6   r7   r8   r   r   r?   NrA   r5  r6  )
rZ  r  r  rM   rN   rO   r   rP   r   rV   s
   &&&       r   /test_codex_canonicalizes_standard_effort_valuesr    sT    44 	ud&=fX$FQ4Q  	
!)-



    

    >   >   4   Q      

       r   xhighmaxc                    V ^8  d   QhRRRR/# r   r  r#   r
   r   r   )r   s   "r   r   r     s      C D r   c                   \         P                  pR RRRRV  2R.q!! V4      pR RRRRRRRV  2R.	qCV8H  qU'       g   \        P                  ! RV3RVV34      R	R
\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR
R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;rTR# )r'  r*  r  ry  r  r,  r2  r3  r4  r5   r1   r6   r7   r8   r   r   r?   NrA   r5  r6  )r  rM   rN   rO   r   rP   r   rV   s   &       r   'test_codex_luna_accepts_extended_effortr    sS   44 	~t/Fvh-OQYZ4Z  	
!&*



    

    >   >   4   Z      

       r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r   *  s     
 
S 
T 
r   c                    \         P                  ! \        R V  R2R7      ;_uu_ 4        \        P                  ! RRRV  2R.4       RRR4       R#   + '       g   i     R# ; i)^unsupported reasoning effort 'z' for model '<unspecified>'$matchr'  ry  r  r,  Nrf  rg  rh  r1   r7  )r  s   &r   0test_codex_rejects_extended_effort_without_modelr  )  s\    	08TU
 
 	11T4VH=xH	
	
 
 
 
s   AA"	c               $    V ^8  d   QhRRRRRR/# )r   rZ  r#   r  r
   r   r   )r   s   "r   r   r   6  s&     

 





 


r   c           
         \         P                  ! \        R V RV  R2R7      ;_uu_ 4        \        P                  ! RRV RRV 2R.4       R	R	R	4       R	#   + '       g   i     R	# ; i)
r  z' for model ''$r  r'  r*  ry  r  r,  Nr  )rZ  r  s   &&r   6test_codex_rejects_extended_effort_for_non_luna_modelsr  4  sg     
0eWBO
 
 	11T5$*A&(JHU	
	
 
 
 
s    AA'	c                    V ^8  d   QhRRRR/# )r   rZ  z
str | Noner
   r   r   )r   s   "r   r   r   D  s     8 8Z 8TX 8r   c                   R .pV e   VRV .,          pV. RO,          pT ;'       g    Rp\         P                  ! \        RV R2R7      ;_uu_ 4        \        P                  ! V4       RRR4       R#   + '       g   i     R# ; i)r'  Nr*  z<unspecified>z/^invalid reasoning effort 'minimal' for model 'r  r  )ry  model_reasoning_effort=minimalr,  r  )rZ  rS  
model_names   &  r   9test_codex_rejects_invalid_effort_for_any_effective_modelr  C  sz    8Du>>D))/J	@BO
 
 	11$7	
 
 
 
s   A33B	
model_flagr*  rQ  z-m=gpt-5.6-sol--model=gpt-5.6-solc                    V ^8  d   QhRRRR/# )r   r  r}   r
   r   r   )r   s   "r   r   r   [  s     
 
Y 
4 
r   c                n   \         P                  pR .V ORNq!! V4      p. ROV ORNqCV8H  qU'       g   \        P                  ! RV3RW434      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;p;rTR
# )r'  r,  r5   r1   r6   r7   r8   r   r   r?   N)r'  r2  r3  r4  ry  rz  rA   r5  r6  )r  rM   rN   rO   r   rP   r   rV   s   &       r   ,test_codex_supports_all_model_flag_spellingsr  R  s5    44 	f5Tz5T85T 	45TU 	 	Z 
	Z 		Z 	 	Z 	 	 	 	U 	 	 	 	 	> 	 	 	> 	 	 	4 	 	 	5T 	 	 	U 	 	 	 	Z 	 	 	 	 	 	 	 	r   config_flagry  model_reasoning_effort=medmodel_reasoning_effort=medium--configz-c=model_reasoning_effort=med -c=model_reasoning_effort=mediumz#--config=model_reasoning_effort=medz&--config=model_reasoning_effort=mediumc               $    V ^8  d   QhRRRRRR/# )r   r  r}   normalized_config_flagr
   r   r   )r   s   "r   r   r   w  s&      % 
r   c                r   \         P                  p. ROV ORNq2! V4      p. ROVORNqTV8H  qf'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;p;reR
# )r'  r,  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  gpt-5.6-terra)r'  r2  r3  r4  r*  r  rA   r5  r6  )	r  r  rM   rN   rO   r   rP   r   rV   s	   &&       r   4test_codex_supports_all_effort_config_flag_spellingsr  h  s9   & 44 ??h?4? 	
 
 	
 		
	
    	
    >   >   4   ?      	
       r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s       r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  ry  first=1--config=second=tworQ  r  ry  r  r  third=3r,  )r'  r2  r3  r4  ry  r  r  rQ  r  ry  r  r  r  r,  rA   r5  r6  r8  s          r   6test_codex_preserves_unrelated_config_entries_in_orderr    s   44 	
4	
 

  : ; 
 : ; : ;>  : ;>  : ;4  : ;	
 : ;   : ;
    : ;  r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      $ r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  rM  -m=gpt-5.6-lunary  r  #--config=model_reasoning_effort=maxr,  )	r'  r2  r3  r4  r*  rM  r  r  r,  rA   r5  r6  r8  s          r   @test_codex_repeated_model_and_effort_flags_use_final_occurrencesr    s   44 		
4		
 



  * + 

 * + * +>  * +>  * +4  * +		
 * +   * +

    * +  r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      d r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  gpt-5.5r  r,  )
r'  r2  r3  r4  ry  rz  r*  r  r  r,  rA   r5  r6  r8  s          r   <test_codex_repeated_model_flags_use_final_model_for_defaultsr    s   44 B4B 

    
    >   >   4   B      
       r   flagc                    V ^8  d   QhRRRR/# r   r  r#   r
   r   r   )r   s   "r   r   r     s     B B B Br   c                    \         P                  ! \        R \        P                  ! V 4       R2R7      ;_uu_ 4        \
        P                  ! RV .4       RRR4       R#   + '       g   i     R# ; i)^ requires a value$r  r'  N)rf  rg  rh  reescaper1   r7  r  s   &r   .test_codex_rejects_missing_separate_flag_valuer    sH    	zAbiio->>P)Q	R	R1164.A 
S	R	R	Rs   A  A1	c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r     s     B Bs Bt Br   c           	        \         P                  ! \        R \        P                  ! V P                  R4      ^ ,          4       R2R7      ;_uu_ 4        \        P                  ! RV .4       RRR4       R#   + '       g   i     R# ; i)r  =r  r  r'  N)rf  rg  rh  r  r  splitr1   r7  r  s   &r   ,test_codex_rejects_missing_inline_flag_valuer    sV    	zAbii

38J.K-LL^)_	`	`1164.A 
a	`	`	`s   A66B	c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      4 r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  -mgpt-5.6-lunaz-cmodel_reasoning_effort=medr,  )r'  r2  r3  r4  r  r  r,  rA   r5  r6  r8  s          r   9test_codex_supports_attached_short_model_and_config_flagsr    s   44 
L
4L 




 
 
 
 

 
 
 
 
> 
 
 
> 
 
 
4 
 
 
L
 
 
  
 
 


 
 
 
 
 
 
 
r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s       r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  -mgpt-5.6-solr,  )r'  r2  r3  r4  ry  rz  r  r,  rA   r5  r6  r8  s          r   7test_codex_attached_short_model_receives_default_effortr    s   44 +4+ 	
	
    	
    >   >   4   +      	
       r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s     
 
 
r   c                     \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! . RO4       RRR4       R#   + '       g   i     R# ; i)<^unsupported reasoning effort 'max' for model 'gpt-5.6-sol'$r  N)r'  r  z-cmodel_reasoning_effort=maxr,  r  r   r   r   ?test_codex_attached_short_flags_reject_non_luna_extended_effortr    sA    	L
 
 	11O	
	
 
 
 
   AA	c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r     s      d r   c                 b   \         P                  p . R
Oq! V4      p. ROq2V8H  qD'       g   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r'  r5   r1   r6   r7   r8   r   r   r?   N)r'  r*  rM  r  --model=gpt-5.6-lunary  r2  rE  )r'  r2  r3  r4  ry  rz  r*  rM  r  r  ry  r2  rE  rA   r5  r6  r8  s          r   ,test_codex_stops_option_parsing_at_separatorr    s   44 		
4		
 

  2 3 
 2 3 2 3>  2 3>  2 34  2 3		
 2 3   2 3
    2 3  r   c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   $  s     
 
4 
r   c                     \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! . RO4       RRR4       R#   + '       g   i     R# ; i)r  r  N)r'  r*  rM  ry  model_reasoning_effort=maxr  r  r  r   r   r   Atest_codex_model_after_separator_cannot_authorize_extended_effortr  $  sC    	L
 
 	11
	
	
 
 
 
r  rp  z-c=model_reasoning_effortz--config=model_reasoning_effortz-cmodel_reasoning_effortc                    V ^8  d   QhRRRR/# )r   r  r}   r
   r   r   )r   s   "r   r   r   @  s     
 
	 
d 
r   c                    \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! . ROV ORN4       RRR4       R#   + '       g   i     R# ; i)z)^model_reasoning_effort requires a value$r  r,  N)r'  r*  rM  r  )r  s   &r   .test_codex_rejects_effort_config_without_valuer  6  sA     
z)T	U	U11A;AA	
 
V	U	U	Us   AA	c                   V ^8  d   QhRR/# r3   r   )r   s   "r   r   r   G  s     C Ct Cr   c                 2   . ROp \         P                  q! V 4      q"V 8H  q3'       Egk   \        P                  ! RV3RW 34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\        P
                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      RR\        P
                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;r#R
# )r   r5   r1   r6   r   rS  r   r   r   r   N)r   r*  rM  ry  r  r,  rA   )z`%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.normalize_codex_exec_flags
}(%(py3)s)
} == %(py7)sr6  )rS  rM   r   r   r   r   s         r   =test_codex_non_exec_arguments_remain_byte_for_byte_equivalentr  G  s    VD44B4T:BdBBBBB:BBBBBB>BBBB>BBB4BBBBBBTBBBBTBBB:BBBBBBdBBBBdBBBBBBBBr   c               $    V ^8  d   QhRRRRRR/# r   r(   r)   r[   r\   r
   r   r   )r   s   "r   r   r   L  s+     )_ )_#)_&)_ 
)_r   c           	        \         P                  ! \         P                  ! 4       4      pV P                  VR R 4       V P                  \         P                  RR 4       V P                  \         P                  RR 4       V P                  \         P
                  RR 4       VP                  . RO4      pVP                  4       p^qSV8H  qf'       g   \        P                  ! RV3RW534      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reVP                   pRqV	8H  q'       g   \        P                  ! RV
3RWi34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP"                  pRqV	8H  q'       g   \        P                  ! RV
3RWi34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rR# )r   c                 .    \         P                  ! R 4      # zaccount resolution must not runrf  failr|   kwargss   *,r   r.   Vtest_codex_router_rejects_invalid_effort_before_routing_sync_or_exec.<locals>.<lambda>U      ,M Nr   r   c                 .    \         P                  ! R 4      # )zsynchronization must not runr  r  s   *,r   r.   r  Z  s    ,J Kr   runc                 .    \         P                  ! R 4      # )zsubprocess must not runr  r  s   *,r   r.   r  _  s    ,E Fr   r   c                 .    \         P                  ! R 4      # )zexec must not runr  r  s   *,r   r.   r  d  s    ,? @r   r5   r   r   r#  r   r   Nr   r6   r   r   z@cdx: invalid reasoning effort 'minimal' for model 'gpt-5.6-sol'
)r   r'  r  r  r  r,  rA   r   z+%(py2)s
{%(py2)s = %(py0)s.out
} == %(py5)sz+%(py2)s
{%(py2)s = %(py0)s.err
} == %(py5)s)r1   r   r   r0   
subprocessr   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r  r   )r(   r[   r   r   r   r   rM   r   r   r   rN   r   s   &&          r   Dtest_codex_router_rejects_invalid_effort_before_routing_sync_or_execr  L  s    )).*E*E*GHFN
 ##K
 !!F
 @ 	
	I   "H>999<<22<88<2<<^^^^^^^^^<^^^^^^8^^^^8^^^<^^^^^^^^^^^^r   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r   x  s&     + +#+&+ 
+r   c           	        \         P                  ! \         P                  ! 4       4      pV P                  VR R 4       VP	                  . RO4      pVP                  4       p^ qSV8g  qf'       g   \        P                  ! RV3RW534      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reVP                  pRqV	8H  q'       g   \        P                  ! RV
3RWi34      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP                  pRqV	8H  q'       g   \        P                  ! RV
3RVV	34      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rRqP                  qV	9  qU'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rYR# )r   c                 .    \         P                  ! R 4      # r  r  r  s   *,r   r.   Ltest_codex_router_surfaces_unknown_alias_without_traceback.<locals>.<lambda>  r  r   r5   r   r   r#  r   r   Nr   r6   r   r   zDcdx: unknown model alias 'banana' (valid aliases: sol, terra, luna)
	Tracebackr   )r   r'  r*  r`  r,  )!=)z%(py0)s != %(py3)srA   r  r  r   r   )r1   r   r   r0   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r  r   )r(   r[   r   r   r   r   rM   r   r   r   rN   r   r   s   &&           r   :test_codex_router_surfaces_unknown_alias_without_tracebackr  x  sR    )).*E*E*GHFN EFI  "H>999<<22<88<2<< OO   <O    8   8   <   O       *ll*l*****;***;******h****h***l********r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r+   r   r'   r(   r)   r[   r\   r
   r   r   )r   s   "r   r   r     sA     P+ P+
P+P+ $P+ '	P+
 
P+r   c                ~8  a.a/a0 V R ,          R,          R,          R,          pVP                  RR7       V R ,          R,          P                  \        P                  ! RRRRR	/./4      R
R7       \        P
                  ! \        P                  ! RR/4      P                  4       4      P                  4       P                  R4      pVR,          P                  \        P                  ! RRRV R2//4      R
R7       \        P                  ! \        P                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       VP                  R\        VR,          4      4       VP                  \        P                   RR 4       / o0/ o/Tp. RkOp\        P                  ! 4       P#                  R\        V4      /4      o.Rp	S.V	Jq'       g   \$        P&                  ! RlV
3RmS.V	34      RR\(        P*                  ! 4       9   g   \$        P,                  ! S.4      '       d   \$        P.                  ! S.4      MRR\$        P.                  ! V	4      /,          pRR V/,          p\1        \$        P2                  ! V4      4      hR;rR! V.V/3R" llpR# V03R$ llpVP                  \        P                   R%V4       VP                  \        R&V4       VP                  \        P4                  R'R( 4       VP7                  . RnO4      pVP9                  4       p^qV	8H  q'       g   \$        P&                  ! RoV
3RpW34      RR*\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR*R\$        P.                  ! V	4      /,          pRR V/,          p\1        \$        P2                  ! V4      4      hR;rVP:                  P=                  4       pVP:                  p
V R+2pV
V8H  pV'       g   \$        P&                  ! RoV3RqV
V34      RR,\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR,R-\$        P.                  ! V
4      R \$        P.                  ! V4      /,          pR.R/V/,          p\1        \$        P2                  ! V4      4      hR;p
;ppR0pVP:                  pVV9  q'       g   \$        P&                  ! RrV	3RsVV34      R1\$        P.                  ! V4      RR,\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR,R \$        P.                  ! V4      /,          pR.R/V/,          p\1        \$        P2                  ! V4      4      hR;p;p	p\?        V4      pVP@                  p
R2pV V,          pR3pVV,          pR)pVV,          pV
V8H  pV'       EgB   \$        P&                  ! RoV3RtV
V34      RR4\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR4R-\$        P.                  ! V
4      R5R6\(        P*                  ! 4       9   g   \$        P,                  ! V 4      '       d   \$        P.                  ! V 4      MR6R7\$        P.                  ! V4      R8\$        P.                  ! V4      R9\$        P.                  ! V4      /,          pR:R;V/,          p\1        \$        P2                  ! V4      4      hR;p
;p;p;p;p;p;ppVPB                  q! 4       pR<pVV8H  pV'       g   \$        P&                  ! RoV3RuVV34      RR4\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR4R-\$        P.                  ! V
4      R5\$        P.                  ! V4      R/\$        P.                  ! V4      /,          pR=R8V/,          p \1        \$        P2                  ! V 4      4      hR;p
;p;pp\D        PF                  p
R>\D        PH                  ! \        V4      4       R?2pVPJ                  pV
! VV4      pV'       Eg%   R@RRA\(        P*                  ! 4       9   g!   \$        P,                  ! \D        4      '       d   \$        P.                  ! \D        4      MRAR-\$        P.                  ! V
4      R5\$        P.                  ! V4      R R,\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR,R/\$        P.                  ! V4      R8\$        P.                  ! V4      /,          p \1        \$        P2                  ! V 4      4      hR;p
;p;ppS0RB,          p\         PL                  pRCpRDp!REp"V! VS.V!VV"RF7      p#VV#8H  q'       Eg   \$        P&                  ! RoV	3RvVV#34      R1\$        P.                  ! V4      RRG\(        P*                  ! 4       9   g!   \$        P,                  ! \         4      '       d   \$        P.                  ! \         4      MRGR \$        P.                  ! V4      R/\$        P.                  ! V4      RHR\(        P*                  ! 4       9   g   \$        P,                  ! S.4      '       d   \$        P.                  ! S.4      MRRI\$        P.                  ! V!4      RJRK\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MRKRL\$        P.                  ! V"4      R;\$        P.                  ! V#4      /	,          pRMRNV/,          p$\1        \$        P2                  ! V$4      4      hR;p;p	;p;p;p!;p"p#S0RO,          pR)pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pS/RQ,          pRDpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pS/RK,          pVV8H  q'       g   \$        P&                  ! RoV	3RxVV34      R1\$        P.                  ! V4      RRK\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MRK/,          pRR V/,          p\1        \$        P2                  ! V4      4      hR;pp	S/R,          pVS.8H  q'       g   \$        P&                  ! RoV	3RxVS.34      R1\$        P.                  ! V4      RR\(        P*                  ! 4       9   g   \$        P,                  ! S.4      '       d   \$        P.                  ! S.4      MR/,          pRR V/,          p\1        \$        P2                  ! V4      4      hR;pp	VR,          PO                  R
R7      PQ                  4        U'u. uF1  p'V'P=                  4       '       g   K  \        PR                  ! V'4      NK3  	  p(p'\U        V(4      p	^pV	V8H  pV'       Eg   \$        P&                  ! RoV3RyV	V34      RRR\(        P*                  ! 4       9   g!   \$        P,                  ! \T        4      '       d   \$        P.                  ! \T        4      MRRR1RS\(        P*                  ! 4       9   g   \$        P,                  ! V(4      '       d   \$        P.                  ! V(4      MRSR\$        P.                  ! V	4      R7\$        P.                  ! V4      /,          p&RTRHV&/,          p)\1        \$        P2                  ! V)4      4      hR;p	;ppV(^ ,          p*V*RU,          p^pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*RV,          pR)pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*RW,          pRDpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*RX,          pRYpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*RZ,          pR[pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*R\,          pRCpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*R],          pR^pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*R_,          pREpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*R`,          pRpVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*Ra,          p\        V4      pVV8H  q'       Eg   \$        P&                  ! RoV	3RzVV34      R1\$        P.                  ! V4      RRb\(        P*                  ! 4       9   g!   \$        P,                  ! \        4      '       d   \$        P.                  ! \        4      MRbR5R4\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR4R7\$        P.                  ! V4      /,          p&RTRHV&/,          p)\1        \$        P2                  ! V)4      4      hR;p;p	pV*Rc,          p^pVV8H  q'       gz   \$        P&                  ! RoV	3RwVV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*Rd,          pRpVVJ q'       gz   \$        P&                  ! R{V	3R|VV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	pV*Re,          p^ pVV8  q'       gz   \$        P&                  ! R}V	3R~VV34      R1\$        P.                  ! V4      R5\$        P.                  ! V4      /,          p%RPR7V%/,          p&\1        \$        P2                  ! V&4      4      hR;p;p	p\        P                  ! V*4      p+VV+9  q'       g   \$        P&                  ! RrV
3RVV+34      RRf\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MRfR-Rg\(        P*                  ! 4       9   g   \$        P,                  ! V+4      '       d   \$        P.                  ! V+4      MRg/,          p,RhR5V,/,          p%\1        \$        P2                  ! V%4      4      hRp
RqV	,          p\        V4      pVV+9  pV'       Egl   \$        P&                  ! RrV3RVV+34      RRb\(        P*                  ! 4       9   g!   \$        P,                  ! \        4      '       d   \$        P.                  ! \        4      MRbR1Ri\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MRiR\$        P.                  ! V	4      R7\$        P.                  ! V4      RHRg\(        P*                  ! 4       9   g   \$        P,                  ! V+4      '       d   \$        P.                  ! V+4      MRg/,          p)RjRIV)/,          p-\1        \$        P2                  ! V-4      4      hR;p	;p;ppVP:                  p
V R+2pV
V8H  pV'       g   \$        P&                  ! RoV3RqV
V34      RR,\(        P*                  ! 4       9   g   \$        P,                  ! V4      '       d   \$        P.                  ! V4      MR,R-\$        P.                  ! V
4      R \$        P.                  ! V4      /,          pR.R/V/,          p\1        \$        P2                  ! V4      4      hR;p
;ppR# u up'i )r   ri   r   rj   Trk   r   r   r   r   r   r   emailzlegacy@example.comr  r  tokensid_tokenzheader.z
.signaturerx   r   c                    R # r-   r   r   s   &&r   r.   Qtest_codex_exec_captures_output_to_logfile_and_prints_only_path.<locals>.<lambda>  r   r   OD_CONTAINMENT_LOGcontainment.jsonlshould_offloadc                     R # Tr   r   r   r   r.   r        RVr   Nr5   r  r   r   r   c               (    V ^8  d   QhRRRRRRRR/# 	r   	exec_namer#   session_forwardedr}   r  objectr
   remote_dispatch.Sessionr   )r   s   "r   r   Utest_codex_exec_captures_output_to_logfile_and_prints_only_path.<locals>.__annotate__  0      $  
!	r   c                   < V SR &   VSR&   VR,          SR&   \         P                  ! RRRRR/\        R4      RR	R
S\         P                  ! RSRVR	R7      R7      pR Vn        V# )r  	forwardedr  debian1host	100.0.0.1user/workspace/projectsandbox/workspaces/project-abcproject-abc)/node/home/sandbox/workspaces/project-abcr   	host_namer  r  forwarded_argv
sandbox_idr)  accessrootrel_dirr+  	workspacer  rS  c                     R # r-   r   r  s   ,r   r.   ltest_codex_exec_captures_output_to_logfile_and_prints_only_path.<locals>.fake_open_session.<locals>.<lambda>      Tr   )r;   Sessionr   launcher_argv	pull_back)r  r  r  sessionr  	open_calls   &&, r   fake_open_sessionZtest_codex_exec_captures_output_to_logfile_and_prints_only_path.<locals>.fake_open_session  s    
 "+	+!2	+"("6	,!))K8*+4$A! ..#%!0(
  2r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r   rS  r}   r~   r   log_pathr   r  r  r
   intr   )r   s   "r   r   r    s4      ,8<HN	r   c                L   < V SR &   VR,          SR&   VP                  R4       ^# )cmdkey   codex model output
write_bytes)rS  r~   r>  r  run_calls   &&&,r   fake_superviseWtest_codex_exec_captures_output_to_logfile_and_prints_only_path.<locals>.fake_supervise  s-      -45r   open_session	superviser   c                 .    \         P                  ! R 4      # )z1execvpe should not run for containerized cdx execr  r  s   *,r   r.   r    s    ,_ `r   r   r   
r   r6   r   r   zcodex model outputr   r   logsr>  r7   r+   r8   r   r<   zassert %(py15)spy15rC  r   u   cdx: running on debian1 \(sandbox/workspaces/project-abc\)\ncdx: codex exec finished — exit=7 in \d+\.\ds\. The run is COMPLETE; do not wait or poll for it\.\ncdx: log z \(19 B\)\nzmassert %(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.fullmatch
}(%(py4)s, %(py7)s
{%(py7)s = %(py5)s.err
})
}r  rA  r   r   r&  r(  r;   r9   r:   r?   r  r@   assert %(py17)spy17rB  r   r  lenlog_recordsassert %(py8)sschematoolr  mode	containercontainmentpodman-rootlessr!  r0  r'  	sandboxIdaccountlogPathr#   exitCodereasondurationSectoken_payload
serializedassert %(py4)sr  rb  )	r'  r2  r3  r4  ry  rz  r*  rM  do the thingr   r   )r   r   r   r'  r*  rM  rc  rA   r   r  r   z/%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.out
})zS%(py2)s
{%(py2)s = %(py0)s.parent
} == (((%(py4)s / %(py6)s) / %(py9)s) / %(py12)s))zI%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_bytes
}()
} == %(py7)s)z%(py1)s == %(py15)s
{%(py15)s = %(py5)s
{%(py5)s = %(py3)s.launcher_argv
}(host_name=%(py7)s, credential=%(py8)s, exec_name=%(py10)s, forwarded_argv=%(py11)s, sandbox_id=%(py13)s)
}r  z%(py1)s == %(py3)sz0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)s)z0%(py1)s == %(py6)s
{%(py6)s = %(py3)s(%(py4)s)
}r   z%(py1)s is %(py4)s)>=)z%(py1)s >= %(py4)s)z%(py0)s not in %(py2)s)z@%(py6)s
{%(py6)s = %(py0)s((%(py1)s / %(py3)s))
} not in %(py8)s)+r   r   r   r   base64urlsafe_b64encodeencodedecoderstripr1   r   r   rq   r0   setenvr#   r;   r  rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r   r  r   r   parent
read_bytesr  	fullmatchr  r   r6  	read_text
splitlinesr  rQ  )1r+   r'   r(   r[   r   r`  r   r  r  r   rM   r   r   r:  rG  r   r   log_liner   rN   r   r   r>  rO   rP   r   rU   rQ   r  rW   @py_format16r   r   rR   r  @py_assert14@py_format18r   r   linerR  rj  recordra  @py_format3r   r  r9  rF  s1   &&&&                                          @@@r   ?test_codex_exec_captures_output_to_logfile_and_prints_only_pathr{    s    &3lB\QKd#	MO+77

J&,!J KLM 8  ,,

G123::<fhvvc{  ;**

HzW]O:+NOPQ +  ))##%*>>F ###
 +S<O1O-PQ668H,W"$H#%IL
I  ,,.99<\IZ:[\J!!:T!!!!!:T!!!!!!:!!!!:!!!T!!!!!!!! 6  66HYZ^D` WI   "H>999||!!#H<<*hZr?*<?*****<?******8****8***<***?********3x||3|33333|333333333x3333x333|33333333H~H??]%L]d%LL]v]LvU]X]]UX]]]?]]]]]]?]]]]]]]8]]]]8]]]?]]]]]]d]]]]d]]]%L]]]v]]]X]]]]]]]]]]; ;$;; $;;;;;; $;;;;;;;8;;;;8;;;;;; ;;;$;;;;;;;;;<< YYs8}-.k	; 		<	; 		    
  
 2  
 2  
 <  
 	; 
  
  		 
  		 
  		 
     
    E? o;;  
 !;   ?     ?    ?     o   o   ;                 !	   !	  
 !             E?#e#?e#####?e###?###e########[!,W,!W,,,,,!W,,,!,,,W,,,,,,,,[!.!Y.....!Y...!......Y....Y........\"0"j00000"j000"000000j0000j00000000  33>>>P[[]]D::< 	

4]  
 { q q     q      3    3       {    {      q        ^F( q q     q      q        &>"U">U""""">U""">"""U"""""""")'''''''''''''''''''''&>([(>[(((((>[(((>((([((((((((- 5$55 $555555 $5555 555$555555555&>&Y&>Y&&&&&>Y&&&>&&&Y&&&&&&&&+M"MM"MMMMMM"MMMMMMM"MMMMMMMMM+/-/-/////-//////-////////),,,,,,,,,,,,,,,,,,,,,)-H--------------------------H----H-----------*"""""""""""""""""""""(#t#t#####t######t########- %A% A%%%%% A%%% %%%A%%%%%%%%F#J
*****=
******=****=*******
****
********)<k)<3)*<**<<<<<**<<<<<<3<<<<3<<<<<<<|<<<<|<<<k<<<*<<<<<<*<<<<*<<<<<<<<<<*hZr?*<?*****<?******8****8***<***?********/s   Ap:<Ap:case)idsc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r|  r#   r+   r   r'   r(   r)   r[   r\   r
   r   r   )r   s   "r   r   r   4  sT     QV QV
QV
QV QV $	QV
 'QV 
QVr   c                @  a)a* VR ,          R,          R,          R,          pVP                  RR7       VR,          P                  RRR	7       VR
,          R,          R,          R,          pVP                  RR7       VP                  R\        W  R2,          4      4       R R lpVP	                  \
        P                  RV4       V R8X  d#   VP	                  \
        P                  RR 4       V R8X  d$   VP	                  \
        P                  RR 4       M"VP	                  \
        P                  RR 4       R^ R^ /o)R V)3R llpR V)3R llp	V R 8X  d   \        P                  M^ o*R! V)V*3R" llp
V Rm9   pV R#8X  dJ   VP	                  \
        P                  R$R% 4       VP	                  \
        P                  RV4       R&p^ pEMV R8X  dJ   VP	                  \
        P                  R$R' 4       VP	                  \
        P                  RV	4       R(p^ pEMvV R 8X  dX   VP	                  \
        P                  R$R) 4       VP	                  \
        P                  RV4       R*p\        P                  pEMV R+8X  d`   VP	                  \
        P                  R$R, 4       R- V)3R. llpVP	                  \
        P                  RV4       R*p\        P                  pMV R/8X  dW   VP	                  \
        P                  R$R0 4       VP	                  \
        P                  RV	4       R*p\        P                  pMUVP	                  \
        P                  R$R1 4       VP	                  \
        P                  RV	4       R*p\        P                  pVP	                  \
        RV
4       VP	                  \
        P                  R2R3 4       VP	                  \
        P                  R2R4 4       \
        P                  ! \
        P                  ! 4       \
        P                  R57      p\
        P                  ! \
        P                  ! 4       \
        P                  R57      pV P!                  R64      '       d   VP#                  . RnO4      pM.V R/8X  d   VP#                  . RoO4      pMVP#                  . RpO4      pV Rq9   Ed1   S)R,          p^pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppS)R,          p^pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEMV R8X  Ed1   S)R,          p^ pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppS)R,          p^pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEMfV R+8X  Ed1   S)R,          p^pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppS)R,          p^ pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEM.S)R,          p^ pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppS)R,          p^ pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppVP/                  4       pVV8H  pV'       g   \$        P&                  ! RrV3RtVV34      R?R@\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MR@RARB\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRB/,          pRCR:V/,          p\+        \$        P,                  ! V4      4      hR>pV'       EdH   VP6                  pVP6                  P9                  4        RD2pVV8H  pV'       g   \$        P&                  ! RrV3RuVV34      R?RE\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRERA\$        P(                  ! V4      RF\$        P(                  ! V4      /,          pRGRHV/,          p\+        \$        P,                  ! V4      4      hR>;p;ppVP6                  pVP8                  pV! 4       pVP:                  pRIpV! V4      p V '       g   RJR?RE\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRERA\$        P(                  ! V4      R:\$        P(                  ! V4      R=\$        P(                  ! V4      RK\$        P(                  ! V4      RL\$        P(                  ! V4      RM\$        P(                  ! V 4      /,          p!\+        \$        P,                  ! V!4      4      hR>;p;p;p;p;pp MVP6                  pR;pVV8H  pV'       g   \$        P&                  ! RrV3RuVV34      R?RE\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRERA\$        P(                  ! V4      RF\$        P(                  ! V4      /,          pRGRHV/,          p\+        \$        P,                  ! V4      4      hR>;p;ppW  R2,          P=                  RR	7      P?                  4        U"u. uF1  p"V"P9                  4       '       g   K  \@        PB                  ! V"4      NK3  	  p#p"\E        V#4      p^pVV8H  pV'       Eg   \$        P&                  ! RrV3RvVV34      R?RN\0        P2                  ! 4       9   g!   \$        P4                  ! \D        4      '       d   \$        P(                  ! \D        4      MRNR9RO\0        P2                  ! 4       9   g   \$        P4                  ! V#4      '       d   \$        P(                  ! V#4      MRORP\$        P(                  ! V4      R=\$        P(                  ! V4      /,          pRQRKV/,          p$\+        \$        P,                  ! V$4      4      hR>;p;ppV#^ ,          p%V%RR,          pVV8H  pV'       g   \$        P&                  ! RrV3RwVV34      R9\$        P(                  ! V4      RPRS\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRS/,          p&RTRFV&/,          p\+        \$        P,                  ! V4      4      hR>;ppV P!                  R74      '       Ed1   V%RU,          pR7pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%RV,          pRWpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEM.V%RU,          pR8pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%RV,          pRXpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%RY,          pVV8H  pV'       g   \$        P&                  ! RrV3RwVV34      R9\$        P(                  ! V4      RPRB\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRB/,          p&RTRFV&/,          p\+        \$        P,                  ! V4      4      hR>;ppVR&8X  Ed   V%RZ,          pR[pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R\,          pR]pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R^,          pR_pVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R`,          pRapVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%Rb,          pRpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%Rc,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEM*VR(8X  Ed   V%RZ,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R\,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R^,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R`,          pRapVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%Rb,          pRpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%Rc,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppEMV%RZ,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R\,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R^,          pR>pVVJ pV'       gz   \$        P&                  ! RxV3RyVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%R`,          pRdpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppV%Rb,          pV P!                  R74      '       d   RMRpVV8H  pV'       gz   \$        P&                  ! RrV3RsVV34      R9\$        P(                  ! V4      R:\$        P(                  ! V4      /,          pR<R=V/,          p\+        \$        P,                  ! V4      4      hR>;p;ppR+ReR Rf\        P                   Rg2/p'V%Rc,          pV'PF                  pRhpV! V V4      pVV8H  pV'       EgB   \$        P&                  ! RrV3RzVV34      R9\$        P(                  ! V4      RPRi\0        P2                  ! 4       9   g   \$        P4                  ! V'4      '       d   \$        P(                  ! V'4      MRiRF\$        P(                  ! V4      R=Rj\0        P2                  ! 4       9   g   \$        P4                  ! V 4      '       d   \$        P(                  ! V 4      MRjRK\$        P(                  ! V4      RL\$        P(                  ! V4      /,          p(RkRMV(/,          p!\+        \$        P,                  ! V!4      4      hR>;p;p;p;ppV R{9   d   RlV%Rc,           2pVPH                  pVV9   pV'       g   \$        P&                  ! R|V3R}VV34      R9\$        P(                  ! V4      RPRE\0        P2                  ! 4       9   g   \$        P4                  ! V4      '       d   \$        P(                  ! V4      MRERF\$        P(                  ! V4      /,          pRGRHV/,          p\+        \$        P,                  ! V4      4      hR>;p;ppR># R># u up"i )~r   ri   r   rj   Trk   r  tokenr   r   r   claude-accountsra   CLAUDE_HOMEr  z.jsonlc               $    V ^8  d   QhRRRRRR/# )r   r|   r  r  r
   r   r   )r   s   "r   r   Htest_every_agent_start_path_is_contained_or_aborts.<locals>.__annotate__C  s!      V v $ r   c                 z    \         P                  P                  4       '       g   \        P                  ! R 4       R# )z&execvpe reached while not in containerN)r1   r;   in_containerrf  r  r  s   *,r   execvpe_guardItest_every_agent_start_path_is_contained_or_aborts.<locals>.execvpe_guardC  s'    --::<<KK@Ar   r   cld_anyr  c                 .    \         P                  ! R 4      # )zvendor preflight processr  r  s   *,r   r.   Dtest_every_agent_start_path_is_contained_or_aborts.<locals>.<lambda>N  s    FKK0J$Kr   cdx_exec_in_containerr  c                     R # r  r   r   r   r   r.   r  R  s    TXr   c                     R # Fr   r   r   r   r.   r  T  s    TYr   rI  rJ  c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r  X  r  r   c                Z  < S	R ;;,          ^,          uu&   VR,          pRqCVJqU'       g   \         P                  ! RV3RW434      RR\        P                  ! 4       9   g   \         P                  ! V4      '       d   \         P
                  ! V4      MRR\         P
                  ! V4      /,          pRRV/,          p\        \         P                  ! V4      4      hR;rT\        P                  ! RRR	R
R
/\        R4      RRRV\        P                  ! RVRVRR7      R7      pR Vn        V# )rI  r  Nr5   r   r   r   r   r!  r"  r#  r$  r%  r&  r'  r   r(  r,  c                     R # r-   r   r2  s   ,r   r.   _test_every_agent_start_path_is_contained_or_aborts.<locals>.fake_open_session.<locals>.<lambda>p  r4  r   r   r   )rE   rF   rG   rH   rI   rJ   rK   rL   r;   r5  r   r6  r7  )
r  r  r  r  r   rM   r   r   r8  countss
   &&,      r   r:  Mtest_every_agent_start_path_is_contained_or_aborts.<locals>.fake_open_sessionX  s    
 	~!#L)
!%%%%%%%z%%%%%%z%%%%z%%%%%%%%%%%!))K8*+4$A! ..#%!0(
  2r   c               $    V ^8  d   QhRRRRRR/# )r   r|   r  r  r
   r  r   )r   s   "r   r   r  s  s'     B B6 BV BH_ Br   c                 D   < SR ;;,          ^,          uu&   \        R4      h)rI  z!open_session should not be called)rK   )r|   r  r  s   *,r   fake_open_session_forbiddenWtest_every_agent_start_path_is_contained_or_aborts.<locals>.fake_open_session_forbiddens  s    ~!#@AAr   cdx_exec_launcher_failsc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r=  r   )r   s   "r   r   r  y  s4      ,8<HN	r   c                T   < SR ;;,          ^,          uu&   VP                  R4       S# )rJ  s   hi
rD  )rS  r~   r>  r  r  supervise_rcs   &&&,r   rG  Jtest_every_agent_start_path_is_contained_or_aborts.<locals>.fake_supervisey  s)     	{q W%r   cdx_exec_containerr  c                     R # r  r   r   r   r   r.   r        VZr   rW  c                     R # r  r   r   r   r   r.   r    s    V[r   zin-containerc                     R # r  r   r   r   r   r.   r    r  r   abortedcdx_exec_open_session_failsc                     R # r  r   r   r   r   r.   r    r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r    s6     	k 	k	k(	k 	k %		kr   c                z   < SR ;;,          ^,          uu&   \         P                  ! R\         P                  R7      h)rI  node unavailablecoder;   OffloadUnavailablerD   )r  r  r  r  s   &&,r   failing_open_sessionPtest_every_agent_start_path_is_contained_or_aborts.<locals>.failing_open_session  s/    
 >"a'"!445GoNiNijjr   cdx_non_execc                     R # r  r   r   r   r   r.   r    r  r   c                     R # r  r   r   r   r   r.   r    r  r   r   c                    R # r-   r   r   s   &&r   r.   r    r   r   c                    R # r-   r   r   s   &&r   r.   r    s    aer   rx   cdx_execr   r   r   r7   r#  r   r8   Nr5   r   r6   expected_exitrb  rL  r   r   r   r   z.logzassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.out
}.strip
}()
}.endswith
}(%(py10)s)
}r9   r:   r<   rQ  recordsr   rS  rV  expected_moder   rU  r  r   r  r]  r!  r   r0  r'  rZ  r&  rX  rY  r[  r^  noner  z7debian1: the sandbox launcher started no container (rc )z+adapter captures no log for these argumentsexpected_reasonsr|  r   u!   cdx: containment unavailable — >   r  r  r  )r   r   r   r'  r*  rM  hi)r   r   r   loginrl   )r   r   ra   r   >   r  r  rA   r  z%(py0)s == %(py2)sr  rf  re  r   rg  )zT%(py1)s == %(py10)s
{%(py10)s = %(py5)s
{%(py5)s = %(py3)s.get
}(%(py6)s, %(py8)s)
}>   r  r  r   r   )%r   r   rn  r#   r0   r1   r   r   r;   RC_GIT_MOUNTrD   r   r   r   r   rq   
startswithr   rE   rF   rJ   rK   rL   r   rG   rH   rI   r  r   endswithrr  rs  r   r  rQ  getr   )+r|  r+   r'   r(   r[   r   claude_homer  r:  r  rG  expected_stdout_is_log_pathr  r  r  
cdx_router
cld_routerr   r   rN   r   r   r   r   rM   rz  r   r   r   rO   rP   rR   rQ   rS   rx  r  rj  ry  r   r  r   r  r  s+   &&&&&                                    @@r   2test_every_agent_start_path_is_contained_or_abortsr  !  s}   4 &3lB\QKd#;**7W*E@@CTTW\\_llKd#+SfFO1K-LM
 ))9mDy%%K	
 &&N::NLYN::NMZ,aa@F 6B B 48;T3T?//Z[L  #'*t"t##N::<Ll[N::NL]^#	(	(N::<Lm\N::NLgh&	*	*N::<Ll[N::NL]^!'44	.	.N::<Ll[	k 	k 	N::NL`a!'33		N::<Ll[N::NLgh!'::N::<Ll[N::NLgh!'::^D###
 446HJef--##%*>>J  --$$&*>>J
 z""OOQ
	 
	OO$YZ	OO$GH	@@n%**%*****%***%***********k"'a'"a'''''"a'''"'''a''''''''	(	(n%**%*****%***%***********k"'a'"a'''''"a'''"'''a''''''''	.	.n%**%*****%***%***********k"'a'"a'''''"a'''"'''a''''''''n%**%*****%***%***********k"'a'"a'''''"a'''"'''a''''''''  "H%%%%%9%%%%%%9%%%%9%%%%%%%%%%%%%%%%%%%""||:(,,"4"4"6!7r::|::::::|:::::::x::::x:::|::::::::::::||4|!!4!#4#,,4V4,V444444444x4444x444|444!444#444,444V44444444444||!r!|r!!!!!|r!!!!!!x!!!!x!!!|!!!r!!!!!!!! &/::G:LWWYYD::< 	

4Y  
 w<1<1<133ww<1QZF&>*>]*****>]***>******]****]********uf~&&~&&&&&~&&&~&&&&&&&&&&&i +G+ G+++++ G+++ +++G++++++++f~&&~&&&&&~&&&~&&&&&&&&&&&i ,H, H,,,,, H,,, ,,,H,,,,,,,,*...........................#f~**~*****~***~***********k"Q&QQ"&QQQQQQ"&QQQQ"QQQ&QQQQQQQQQk"3m3"m33333"m333"333m33333333m$9(99$(999999$(9999$999(999999999i 0L0 L00000 L000 000L00000000h'4'4'''''4''''''4''''''''	.	(f~%%~%%%%%~%%%~%%%%%%%%%%%k"*d*"d*****"d***"***d********k"*d*"d*****"d***"***d********m$9(99$(999999$(9999$999(999999999i 0L0 L00000 L000 000L00000000h'4'4'''''4''''''4''''''''f~%%~%%%%%~%%%~%%%%%%%%%%%k"*d*"d*****"d***"***d********k"*d*"d*****"d***"***d********m$..$.....$...$...........i WT__U5K5K\QVW %VWWWWW %VWWW WWW%VWWWWWWWW)+=%)`apa}a}`~~  (A
 h 	
#3#7#7 	
?	
#7?$
 	
 $
 
 	
 	
 	
 $
 	
 	
 			
 	
 	
	6	
 	
 	
#3 	
 	
 			
#3 	
 	
 			
#7 	
 	
	6	
 	
 	
	
 	
 			
	
 	
 			
?	
 	
 			
 $
 	
 	
 	
 	
 	
 	
 	
 	
 II26(3C2DEUUEUUUUUEUUUEUUUUUUUUUUUUUUUUUUUUU JWs   :BA BA c               (    V ^8  d   QhRRRRRRRR/# 	r   r'   r   r(   r)   r[   r\   r
   r   r   )r   s   "r   r   r     s6     "C "C"C#"C '"C 
	"Cr   c                  a V R ,          p\         P                  ! RRRRR/V RRR.\         P                  ! RV4      R7      oVP                  pR	qT! V4      p\	        V4      p\        V4      p^qV	8H  q'       Eg   \        P                  ! R1V
3R2W34      R
R\        P                  ! 4       9   g!   \        P                  ! \
        4      '       d   \        P                  ! \
        4      MRRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V	4      /	,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;p;rR R lpVP                  SRR 4       VP                  \        P                   RR 4       VP                  \        P                   RV3R l4       VP                  \        R V4       \        P                   ! \        P"                  ! 4       \        P$                  R!7      pVP'                  R"R#./ V R$,          R\(        P*                  ! 4       4      p^pVV8H  pV'       g   \        P                  ! R1V3R3VV34      R
R%\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR%R&\        P                  ! V4      /,          pR'R(V/,          p\        \        P                  ! V4      4      hR;ppVP                  pR	pV! V4      p\	        V4      p. pVV8H  pV'       Eg`   \        P                  ! R1V3R4VV34      R
R\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R&\        P                  ! V4      R(\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      R\        P                  ! V4      /,          pR+R,V/,          p\        \        P                  ! V4      4      hR;p;p;p;p;ppR-pVP,                  pV! 4       pVP.                  pVV9   pV'       g   \        P                  ! R5V3R6VV34      R\        P                  ! V4      R&R.\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR.R(\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      /,          pR/R0V/,          p\        \        P                  ! V4      4      hR;p;p;p;ppR# )7claimsr   r!  r"  r#  cdx-offload/xsshzuser@100.0.0.1)r)  r-  r.  r/  rS  claimz*.claimr5   rQ  r   listr6   r7   r8   r9   r:   r<   rN  rO  rP  Nc               $    V ^8  d   QhRRRRRR/# )r   r|   r  r  r
   r?  r   )r   s   "r   r   Xtest_run_captured_releases_the_placement_claim_when_the_run_raises.<locals>.__annotate__  s!     4 4F 4f 4 4r   c                     \        R 4      h)the node went away mid-run)OSErrorr  s   *,r   boomPtest_run_captured_releases_the_placement_claim_when_the_run_raises.<locals>.boom  s    233r   r7  c                     R # r-   r   r2  s   ,r   r.   Ttest_run_captured_releases_the_placement_claim_when_the_run_raises.<locals>.<lambda>  s    tr   r  c                     R # r  r   r   r   r   r.   r    r  r   rI  c                    < S# r-   r   )akwr8  s   *,r   r.   r    s    r   rJ  rx   r'  r  run.logr   r   r   r   r   r   r=   r>   r  r[   r   r?   rA   )z%(py12)s
{%(py12)s = %(py0)s(%(py10)s
{%(py10)s = %(py1)s(%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s.glob
}(%(py6)s)
})
})
} == %(py15)sr   )zi%(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.glob
}(%(py5)s)
})
} == %(py12)sr   zb%(py1)s in %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.readouterr
}()
}.err
})r;   r5  acquire_claimglobr  rQ  rE   rF   rG   rH   rI   rJ   rK   rL   r0   r1   r   r   rq   _run_capturedtime	monotonicr   r   )r'   r(   r[   r  rN   rO   rP   rR   rQ   rv  r  ru  rw  r  r   r   r   rM   r   r   r   r   r   rU   rS   rT   r   r   rV   r8  s   &&&                          @r   Btest_run_captured_releases_the_placement_claim_when_the_run_raisesr    s   
  F%%VV4%&++Iv>G KK1	1K	*1t*+13+,1111111,1111113111131111111t1111t1111111F1111F111K111	111*111+111,1111111111114 .CD668H,W&&8P T:))##%*>>F
 $$fd^RI9MtUYUcUcUefI9>999-I-I&-4&'-2-'2-----'2------4----4-----------------I---&---'---2---------'B6+<+<B+<+>B+>+B+BB'+BBBBBB'+BBBB'BBBBBB6BBBB6BBB+<BBB+>BBB+BBBBBBBBBBr   c               $    V ^8  d   QhRRRRRR/# r   r'   r   r(   r)   r
   r   r   )r   s   "r   r   r   -  s&     -. -.-.#-. 
-.r   c                :  a a S R ,          R,          R,          pVP                  RR7       VR,          P                  RRR7       \        P                  ! R	RVR,          R
7      p/ oR VV 3R llpVP	                  \
        P                  RR 4       VP	                  \
        P                  RV4       VP	                  \
        RR 4       \
        P                  ! \
        P                  ! 4       \
        P                  R7      pR\        V4      /pVP                  P                  V4      pWs8H  q'       g   \        P                  ! R"V3R#Ws34      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MR/,          p	RRV	/,          p
\%        \        P&                  ! V
4      4      hRpVP)                  RR.VS R,          V\*        P,                  ! 4       4       SR,          qV8H  q'       g   \        P                  ! R"V3R$W34      R\        P"                  ! V4      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MR/,          pR R!V/,          p\%        \        P&                  ! V4      4      hR;rR# )%ri   r  rj   Trk   r  r  r   r   r   r  c               (    V ^8  d   QhRRRRRRRR/# )	r   r  r#   r*  r}   r  r  r
   r  r   )r   s   "r   r   Stest_run_captured_passes_adapter_credential_into_open_session.<locals>.__annotate__<  s0      !  
!	r   c                p   < VR ,          SR &   \         P                  ! RRRRR/SRR.R7      pR Vn        V# )	r  r   r!  r"  r#  r  zagent-sandbox)r)  r-  r.  r/  rS  c                     R # r-   r   r2  s   ,r   r.   jtest_run_captured_passes_adapter_credential_into_open_session.<locals>.fake_open_session.<locals>.<lambda>I  r4  r   )r;   r5  r7  )r  r*  r  r8  r   r'   s   &&, r   r:  Xtest_run_captured_passes_adapter_credential_into_open_session.<locals>.fake_open_session<  sN    
 "(!5!))K8#!"
 2r   r  c                     R # r  r   r   r   r   r.   Otest_run_captured_passes_adapter_credential_into_open_session.<locals>.<lambda>L  r  r   rI  rJ  c                    ^ # )r   r   )rS  r~   r>  r  s   &&&,r   r.   r  N  s    WXr   rx   r5   r   r6   rT  rb  r7   Nr'  r  r  r  r   r   r   r   rA   r  re  )r   r   r;   r  r0   r1   r   r   rq   r#   r  r  rE   rF   rG   rH   rI   rJ   rK   rL   r  r  r  )r'   r(   r  rT  r:  r   r~   r   rM   rz  r   r   r   r   r   r   s   f&             @r   =test_run_captured_passes_adapter_credential_into_open_sessionr  -  s     j(61L@Lt$K++Gg+F))K'H
 #%H   668H,W66HYZ5XY))##%*>>F \*
+C~~((-H888xx
&$h.BHdnnN^_L!-X-----!---!------X----X--------r   
entrypointr  r   
escape_envFTc               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r   r'   r   r(   r)   r[   r\   r  r#   r  boolr
   r   r   )r   s   "r   r   r   _  sT     I_ I_I_#I_ 'I_ 	I_
 I_ 
I_r   c                f	  a aaa V'       d$   R0 F  pTP                  YUR8w  d   RMR4       K  	  VP                  \        P                  RR 4       R R lpVP                  \        P                  RV4       R	oR
 V3R llpVP                  \        RV4       \        P                  ! \        P
                  ! 4       \        P                  R7      pS R,          oVR8X  d^   VP                  RR./ \        P                  CR\        S R,          R,          R,          4      /CSR\        P                  ! 4       4      p	MS R,          R,          R,          oSP                  RR7       VP                  \        P
                  RR 4       VP                  VRVV 3R l4       VP                  \        P
                  RV3R l4       VP                  . R1O4      p	\        P                  qV
8H  q'       Eg   \         P"                  ! R2V3R3W34      RR\$        P&                  ! 4       9   g   \         P(                  ! V	4      '       d   \         P*                  ! V	4      MRR R!\$        P&                  ! 4       9   g!   \         P(                  ! \        4      '       d   \         P*                  ! \        4      MR!R"\         P*                  ! V
4      /,          pR#R$V/,          p\-        \         P.                  ! V4      4      hR;rS'       * q'       gw   R%RR&\$        P&                  ! 4       9   g   \         P(                  ! S4      '       d   \         P*                  ! S4      MR&/,          p\-        \         P.                  ! V4      4      hRpR'qP0                  pV! 4       pVP2                  pVV9   pV'       g   \         P"                  ! R4V3R5VV34      R(\         P*                  ! V4      R)R*\$        P&                  ! 4       9   g   \         P(                  ! V4      '       d   \         P*                  ! V4      MR*R+\         P*                  ! V4      R,\         P*                  ! V4      R-\         P*                  ! V4      /,          pR.R/V/,          p\-        \         P.                  ! V4      4      hR;p;p;p;ppR# )6CDX_NO_OFFLOADCDX_OFFLOAD_STRICT10r  c                     R # r  r   r   r   r   r.   >test_run_or_main_rejects_offload_unavailable.<locals>.<lambda>n      PUr   c               $    V ^8  d   QhRRRRRR/# )r   _argsr  _kwargsr
   r   r   )r   s   "r   r   Btest_run_or_main_rejects_offload_unavailable.<locals>.__annotate__p  s!     
 
& 
V 
 
r   c                 N    \         P                  ! R \         P                  R7      h)zno usable access doorr  r  )r  r   s   *,r   raise_unavailableGtest_run_or_main_rejects_offload_unavailable.<locals>.raise_unavailablep  s     00#/*E*E
 	
r   rI  Fc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r=  r   )r   s   "r   r   r  }  s4      ,8<HN	r   c                   < R o^ # r  r   )rS  r~   r>  r  supervise_calleds   &&&,r   rG  Dtest_run_or_main_rejects_offload_unavailable.<locals>.fake_supervise}  s      r   rJ  rx   r  r  r'  hellorj   ri   r  NTrk   r   c                    R # r-   r   r   s   &&r   r.   r        4r   r   c                    < SR S3# r  r   r|   r  r  r'   s   *,r   r.   r    s    Xv|$Dr   capture_log_pathc                   < S# r-   r   )r   r*  r>  s   &&r   r.   r    s    r   r5   r   r6   r;   r7   r   r8   zassert not %(py0)sr  u6   cdx: containment unavailable — no usable access doorr   r   r[   r   r   r   r   r?   )r  OD_REMOTE_EXECHARNESS_SEAT_CONTAINERr  )r   r'  r	  rA   )z3%(py0)s == %(py4)s
{%(py4)s = %(py2)s.EXIT_MIRROR
}r   r  )rn  r0   r1   r;   r   r   rq   r  r   environr#   r  r  r   r   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r'   r(   r[   r  r  env_namer  rG  r   r   rN   rM   r   r   @py_format2r   r   r   r   r   r   rV   r  r>  r  s   f&&&&                 @@@r   ,test_run_or_main_rejects_offload_unavailabler  ]  s!    
H x<P0PVYZ
 66V

 &&   ^D))##%*>>F )#H_$((W\rzz\<X
-BV-Kl-Z)[\NN
	  *,v5D4('''	

 	D	

 	''1	

 KK 89	'333333333933333393333933333333333333333333333C^GXGX^GXGZ^GZG^G^^CG^^^^^^CG^^^^C^^^^^^v^^^^v^^^GX^^^GZ^^^G^^^^^^^^^^r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r     s0     . ..#. '. 
	.r   c                  a aa \         P                  ! \         P                  ! 4       \         P                  R 7      pS R,          R,          R,          oSP	                  RR7       VP                  VRVV 3R l4       VP                  \         P                  RR	 4       VP                  \         P                  R
R 4       VP                  \         P                  RR 4       RoR V3R llpVP                  \         P                  RV4       VP                  RR.4      pVP                  4       p\        P                  quV8H  q'       Eg   \        P                  ! R%V3R&WW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRR\        P                   ! V4      /,          p	RRV	/,          p
\#        \        P$                  ! V
4      4      hR;rRpSVJ q'       g   \        P                  ! R'V3R(SV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MRR\        P                   ! V4      /,          pRRV/,          p\#        \        P$                  ! V4      4      hR;rVP&                  qP(                  qw! 4       pR qV8H  pV'       g   \        P                  ! R%V3R)VV34      RR!\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR!R\        P                   ! V4      R\        P                   ! V4      R\        P                   ! V4      R"\        P                   ! V4      /,          pR#R$V/,          p\#        \        P$                  ! V4      4      hR;p;p;p;ppR# )*rx   ri   r  rj   Trk   r   c                    < SR S3# r  r   r  s   *,r   r.   Ttest_cdx_main_with_no_containerized_log_path_returns_uncontainable.<locals>.<lambda>      6< @r   r  c                     R # r  r   r   r   r   r.   r        r   r  c                    R # r-   r   r   r*  s   &&r   r.   r        Tr   rI  c                 .    \         P                  ! R 4      # )z9open_session should not run when capture_log_path is Noner  r  s   *,r   r.   r    s    ,g hr   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Xtest_cdx_main_with_no_containerized_log_path_returns_uncontainable.<locals>.__annotate__  r   r   c                   < R oR# r   r   r   s   &&&r   r   Xtest_cdx_main_with_no_containerized_log_path_returns_uncontainable.<locals>.fake_execvpe  r   r   r   r   r   r5   r   r6   r;   r7   r   r8   Nr   r   r   r   \cdx: no containerized path for this invocation (adapter captures no log for these arguments)r   r   r   r?   rA   r   r   r   r   )r1   r   r   rq   r   r0   r;   r   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r'   r(   r[   r   r   r   r   rN   rM   r   r   r   r   r   rO   r   rP   r   rV   r  r   s   f&&                @@r   Btest_cdx_main_with_no_containerized_log_path_returns_uncontainabler'    s   
 ))##%*>>F j(61L@Lt$@
 &&
 ##)
 &&h
 K  ))9lCUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::;%;%;;%<<   ff   f    8   8   <         f       r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     A A
A#A 'A 
	Ar   c                   \         P                  ! \         P                  ! 4       \         P                  R 7      pVP	                  . RO4      pVP                  4       p^qdV8H  qw'       g   \        P                  ! RV3RWF34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;rvVP                  qwP                  q! 4       pRqV8H  q'       g   \        P                  ! RV3RW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R
\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p
;p;rR# )rx   r5   r   r   r   r   Nzcdx: unknown account 'nope'r   r6   r7   r8   r   r   r?   )r   r   noper   rA   r   r   )r1   r   r   rq   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r+   r(   r[   r   r   r   r   rM   r   r   rN   rO   r   rP   r   rV   s   &&&             r   Ftest_codex_router_explicit_override_missing_everywhere_reports_unknownr+    sH   
 ))##%*>>F
 @AI  "H>999<<@@@#@@#@@@@@@@@@@@@8@@@@8@@@<@@@@@@@@@#@@@@@@@@@@r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     Q Q
Q#Q 'Q 
	Qr   c                   V R ,          P                  RR7       VP                  \        RRR l4       \        P                  ! \        P                  ! 4       \        P
                  R7      pVP                  RR.4      pVP                  4       p^qdV8H  qw'       g   \        P                  ! RV3RWF34      R	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;rvVP                   qwP"                  q! 4       qP$                  pRq! V4      q'       g   RR	R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p
;p;p;rR# )r   Trk   rq   Nc                    R # rs   r   rt   s   &r   r.   Ntest_codex_router_reports_clean_error_for_missing_rules_file.<locals>.<lambda>  rw   r   rx   r   r   r5   r   r   r   r   "cdx: failed to load routing rules:assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.err
}.strip
}()
}.startswith
}(%(py10)s)
}r   r6   r7   r8   r9   r:   r<   r-   rA   r   )r   r0   r1   r   r   rq   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r  r+   r(   r[   r   r   r   r   rM   r   r   rN   rO   rP   rR   rQ   rS   s   &&&             r   <test_codex_router_reports_clean_error_for_missing_rules_filer3    s   
 
33::4:H(=?YZ))##%*>>F
 UFO,I  "H>999<<PPP**P+OP*+OPPPPPPPPP8PPPP8PPP<PPPPPPPPP*PPP+OPPPPPPPPPPPr   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r      s6     Q Q
Q#Q 'Q 
	Qr   c                V   V R ,          pVP                  RR7       VR,          P                  RRR7       VP                  \        RRR	 l4       \        P                  ! \        P
                  ! 4       \        P                  R
7      pVP                  RR.4      pVP                  4       p^quV8H  q'       g   \        P                  ! RV3RWW34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                   ! V
4      4      hR;rVP"                  qP$                  q! 4       qP&                  pRq! V4      q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                   ! V4      4      hR;p;p;p;p;rR# )r   Trk   r^   znot-jsonr   r   rq   Nc                    R # rs   r   rt   s   &r   r.   Ptest_codex_router_reports_clean_error_for_malformed_rules_json.<locals>.<lambda>  rw   r   rx   r   r   r5   r   r   r   r   r0  r1  r   r6   r7   r8   r9   r:   r<   r-   rA   r   )r   r   r0   r1   r   r   rq   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r  )r+   r(   r[   r    r   r   r   r   rM   r   r   rN   rO   rP   rR   rQ   rS   s   &&&              r   >test_codex_router_reports_clean_error_for_malformed_rules_jsonr8     s   
 ==HNN4N $$00g0N(=?YZ))##%*>>F
 UFO,I  "H>999<<PPP**P+OP*+OPPPPPPPPP8PPPP8PPP<PPPPPPPPP*PPP+OPPPPPPPPPPPr   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     Q Q
Q#Q 'Q 
	Qr   c                    \        V R RRR/ RRR. RRR	^d//4       VP                  \        R
RR l4       \        P                  ! \        P                  ! 4       \        P
                  R7      pVP                  RR.4      pVP                  4       p^qdV8H  qw'       g   \        P                  ! RV3R WF34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;rvVP                   qwP"                  q! 4       qP$                  pRq! V4      q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p
;p;p;rR# )!r   r^   r   r_   rb   r#  rd   rf   broken_onlyrh   rq   Nc                    R # rs   r   rt   s   &r   r.   Otest_codex_router_reports_clean_error_for_invalid_rules_shape.<locals>.<lambda>'  rw   r   rx   r   r   r5   r   r   r   r   r0  r1  r   r6   r7   r8   r9   r:   r<   r-   rA   r   )r!   r0   r1   r   r   rq   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r  r2  s   &&&             r   =test_codex_router_reports_clean_error_for_invalid_rules_shaper>    s   
 ,B2 ""M/		
 (=?YZ))##%*>>F
 UFO,I  "H>999<<PPP**P+OP*+OPPPPPPPPP8PPPP8PPP<PPPPPPPPP*PPP+OPPPPPPPPPPPr   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   4  s0     * *
*#* '* 
	*r   c                   \        V R RRR/ RRRR.RR	R
^d//4       V R,          R,          R,          R,          pVP                  RR7       \        V RRRR^
R^//R4       VP                  \        RR+R l4       VP                  \        P
                  RR 4       \        P                  ! \        P
                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       VP                  RR.4      pVP                  4       p\        P                  quV8H  q'       Eg   \        P                  ! R,V3R-WW34      RR \        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR R!R"\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR"R#\        P$                  ! V4      /,          p	R$R%V	/,          p
\'        \        P(                  ! V
4      4      hR;rVP*                  qP,                  qw! 4       pR&qV8H  q'       g   \        P                  ! R,V3R.VV34      RR'\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR'R!\        P$                  ! V4      R#\        P$                  ! V4      R%\        P$                  ! V4      R(\        P$                  ! V4      /,          pR)R*V/,          p\'        \        P(                  ! V4      4      hR;p;p;p;rR# )/r   r   r   r_   rb   ra   rd   re   rf   rg   rh   r   r  r  Trk   rl   rm   rn   ro   r   rq   Nc                    R # r   r   rt   s   &r   r.   Atest_claude_router_execs_with_claude_config_dir.<locals>.<lambda>O  rw   r   verify_env_supportc                    R # r  r   r   r+   s   &&r   r.   rB  P      _cr   rx   r   c                 .    \         P                  ! R 4      # zexecvpe should not runr  r  s   *,r   r.   rB  V      fkkZrNsr   r   r   r5   r   r6   r;   r7   r   r8   \cld: no containerized path for this invocation (adapter captures no log for these arguments)r   r   r   r?   r-   rA   r   r   r!   r   r%   r0   r1   r   r   rq   r   r   r   r;   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r+   r(   r[   r  r   r   r   rN   rM   r   r   rO   r   rP   r   rV   s   &&&             r   /test_claude_router_execs_with_claude_config_dirrM  4  s   
 3B5 5'"$?/		
 @@CTTW\\_llKd#Hd$6<PRTU	
 	# (=?YZ446JLcd))$$&*>>F
 ))96stUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::<<   ff   f    8   8   <         f       r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   a  s0     ( (
(#( '( 
	(r   c                2   \        V R RRR/ RRRR.RR	R
^d//4       V R,          R,          R,          R,          P                  RR7       \        V RRRR^
R^//R4       VP                  RR4       VP	                  \
        RR.R l4       VP	                  \
        P                  RR 4       \
        P                  ! \
        P                  ! 4       \
        P                  R7      pVP	                  \
        P                  RR 4       VP                  RR .4      pVP                  4       p\        P                  qdV8H  qw'       Eg   \        P                  ! R/V3R0WF34      R!R"\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MR"R#R$\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MR$R%\        P&                  ! V4      /,          pR&R'V/,          p	\)        \        P*                  ! V	4      4      hR;rv\        P,                  R,          p
RqjV8H  q'       gy   \        P                  ! R/V3R1W34      R(\        P&                  ! V
4      R%\        P&                  ! V4      /,          pR&R'V/,          p	\)        \        P*                  ! V	4      4      hR;p
;rVP.                  qwP0                  qf! 4       pR)qV8H  q'       g   \        P                  ! R/V3R2VV34      R!R*\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MR*R#\        P&                  ! V4      R%\        P&                  ! V4      R'\        P&                  ! V4      R+\        P&                  ! V4      /,          pR,R-V/,          p\)        \        P*                  ! V4      4      hR;p;p;p;rR# )3r   r   r   r_   rb   ra   rd   re   rf   rg   rh   r   r  r  Trk   rl   rm   rn   ro   r   STALL_GUARD_NOTIFYr  rq   Nc                    R # r   r   rt   s   &r   r.   Ptest_router_keeps_the_notification_opt_in_out_of_the_child_env.<locals>.<lambda>z  rw   r   rC  c                    R # r  r   rE  s   &&r   r.   rR  {  rF  r   rx   r   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   rR    rI  r   r   r   r5   r   r6   r;   r7   r   r8   r   rJ  r   r   r   r?   r-   rA   r   r  r   )r!   r   r%   rn  r0   r1   r   r   rq   r   r   r   r;   r   rE   rF   rG   rH   rI   rJ   rK   rL   r  r   r   )r+   r(   r[   r   r   r   rN   rM   r   r   r   r   rO   r   rP   r   rV   s   &&&              r   >test_router_keeps_the_notification_opt_in_out_of_the_child_envrU  a  s   
 3B5 5'"$?/		
 
336GG%OR__ffosft	4!3R9MrRS"
 +S1(=?YZ446JLcd))$$&*>>F
 ))96stUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::::*+2s2s22222+222+222s22222222<<   ff   f    8   8   <         f       r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s0     4 4
4#4 '4 
	4r   c                T   \        V R RRR/ RRR. RRR	^d//4       V R
,          R,          R,          R,          pVP                  RR7       V R
,          R,          R,          R,          P                  RR7       \        V RRRR^
R^//R4       \        V RRRRRRR//R4       VP                  \        RR.R l4       VP                  \        P
                  RR 4       \        P                  ! \        P
                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       VP                  R R!.4      pVP                  4       p\        P                  quV8H  q'       Eg   \        P                  ! R/V3R0WW34      R"R#\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR#R$R%\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR%R&\        P$                  ! V4      /,          p	R'R(V	/,          p
\'        \        P(                  ! V
4      4      hR;rVP*                  qP,                  qw! 4       pR)qV8H  q'       g   \        P                  ! R/V3R1VV34      R"R*\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR*R$\        P$                  ! V4      R&\        P$                  ! V4      R(\        P$                  ! V4      R+\        P$                  ! V4      /,          pR,R-V/,          p\'        \        P(                  ! V4      4      hR;p;p;p;rR# )2r   r^   r   r_   rb   sharedrd   rf   rg   rh   r   ri   rj   Trk   r  r  rl   rm   rn   ro   rp   brokenNr   rq   c                    R # r   r   rt   s   &r   r.   Ktest_codex_router_ignores_conflicting_claude_health_cache.<locals>.<lambda>  rw   r   r   c                    R # r-   r   r   s   &&r   r.   r[    r   r   rx   r   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   r[    rI  r   r   r   r5   r   r6   r;   r7   r   r8   r&  r   r   r   r?   r-   rA   r   r   )r!   r   r%   r0   r1   r   r   rq   r   r   r   r;   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r+   r(   r[   
codex_homer   r   r   rN   rM   r   r   rO   r   rP   r   rV   s   &&&             r   9test_codex_router_ignores_conflicting_claude_health_cacher_    s   
 ,B8 ""$?/		
 ??*LxWZffJT"	336GG(RUbbiirviwx'92?SUWX	
 	 x+=tEY[_`	
 	# (=?YZ###
 ))##%*>>F ))96stUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::<<   ff   f    8   8   <         f       r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s0     0 0
0#0 '0 
	0r   c                T   \        V R RRR/ RRR. RRR	^d//4       V R
,          R,          R,          R,          P                  RR7       V R
,          R,          R,          R,          pVP                  RR7       \        V RRRRRRR//R4       \        V RRRR^
R^//R4       VP                  \        RR.R l4       VP                  \        P
                  RR 4       \        P                  ! \        P
                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       VP                  R R!.4      pVP                  4       p\        P                  quV8H  q'       Eg   \        P                  ! R/V3R0WW34      R"R#\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR#R$R%\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR%R&\        P$                  ! V4      /,          p	R'R(V	/,          p
\'        \        P(                  ! V
4      4      hR;rVP*                  qP,                  qw! 4       pR)qV8H  q'       g   \        P                  ! R/V3R1VV34      R"R*\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR*R$\        P$                  ! V4      R&\        P$                  ! V4      R(\        P$                  ! V4      R+\        P$                  ! V4      /,          pR,R-V/,          p\'        \        P(                  ! V4      4      hR;p;p;p;rR# )2r   r   r   r_   rb   rX  rd   rf   rg   rh   r   ri   rj   Trk   r  r  rl   rY  rn   Nro   rp   rm   r   rq   c                    R # r   r   rt   s   &r   r.   Ktest_claude_router_ignores_conflicting_codex_health_cache.<locals>.<lambda>  rw   r   rC  c                    R # r  r   rE  s   &&r   r.   rc    rF  r   rx   r   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   rc    rI  r   r   r   r5   r   r6   r;   r7   r   r8   rJ  r   r   r   r?   r-   rA   r   r   rK  rL  s   &&&             r   9test_claude_router_ignores_conflicting_codex_health_cacherf    s
   
 3B8 ""$?/		
 
33j@8KlZaajnao@@CTTW__booKd#x+=tEY[_`	
 	 x'92?SUWX	
 	# (=?YZ446JLcd))$$&*>>F ))96stUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::<<   ff   f    8   8   <         f       r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s+     6Y 6Y
6Y#6Y 
6Yr   c                  a \        V R RRRRRRRRR	R
.//RRR^d//4       V R,          R,          R,          R,          pVP                  RR7       V R,          R,          R
,          R,          pVP                  RR7       \        V RRRRRRR/R
RRR^
R^//R4       VP                  \        RR2R l4       VP                  \        P
                  RR RR7       \        P                  ! \        P
                  ! 4       \        P                  R7      p. oR  V3R! llpVP                  \        P                  R"R# 4       VP                  \        P                  R$V4       VP                  R%R&.4      p\        P                  qvV8H  q'       Eg   \        P                  ! R3V3R4Wg34      R'R(\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR(R)R*\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR*R+\        P$                  ! V4      /,          p	R,R-V	/,          p
\'        \        P(                  ! V
4      4      hR;r. R5O.pSV8H  q'       g   \        P                  ! R3V3R6SV34      R'R.\        P                   ! 4       9   g   \        P"                  ! S4      '       d   \        P$                  ! S4      MR.R/\        P$                  ! V4      /,          pR0R1V/,          p\'        \        P(                  ! V4      4      hR;rR# )7r   r   r   versionz
routing/v2r_   r   r[  ra   fallbackre   rb   rh   r   r  r  Trk   rl   rY  rn   Nro   rm   r   rq   c                    R # r   r   rt   s   &r   r.   Rtest_claude_router_notifies_and_uses_fallback_for_broken_default.<locals>.<lambda>  rw   r   rC  c                    R # r  r   r   r  s   &&r   r.   rl    r  r   Fraisingrx   c                    V ^8  d   QhRRRR/# )r   r|   r}   r
   r  r   )r   s   "r   r   Vtest_claude_router_notifies_and_uses_fallback_for_broken_default.<locals>.__annotate__"  s       v r   c                :   < SP                  V 4       \        4       # r-   )appendr  )r|   popen_callss   &r   
fake_popenTtest_claude_router_notifies_and_uses_fallback_for_broken_default.<locals>.fake_popen"  s    4 xr   r   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   rl  &  rI  r   Popenr   r   r5   r   r6   r;   r7   r   r8   ru  r   r   r   r-   rA   r   )znotify-sendr   z"avi unavailable, using roy insteadr   )r!   r   r%   r0   r1   r   r   rq   r   r   r   r;   r   rE   rF   rG   rH   rI   rJ   rK   rL   )r+   r(   claude_default_homeclaude_fallback_homer   rv  r   rN   rM   r   r   r   r   r   ru  s   &&            @r   @test_claude_router_notifies_and_uses_fallback_for_broken_defaultr|    s    3<	5*ugF 5/
	
 !HHK\\_ddgttd+"IIL]]`eehuut,Hh(:DBVX\]Hd$6<PRTU	
 	# (=?YZ$$'	   ))$$&*>>F
 $&K  ))96st117JGUFO,I':::::::::9::::::9::::9:::::::::::::::::::::::WXX;XXXXXX;XXXXXXX;XXXX;XXXXXXXXXXXXr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   /  s      d t r   c                   V R ,          R,          R,          R,          p\         P                  q"! 4       q3P                  qD! V4      pR\        V4      R\        V4      RR/qeV8H  qw'       Eg_   \        P
                  ! RV3RWV34      RR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;p;p;rvR# )r   r  	multidealr  r  SYSTRAY_CLAUDE_ACCOUNT_HOMESYSTRAY_CLAUDE_ACCOUNT_SLUGr5   r1   r6   r7   r8   r   r  r   r<   r=   r>   NrA   )z%(py9)s
{%(py9)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.ClaudeAdapter
}()
}.build_env
}(%(py7)s)
} == %(py12)s)r1   r   	build_envr#   rE   rF   rG   rH   rI   rJ   rK   rL   )
r+   r  rM   rN   rO   r   rQ   rU   rS   rT   s
   &         r   ;test_claude_adapter_build_env_identifies_statusline_accountr  /  s   AADUUXccfssL'' ') 33 3LA S.%s<'8%{F  F    	A   	  	>   	>   	'   	)   	3   	  	L   	L   	A   	 F      	  r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r   9  s+     S S
S#S 
Sr   c                   V R ,          R,          R,          pVP                  \        P                  RR 4       \        P                  q3! 4       qDP                  qU! V4      pRqvVJ q'       Eg_   \
        P                  ! RV3RWg34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      R	\
        P                  ! V4      R
\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p	RRV	/,          p
\        \
        P                  ! V
4      4      hR;p;p;p;p;rR# )r  ra   r  r  c                 .    \         P                  ! R 4      # )zruntime capability prober  r  s   *,r   r.   Vtest_claude_adapter_uses_declared_environment_contract_without_probe.<locals>.<lambda>B  s    ,F Gr   Tr5   r1   r6   r7   r8   r   r  r   r<   r=   r>   Nr   )z%(py9)s
{%(py9)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.ClaudeAdapter
}()
}.verify_env_support
}(%(py7)s)
} is %(py12)s)r0   r1   r   r   rC  rE   rF   rG   rH   rI   rJ   rK   rL   )r+   r(   r  rM   rN   rO   r   rQ   rU   rS   rT   s   &&         r   Dtest_claude_adapter_uses_declared_environment_contract_without_prober  9  s    ++e3mCL!!G ''R')R<<R<\JRdRdRRRRRJRRRRRR>RRRR>RRR'RRR)RRR<RRRRRR\RRRR\RRRJRRRdRRRRRRRRRr   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   H  s0     6 6
6#6 '6 
	6r   c                  a \        V R RRR/ RRRR.RR	R
^d//4       V R,          R,          R,          R,          pVP                  RR7       \        V RRRR^
R^//R4       VP                  \        RR0R l4       VP                  \        P
                  RR RR7       \        P                  ! \        P
                  ! 4       \        P                  R7      pRoR V3R llpVP                  \        P                  RV4       VP                  R R!.4      pVP                  4       p^qV8H  q'       g   \        P                  ! R1V	3R2Wh34      R"R#\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR#R$\        P                   ! V4      /,          p
R%R&V
/,          p\#        \        P$                  ! V4      4      hR;rRpSVJ q'       g   \        P                  ! R3V	3R4SV34      R"R'\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR'R$\        P                   ! V4      /,          p
R%R&V
/,          p\#        \        P$                  ! V4      4      hR;rVP&                  qP(                  q! 4       pR(V 2qV8H  q'       g   \        P                  ! R1V3R5VV34      R"R)\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR)R*\        P                   ! V	4      R+\        P                   ! V4      R,\        P                   ! V4      R-\        P                   ! V4      /,          pR.R/V/,          p\#        \        P$                  ! V4      4      hR;p	;p;p;rR# )6r   r   r   r_   rb   ra   rd   re   rf   rg   rh   r   r  r  Trk   rl   rm   rn   ro   r   rq   Nc                    R # r   r   rt   s   &r   r.   Qtest_claude_router_rejects_unsupported_routing_when_probe_fails.<locals>.<lambda>c  rw   r   rC  c                    R # r  r   rn  s   &&r   r.   r  g  s    5r   Fro  rx   c               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Utest_claude_router_rejects_unsupported_routing_when_probe_fails.<locals>.__annotate__q  r   r   c                   < R oR# r   r   r   s   &&&r   r   Utest_claude_router_rejects_unsupported_routing_when_probe_fails.<locals>.fake_execvpeq  r   r   r   r   r   r5   r   r   r   r   r   zEcld: unsupported routing: claude did not honor CLAUDE_CONFIG_DIR for r   r6   r7   r8   r   r   r?   r-   rA   r   r   r   r   )r!   r   r%   r0   r1   r   r   rq   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r+   r(   r[   r  r   r   r   r   r   rM   r   r   rN   rO   r   rP   r   rV   r   s   &&&               @r   ?test_claude_router_rejects_unsupported_routing_when_probe_failsr  H  s   
 3B5 5'"$?/		
 @@CTTW\\_llKd#Hd$6<PRTU	
 	# (=?YZ$$(	   ))$$&*>>F
 K  ))9lCUFO,I  "H>999;%;%;;%<<   
OP[}]]   ]    8   8   <         ]       r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s&     $ $
$#$ 
$r   c                  a V R ,          R,          pVP                  RR7       VP                  R4       V R,          oSP                  4        VP                  \        P                  RV3R l4       \        P
                  ! 4       P                  RR	.4      pR
qCVJqU'       g   \        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;rTVP                  pRpSV,          qV	8H  q'       Eg   \        P                  ! RV
3RWY34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;p;p
;rVP                  qUP                   q! 4       q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR
;p;rR
# )r   rM  Trk   @  tmpdir
gettempdirc                    < \        S 4      # r-   r#   fallback_roots   r   r.   Ltest_capture_log_path_falls_back_when_tray_logs_unwritable.<locals>.<lambda>  
    s=GYr   r'  r  Nr5   r>  r   r   r   zcdx-logsr6   r7   r  r8   r   r   z]assert %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.parent
}.is_dir
}()
}r   r   rA   )z:%(py2)s
{%(py2)s = %(py0)s.parent
} == (%(py4)s / %(py6)s))r   chmodr0   r1   tempfiler   r  rE   rF   rG   rH   rI   rJ   rK   rL   ro  is_dir)r+   r(   	tray_logsr>  r   rM   r   r   rO   rP   rN   r   r   r   r  s   &&            @r   :test_capture_log_path_falls_back_when_tray_logs_unwritabler    s    >>GIOODO!OOE8OM//?YZ**,==vtnMH48884??8j8mj88888888?888888888888888?888888m8888m888j88888888??#!!#!#########8####8###?###!###########r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     B B
B#B 'B 
	Br   c                   a V R ,          R,          pVP                  RR7       VP                  R4       V R,          oSP                  RR7       VP                  \        P                  RV3R l4       \        P
                  ! 4       P                  R	R
.4      pRqTVJ qf'       g   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reRqP                  q! 4       qP                   qV9   qU'       g   \        P                  ! RV3RW34      R\        P                  ! V	4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p	;p;p
;rR# )r   rM  Trk   r  r  )rV  r  c                    < \        S 4      # r-   r  r  s   r   r.   Rtest_capture_log_path_returns_none_when_no_directory_is_writable.<locals>.<lambda>  r  r   r'  r  Nr5   r>  r   r   r   zno writable log directoryr   r[   r   r   r   r?   r   r   r   r  )r   r  r0   r1   r  r   r  rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r+   r(   r[   r  r>  r   rM   r   r   r   r   r   r   r   rV   r  s   &&&            @r   @test_capture_log_path_returns_none_when_no_directory_is_writabler    s   
 >>GIOODO!OOE8OMU#//?YZ**,==vtnMHt888t&A*;*;A*;*=A*A*AA*AAAAAA&AAA&AAAAAA&AAAA&AAA*;AAA*=AAA*AAAAAAAAAAr   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     C C
C#C 'C 
	Cr   c                *
  a \        V R RRR/ RRRR.RR	R
^dRRR^
/RR^
////4       R9 F1  pV R,          R,          V,          R,          P                  RR7       K3  	  \        V RRRR^
R^ZRR/RRRR^
R^_RR//R4       VP                  \        RR:R l4       \        P
                  ! \        P                  ! 4       \        P                  R7      pRoR V3R  llpVP                  \        P                  R!V4       VP                  R"R#.4      pVP                  4       p^KqV8H  q'       g   \        P                  ! R;V	3R<Wh34      R$R%\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR%R&\        P                   ! V4      /,          p
R(R)V
/,          p\#        \        P$                  ! V4      4      hR;rRpSVJ q'       g   \        P                  ! R=V	3R>SV34      R$R*\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR*R&\        P                   ! V4      /,          p
R(R)V
/,          p\#        \        P$                  ! V4      4      hR;rVP&                  p	R'qV8H  q'       g   \        P                  ! R;V3R?W34      R$R+\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR+R,\        P                   ! V	4      R)\        P                   ! V4      /,          pR-R.V/,          p\#        \        P$                  ! V4      4      hR;p	;r\(        P*                  qP,                  q! V4      pRRR/R0R1R2R3R4/pVV8H  pV'       EgJ   \        P                  ! R;V3R@VV34      R$R5\        P                  ! 4       9   g!   \        P                  ! \(        4      '       d   \        P                   ! \(        4      MR5R,\        P                   ! V	4      R&R+\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR+R)\        P                   ! V4      R.\        P                   ! V4      R6\        P                   ! V4      /,          pR7R8V/,          p\#        \        P$                  ! V4      4      hR;p	;p;p;ppR# )Ar   r^   r   r_   rb   rc   rd   re   rf   rg   rh   account_caps7dr   ri   rj   Trk   rl   rm   rn   ro   r     @qA   0ݠArp   rq   Nc                    R # r   r   rt   s   &r   r.   Ftest_codex_router_all_capped_exits_75_with_resume_at.<locals>.<lambda>  rw   r   rx   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Jtest_codex_router_all_capped_exits_75_with_resume_at.<locals>.__annotate__  r   r   c                   < R oR# r   r   r   s   &&&r   r   Jtest_codex_router_all_capped_exits_75_with_resume_at.<locals>.fake_execvpe  r   r   r   r   r   r5   r   r   r#  r   r   r   r   r6   r   r   detailrate-limitedr^  all-accounts-capped	resume_at2026-08-10T12:40:53Zr   r:   r   r<   r   r-   rA   r   r   r   r  r  )r!   r   r%   r0   r1   r   r   rq   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r  r  )r+   r(   r[   r   r   r   r   r   r   rM   r   r   r   rN   r   r   rR   r   r   rS   r   s   &&&                 @r   4test_codex_router_all_capped_exits_75_with_resume_atr    s   
 ,B6 5'"$?/T2JD":!
	
"  	7	7*	Dt	Kl	Zaajnao  $"B$b$l	 $"B$b$l		
 	!$ (=?YZ))##%*>>F
 K  ))9lCUFO,I  "H?999;%;%;;%<<22<88<2:: ll :l# e.'+	( # (   
 # (  
  
 4  
 4  
 :  
  
 h  
 h  
 l  
 #  
  (     
   r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s0     8+ 8+
8+#8+ '8+ 
	8+r   c                  a \        V R RRR/ RRR. RRR	^dR
RR^
////4       V R,          R,          R,          R,          P                  RR7       \        V RRRR^
R^Z//R4       VP                  \        RR5R l4       \        P
                  ! \        P                  ! 4       \        P                  R7      pRoR V3R llpVP                  \        P                  RV4       VP                  RR.4      pVP                  4       p^KquV8H  q'       g   \        P                  ! R6V3R7WW34      R R!\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR!R"\        P                   ! V4      /,          p	R$R%V	/,          p
\#        \        P$                  ! V
4      4      hR;rRpSVJ q'       g   \        P                  ! R8V3R9SV34      R R&\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR&R"\        P                   ! V4      /,          p	R$R%V	/,          p
\#        \        P$                  ! V
4      4      hR;rVP&                  pR#qV8H  q'       g   \        P                  ! R6V3R:W34      R R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR'R(\        P                   ! V4      R%\        P                   ! V4      /,          p
R)R*V
/,          p\#        \        P$                  ! V4      4      hR;p;r\(        P*                  qP,                  q! V4      pRRR+R,R-R./qV8H  pV'       EgI   \        P                  ! R6V3R;W34      R R/\        P                  ! 4       9   g!   \        P                  ! \(        4      '       d   \        P                   ! \(        4      MR/R(\        P                   ! V4      R"R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR'R%\        P                   ! V4      R*\        P                   ! V4      R0\        P                   ! V4      /,          pR1R2V/,          p\#        \        P$                  ! V4      4      hR;p;p;p;ppR3pVP,                  pVV9  qw'       g   \        P                  ! R<V3R=VV34      R4\        P                   ! V4      R"R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR'R%\        P                   ! V4      /,          p
R)R*V
/,          p\#        \        P$                  ! V4      4      hR;p;r{R# )>r   r   r   r_   rb   ra   rd   rf   rg   rh   r  r  r   r  r  Trk   rl   rm   rn   ro   r   rq   Nc                    R # r   r   rt   s   &r   r.   Ttest_cld_router_all_capped_exits_75_without_resume_at_when_unknown.<locals>.<lambda>
  rw   r   rx   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Xtest_cld_router_all_capped_exits_75_without_resume_at_when_unknown.<locals>.__annotate__  r   r   c                   < R oR# r   r   r   s   &&&r   r   Xtest_cld_router_all_capped_exits_75_without_resume_at_when_unknown.<locals>.fake_execvpe  r   r   r   r   r  r5   r   r   r#  r   r   r   r   r6   r   r   r  r  r^  r  r   r:   r   r<   r  r   r-   rA   r   r   r   r  r  r   rd  )r!   r   r%   r0   r1   r   r   rq   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r  r  )r+   r(   r[   r   r   r   r   r   rM   r   r   r   rN   r   r   rR   r   r   rS   r   r   s   &&&                 @r   Btest_cld_router_all_capped_exits_75_without_resume_at_when_unknownr    s!   
 3B5 ""$?/r
 3
	
 
336GG%OR__ffosft$"B$b	
 	#
 (=?YZ))$$&*>>F
 K  ))9lCUG,-I  "H?999;%;%;;%<<22<88<2:: ll :l# e.'(  (    	#   	  	4   	4   	:   	  	h   	h   	l   	#   	 (      	  
 *hll*;l*****;l***;******h****h***l********r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   &  s0     0- 0-
0-#0- '0- 
	0-r   c                  a \        V R RRR/ RRRR.RR	R
^d//4       R+ F1  pV R,          R,          V,          R,          P                  RR7       K3  	  \        V RRRR^dR^
/RRRR^
R^d//R4       VP                  \        RR,R l4       \        P
                  ! \        P                  ! 4       \        P                  R7      pRoR V3R llpVP                  \        P                  RV4       VP                  RR.4      pVP                  4       p^qV8H  q'       g   \        P                  ! R-V	3R.Wh34      RR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR R!\        P                   ! V4      /,          p
R"R#V
/,          p\#        \        P$                  ! V4      4      hR;rRpSVJ q'       g   \        P                  ! R/V	3R0SV34      RR$\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR$R!\        P                   ! V4      /,          p
R"R#V
/,          p\#        \        P$                  ! V4      4      hR;rR%qP&                  qV9  q'       g   \        P                  ! R1V3R2W34      R&\        P                   ! V4      R!R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR'R#\        P                   ! V4      /,          pR(R)V/,          p\#        \        P$                  ! V4      4      hR;p;rR*qP(                  qV9   q'       g   \        P                  ! R3V3R4W34      R&\        P                   ! V4      R!R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR'R#\        P                   ! V4      /,          pR(R)V/,          p\#        \        P$                  ! V4      4      hR;p;rR# )5r   r^   r   r_   rb   rc   rd   re   rf   rg   rh   r   ri   rj   Trk   rl   rm   rn   ro   rp   rq   Nc                    R # r   r   rt   s   &r   r.   Utest_codex_router_all_quota_exhausted_stays_exit_one_not_all_capped.<locals>.<lambda>B  rw   r   rx   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Ytest_codex_router_all_quota_exhausted_stays_exit_one_not_all_capped.<locals>.__annotate__J  r   r   c                   < R oR# r   r   r   s   &&&r   r   Ytest_codex_router_all_quota_exhausted_stays_exit_one_not_all_capped.<locals>.fake_execvpeJ  r   r   r   r   r   r5   r   r   r   r   r   r  r   r   r   r   zquota-exhaustedr   r-   rA   r   r   r   r   rd  r   r   )r!   r   r%   r0   r1   r   r   rq   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r  r   )r+   r(   r[   r   r   r   r   r   r   rM   r   r   r   r   r   r   s   &&&            @r   Ctest_codex_router_all_quota_exhausted_stays_exit_one_not_all_cappedr  &  s   
 ,B6 5'"$?/		
  	7	7*	Dt	Kl	Zaajnao  Xt%7>RTVWHd$6<PRUV	
 	 (=?YZ))##%*>>F
 K  ))9lCUFO,I  "H>999;%;%;;% 4444444 444 444444444444444444444,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   Y  s0     ? ?
?#? '? 
	?r   c                ^  a \        V R RRR/ RRR. RRR	^dR
RR^
////4       V R,          pVR,          R,          R,          P                  RR7       \        V RRRR^
R^[RR//R4       \        P                  ! \        P
                  ! 4       4      p^ RIHpHpH	p VP                  R4      p\        W4      q'       Eg1   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRR \        P                   ! V	4      /,          p
\#        \        P$                  ! V
4      4      hR!p	V! VR,          4      p\        P&                  ! VR,          4      pV! WR0R"7      pVP(                  pRq! V	4      pR#pVV8H  pV'       g   \        P*                  ! R>V3R?VV34      RR$\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR$R\        P                   ! V4      R \        P                   ! V	4      R%\        P                   ! V4      R&\        P                   ! V4      /,          pR'R(V/,          p\#        \        P$                  ! V4      4      hR!;p;p	;p;ppR)oR* V3R+ llpVP-                  \        P.                  R,V4       VP1                  . R@O4      pVP3                  4       p^KpVV8H  q'       g   \        P*                  ! R>V3RAVV34      RR-\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR-R.\        P                   ! V4      /,          pR/R0V/,          p\#        \        P$                  ! V4      4      hR!;ppR)pSVJ q'       g   \        P*                  ! RBV3RCSV34      RR1\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MR1R.\        P                   ! V4      /,          pR/R0V/,          p\#        \        P$                  ! V4      4      hR!;pp\4        P6                  pVP8                  pV! V4      pRR)R2R3R4R5R6R7/pVV8H  pV'       EgJ   \        P*                  ! R>V3RDVV34      RR8\        P                  ! 4       9   g!   \        P                  ! \4        4      '       d   \        P                   ! \4        4      MR8R\        P                   ! V4      R.R9\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR9R0\        P                   ! V4      R:\        P                   ! V4      R;\        P                   ! V4      /,          pR<R=V/,          p\#        \        P$                  ! V4      4      hR!;p;p;p;ppR!# )Er   r^   r   r_   rb   zync2rd   rf   rg   rh   r  r  r   ri   rj   Trk   rl   rm   rn   ro   r   r  rp   )AllAccountsCappedErrorRoutingResolver
load_rules5assert %(py4)s
{%(py4)s = %(py0)s(%(py1)s, %(py2)s)
}r5   
isinstancer   r   r6   r  r7   N)known_slugszcapped(7d=9% left <= 10%)resolverr8   r   r   r?   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   Ptest_codex_router_explicit_override_refuses_capped_account.<locals>.__annotate__  r   r   c                   < R oR# r   r   r   s   &&&r   r   Ptest_codex_router_explicit_override_refuses_capped_account.<locals>.fake_execvpe  r   r   r   r   r   r   r   r   r  r  r^  r  r  r  r   r   r   r:   r   r<   rA   )zV%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s._describe_status
}(%(py4)s)
} == %(py9)s)r   r   r  r   r   r   r   r  )r!   r   r%   r1   r   r   routing_resolverr  r  r  r   r  rG   rH   rE   rI   rJ   rK   rL   load_health_describe_statusrF   r0   r   r   r   r   r  r  ) r+   r(   r[   r   r   r  r  r  r   rN   r   r   healthr  rM   rO   r   rP   r   rV   r   r   r   r   r   r   r   r   rR   r   rS   r   s    &&&                            @r   :test_codex_router_explicit_override_refuses_capped_accountr  Y  s   
 ,B7 ""$?/4* 5
	
 99D	J </66t6D$"B$b$l		
 	 )).*E*E*GHFTT&&w/Hh777777777:7777:7777777h7777h7777777 67777 67777777777t223E''/B(BCFu7)DH$$LWL$W-L1LL-1LLLLLL-1LLLLLLL8LLLL8LLL$LLLWLLL-LLL1LLLLLLLLLK  ))9lCABI  "H9?999;%;%;;%:: hll :l# e.'+	( # (   
 # (  
  
 4  
 4  
 :  
  
 h  
 h  
 l  
 #  
  (     
   r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     +8 +8t +8PT +8r   c                :   \        V R RRR/ RRR. RRR	^dR
RR^
/RR^
////4       V R,          pR$ F*  pVR,          V,          R,          P                  RR7       K,  	  \        V RRRR^
R^[/RRRR^
R^
//R4       \        P                  ! \        P
                  ! 4       4      pVP                  R4      pVRVR,          R,          R,          3qTV8H  qf'       g   \        P                  ! R%V3R&WE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reVP                  qfP                   p	RqV
8H  q'       g   \        P                  ! R%V3R'W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R \        P                  ! V	4      R!\        P                  ! V
4      /,          pR"R#V/,          p\        \        P                  ! V4      4      hR;p;p	;rVP                  qfP"                  p	R$qV
8H  q'       g   \        P                  ! R%V3R(W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R \        P                  ! V	4      R!\        P                  ! V
4      /,          pR"R#V/,          p\        \        P                  ! V4      4      hR;p;p	;rR# ))r   r^   r   r_   rb   r  rd   rf   rg   rh   r  r  re   r   ri   rj   Trk   rl   rm   rn   ro   rp   	zync2,royr5   r   r   r   r   Nr   r6   r7   r   r   r   r  re   rA   r   )zM%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s._last_route
}.slug
} == %(py7)sr   )r!   r   r%   r1   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   r   r   s   &             r   <test_codex_router_explicit_override_skips_capped_chain_entryr    s   ,B7 ""$?/dBZD":!
	
" 99D 	
	T	!L	0777E !$"B$b
 $"B$b	
 	  )).*E*E*GHF&&{3HeTJ%6%>%MNNNNNNNN8NNNNNN8NNNN8NNNNNNNNNNNN+""+e+e+++++"++++++6++++6++++++"+++e++++++++7##7'77'777777#777777677776777777#777'777777777r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r     s6     E E
E#E 'E 
	Er   c                  a \        V R RRR/ RRR. RRR	^dR
RR^
/RR^
////4       V R,          pR; F*  pVR,          V,          R,          P                  RR7       K,  	  \        V RRRR^
R^[RR/RRRR^
R^_RR//R4       \        P                  ! \        P
                  ! 4       4      p^ RIHp VP                  R4      p\        Wv4      q'       Eg1   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R!R"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"R#\        P                  ! V4      /,          p	\        \        P                   ! V	4      4      hR$pVP"                  p
R%qV8H  q'       g   \        P$                  ! R<V3R=W34      RR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R!\        P                  ! V
4      R&\        P                  ! V4      /,          pR'R(V/,          p\        \        P                   ! V4      4      hR$;p
;rR)oR* V3R+ llpVP'                  \        P(                  R,V4       VP+                  . R>O4      pVP-                  4       p^KpVV8H  q'       g   \        P$                  ! R<V
3R?VV34      RR-\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR-R.\        P                  ! V4      /,          pR/R&V/,          p\        \        P                   ! V4      4      hR$;p
pR)pSVJ q'       g   \        P$                  ! R@V
3RASV34      RR0\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MR0R.\        P                  ! V4      /,          pR/R&V/,          p\        \        P                   ! V4      4      hR$;p
p\.        P0                  p
VP2                  q! V4      pRR)R1R2R3R4R5R%/pVV8H  pV'       EgJ   \        P$                  ! R<V3RBVV34      RR6\        P                  ! 4       9   g!   \        P                  ! \.        4      '       d   \        P                  ! \.        4      MR6R!\        P                  ! V
4      R.R7\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR7R&\        P                  ! V4      R(\        P                  ! V4      R8\        P                  ! V4      /,          pR9R:V/,          p\        \        P                   ! V4      4      hR$;p
;p;p;ppR$# )Cr   r^   r   r_   rb   r  rd   rf   rg   rh   r  r  re   r   ri   rj   Trk   rl   rm   rn   ro   r   r  r  rp   r  r  r  r5   r  r   r   r6   r  r7   Nr  r   r   r   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   ftest_codex_router_explicit_override_all_capped_returns_all_accounts_capped_error.<locals>.__annotate__  r   r   c                   < R oR# r   r   r   s   &&&r   r   ftest_codex_router_explicit_override_all_capped_returns_all_accounts_capped_error.<locals>.fake_execvpe  r   r   r   r   r   r   r   r  r  r^  r  r  r   r   r:   r   r<   r  rA   )z1%(py2)s
{%(py2)s = %(py0)s.resume_at
} == %(py5)s)r   r   r  r   r   r   r   r  )r!   r   r%   r1   r   r   r  r  r   r  rG   rH   rE   rI   rJ   rK   rL   r  rF   r0   r   r   r   r   r  r  )r+   r(   r[   r   r   r   r  r   rN   r   rM   r   r   r   r   r   r   r   r   r   rR   r   r   rS   r   s   &&&                     @r   Ptest_codex_router_explicit_override_all_capped_returns_all_accounts_capped_errorr    s   
 ,B7 ""$?/dBZD":!
	
" 99D 	
	T	!L	0777E !$"B$b$l	 $"B$b$l		
 	!$ )).*E*E*GHF7&&{3Hh777777777:7777:7777777h7777h7777777 67777 677777777777!77!777777777777877778777777!777777777K  ))9lCEFI  "H9?999;%;%;;%:: hll :l# e.'+	( # (   
 # (  
  
 4  
 4  
 :  
  
 h  
 h  
 l  
 #  
  (     
   r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   	  s0     : :
:#: ': 
	:r   c                
  a \        V R RRR/ RRR. RRR	^dR
RR^
////4       V R,          pVR,          R,          R,          P                  RR7       \        V RRRR^dR^[RR//R4       \        P                  ! \        P
                  ! 4       4      p^ RIHp VP                  R4      p\        We4      qw'       Eg1   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR \        P                  ! V4      /,          p\        \        P                   ! V4      4      hR!pR"oR# V3R$ llp	VP#                  \        P$                  R%V	4       VP'                  . R8O4      p
VP)                  4       p^KqV8H  q'       g   \        P*                  ! R9V3R:W34      RR&\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR&R'\        P                  ! V4      /,          pR(R)V/,          p\        \        P                   ! V4      4      hR!;rR"pSVJ q'       g   \        P*                  ! R;V3R<SV34      RR*\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MR*R'\        P                  ! V4      /,          pR(R)V/,          p\        \        P                   ! V4      4      hR!;r\,        P.                  qP0                  pV! V4      pR+R"R,R-R.R/R0R1/pVV8H  pV'       EgJ   \        P*                  ! R9V3R=VV34      RR2\        P                  ! 4       9   g!   \        P                  ! \,        4      '       d   \        P                  ! \,        4      MR2R\        P                  ! V4      R'R3\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR3R)\        P                  ! V4      R4\        P                  ! V4      R5\        P                  ! V4      /,          pR6R7V/,          p\        \        P                   ! V4      4      hR!;p;p;p;ppR!# )>r   r^   r   r_   rb   rc   rd   rf   rg   rh   r  r  r   ri   rj   Trk   rl   rY  rn   ro   r   r  rp   r  r  r5   r  r   r   r6   r  r7   NFc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   ^test_codex_router_explicit_override_refuses_broken_account_when_over_cap.<locals>.__annotate__;	  r   r   c                   < R oR# r   r   r   s   &&&r   r   ^test_codex_router_explicit_override_refuses_broken_account_when_over_cap.<locals>.fake_execvpe;	  r   r   r   r   r   r   r   r   rm   r  r  r^  r  r  r  r   r   r   r:   r   r<   r   r   rc   r   rA   r   r   r   r  )r!   r   r%   r1   r   r   r  r  r   r  rG   rH   rE   rI   rJ   rK   rL   r0   r   r   r   rF   r   r  r  )r+   r(   r[   r   r   r  r   rN   r   r   r   r   r   rM   r   r   r   r   rR   r   r   rS   r   s   &&&                   @r   Htest_codex_router_explicit_override_refuses_broken_account_when_over_capr  	  s   
 ,B6 ""$?/$ 4
	
 99D	J,.55d5C("C$b$l		
 	 )).*E*E*GHF7&&v.Hh777777777:7777:7777777h7777h7777777 67777 67777777777K  ))9lC@AI  "H?999;%;%;;%:: ll :l# e.'+	( # (   
 # (  
  
 4  
 4  
 :  
  
 h  
 h  
 l  
 #  
  (     
   r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r   N	  &     .; .;
.;#.; 
.;r   c                   \        V R RRR/ RRR. RRR	^dR
RR^
////4       V R,          pVR,          R,          R,          P                  RR7       \        V RRRR^dR^P//R4       \        P                  ! \        P
                  ! 4       4      pVP                  R4      pVRVR,          R,          R,          3qTV8H  qf'       g   \        P                  ! R&V3R'WE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;re/ p	VP                  \        P
                  RR 4       VP                  \        P                   RR 4       VP#                  . R(O4      p
\$        P&                  qV8H  qf'       Eg   \        P                  ! R&V3R)W34      RR \        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR R!R"\        P                  ! 4       9   g!   \        P                  ! \$        4      '       d   \        P                  ! \$        4      MR"R#\        P                  ! V4      /,          pR$R%V/,          p\        \        P                  ! V4      4      hR;rkR# )*r   r^   r   r_   rb   rc   rd   rf   rg   rh   r  r  r   ri   rj   Trk   rl   rY  rn   ro   rp   r5   r   r   r   r   Nr   c                    R # r-   r   r   s   &&r   r.   \test_codex_router_explicit_override_resolves_broken_account_when_under_cap.<locals>.<lambda>w	  r   r   r   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   r  y	  rI  r   r   r6   r;   r7   r   r8   rA   r   r  r   r!   r   r%   r1   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r0   r   r   r;   r   r+   r(   r   r   r   r   rM   r   r   	exec_callr   rN   r   r   s   &&            r   Jtest_codex_router_explicit_override_resolves_broken_account_when_under_capr  N	  s    ,B6 ""$?/$ 4
	
 99D	J,.55d5C("C$b	
 	
 )).*E*E*GHF&&v.HfdZ&7&&@<&OPPPPPPPP8PPPPPP8PPPP8PPPPPPPPPPPP#%I###
 ))96st@AI':::::::::9::::::9::::9:::::::::::::::::::::::r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r   	  r  r   c                   \        V R RRR/ RRR. RRR	^d//4       V R
,          pVR,          R,          R,          P                  RR7       \        V RRRR^dR^d//R4       \        P                  ! \        P
                  ! 4       4      pVP                  R4      pVRVR,          R,          R,          3qTV8H  qf'       g   \        P                  ! R$V3R%WE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;re/ p	VP                  \        P                   RR 4       VP                  \        P
                  RR 4       VP#                  . R&O4      p
\$        P&                  qV8H  qf'       Eg   \        P                  ! R$V3R'W34      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MRRR \        P                  ! 4       9   g!   \        P                  ! \$        4      '       d   \        P                  ! \$        4      MR R!\        P                  ! V4      /,          pR"R#V/,          p\        \        P                  ! V4      4      hR;rkR# )(r   r^   r   r_   rb   rc   rd   rf   rg   rh   r   ri   rj   Trk   rl   rm   rn   ro   rp   r5   r   r   r   r   Nr   c                 .    \         P                  ! R 4      # rH  r  r  s   *,r   r.   [test_codex_router_explicit_override_resolves_quota_exhausted_without_caps.<locals>.<lambda>	  rI  r   r   c                    R # r-   r   r   s   &&r   r.   r  	  r   r   r   r6   r;   r7   r   r8   rA   r   r  r   r  r  s   &&            r   Itest_codex_router_explicit_override_resolves_quota_exhausted_without_capsr  	  s    ,B6 ""$?/		
 99D	J,.55d5C$"C$c	
 	
 )).*E*E*GHF&&v.HfdZ&7&&@<&OPPPPPPPP8PPPPPP8PPPP8PPPPPPPPPPPP#%I))96st### @AI':::::::::9::::::9::::9:::::::::::::::::::::::r   c               (    V ^8  d   QhRRRRRRRR/# rZ   r   )r   s   "r   r   r   	  s6     4B 4B
4B#4B '4B 
	4Br   c                  a \        V R RRR/ RRR. RRR	^d//4       V R
,          R,          R,          R,          pVP                  RR7       \        V RRRR^
R^//R4       VP                  \        RR2R l4       VP                  \        P
                  RR 4       \        P                  ! \        P
                  ! 4       \        P                  R7      pVP                  \        P                  RR 4       RoR V3R llpVP                  \        P                  RV4       VP                  R R!.4      pVP                  4       p\        P                  qV8H  q'       Eg   \        P                  ! R3V	3R4Wh34      R"R#\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR#R$R%\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR%R&\        P$                  ! V4      /,          p
R'R(V
/,          p\'        \        P(                  ! V4      4      hR;rRpSVJ q'       g   \        P                  ! R5V	3R6SV34      R"R)\        P                   ! 4       9   g   \        P"                  ! S4      '       d   \        P$                  ! S4      MR)R*\        P$                  ! V4      /,          pR+R,V/,          p\'        \        P(                  ! V4      4      hR;rVP*                  qP,                  q! 4       pR-pVV8H  pV'       g   \        P                  ! R3V3R7VV34      R"R.\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR.R$\        P$                  ! V	4      R&\        P$                  ! V4      R(\        P$                  ! V4      R/\        P$                  ! V4      /,          pR0R1V/,          p\'        \        P(                  ! V4      4      hR;p	;p;p;ppR# )8r   r   r   r_   rb   ra   rd   rf   rg   rh   r   r  r  Trk   rl   rm   rn   ro   r   rq   Nc                    R # r   r   rt   s   &r   r.   Ytest_claude_router_outside_container_returns_uncontainable_without_exec.<locals>.<lambda>	  rw   r   rC  c                    R # r  r   rE  s   &&r   r.   r  	  rF  r   rx   r  c                     R # r  r   r   r   r   r.   r  	  r  r   Fc               (    V ^8  d   QhRRRRRRRR/# rz   r   )r   s   "r   r   ]test_claude_router_outside_container_returns_uncontainable_without_exec.<locals>.__annotate__	  r   r   c                   < R oR# r   r   r   s   &&&r   r   ]test_claude_router_outside_container_returns_uncontainable_without_exec.<locals>.fake_execvpe	  r   r   r   r   r   r5   r   r6   r;   r7   r   r8   r   r   r   r   rJ  r   r   r   r?   r-   rA   r   r   r   r   )r!   r   r%   r0   r1   r   r   rq   r;   r   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r+   r(   r[   r  r   r   r   r   rN   rM   r   r   r   r   r   rO   r   rP   r   rV   r   s   &&&                 @r   Gtest_claude_router_outside_container_returns_uncontainable_without_execr  	  sp   
 3B5 ""$?/		
 @@CTTW\\_llKd#Hd$6<PRTU	
 	# (=?YZ446JLcd))$$&*>>F && K  ))9lCUFO,I  "H':::::::::9::::::9::::9:::::::::::::::::::::::;%;%;;%<<  B  B  B  $B  B  $B  B  B  B  B  B  $B  B  B  B  B  B  B8  B  B  B  B8  B  B  B<  B  B  B  B  B  B  B  B  B  $B  B  B  B  B  B  B  B  B  Br   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r   	  s&     #+ #+#+##+ 
#+r   c                  a aa \         P                  ! \         P                  ! 4       \         P                  R 7      pS R,          R,          R,          oSP	                  RR7       VP                  R\        S R,          4      4       VP                  VRVV 3R	 l4       VP                  \         P                  R
R 4       VP                  \         P                  RR 4       . oVP                  \         P                  RV3R l4       VP                  RR.4      p^ qCV8H  qU'       g   \        P                  ! R$V3R%W434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRR\        P                   ! V4      /,          pRRV/,          p\#        \        P$                  ! V4      4      hR;rTRR..pSV8H  qU'       g   \        P                  ! R$V3R%SV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                   ! S4      MRR\        P                   ! V4      /,          pRRV/,          p\#        \        P$                  ! V4      4      hR;rT\&        P(                  ! S R,          P+                  RR7      P-                  4       R&,          4      pVR,          p	RqV
8H  qD'       gy   \        P                  ! R$V3R'W34      R\        P                   ! V	4      R\        P                   ! V
4      /,          pR R!V/,          p\#        \        P$                  ! V4      4      hR;p	;rJVR",          p	R#qV
8H  qD'       gy   \        P                  ! R$V3R'W34      R\        P                   ! V	4      R\        P                   ! V
4      /,          pR R!V/,          p\#        \        P$                  ! V4      4      hR;p	;rJR# )(rx   ri   r  rj   Trk   r  r  r   c                    < SR S3# r  r   r  s   *,r   r.   Gtest_cdx_main_version_probe_execs_without_containment.<locals>.<lambda>	  r  r   r  c                     R # r  r   r   r   r   r.   r  	  r  r   rI  c                 .    \         P                  ! R 4      # )z0a --version probe must not open a remote sessionr  r  s   *,r   r.   r  	  s    ,^ _r   r   c                &   < SP                  V4      # r-   )rt  )r{   r|   r~   execeds   &&&r   r.   r  
  s    d 3r   r   	--versionr5   r   r   r   r   Nr   r  r   r   rV  z	info-onlyr   r7   r   r8   rX  r  rA   r   r  )r1   r   r   rq   r   rn  r#   r0   r;   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r  rr  rs  )r'   r(   r   r   r   rM   r   r   ry  r   rN   r   r   r  r  s   f&           @@r   5test_cdx_main_version_probe_execs_without_containmentr  	  s    ))##%*>>F j(61L@Lt$+S<O1O-PQ@
 66V&&_
 !F3 UK01I>999,--6------6-------6----6------------ZZ$77BBGBT__abdefF&>([([(((((>(((>((([((((((((- *F*F***** *** ***F********r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r   
  s0      >  > ># > ' > 
	 >r   c                  a a \         P                  ! \         P                  ! 4       \         P                  R 7      pS R,          R,          R,          oSP	                  RR7       VP                  R\        S R,          4      4       VP                  VRVV 3R	 l4       VP                  \         P                  R
R 4       VP                  \         P                  RR 4       VP                  \         P                  RR 4       VP                  . R!O4      p\        P                  qTV8H  qf'       Eg   \        P                  ! R"V3R#WE34      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRRR\        P                  ! 4       9   g!   \        P                   ! \        4      '       d   \        P"                  ! \        4      MRR\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR;reRqP(                  q! 4       qP*                  qV9   q'       g   \        P                  ! R$V3R%W34      R\        P"                  ! V	4      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V
4      R\        P"                  ! V4      R\        P"                  ! V4      /,          pRR V/,          p\%        \        P&                  ! V4      4      hR;p	;p;p
;rR# )&rx   ri   r  rj   Trk   r  r  r   c                    < SR S3# r  r   r  s   *,r   r.   Itest_cdx_main_exec_with_version_flag_is_still_contained.<locals>.<lambda>
  r  r   r  c                     R # r  r   r   r   r   r.   r  
  r  r   r  c                    R # r-   r   r  s   &&r   r.   r  "
  r   r   r   c                .    \         P                  ! R 4      # )z-an agent invocation must not exec uncontainedr  )r{   r|   r~   s   &&&r   r.   r  '
  s    ,[ \r   r5   r   r6   r;   r7   r   r8   Nzno containerized pathr   r   r[   r   r   r   r   r?   )r   r'  r  rA   r   r   r  )r1   r   r   rq   r   rn  r#   r0   r;   r   r   r   rE   rF   rG   rH   rI   rJ   rK   rL   r   r   )r'   r(   r[   r   r   rN   rM   r   r   r   r   r   r   r   r   rV   r  s   f&&             @r   7test_cdx_main_exec_with_version_flag_is_still_containedr!  
  s   
 ))##%*>>F j(61L@Lt$+S<O1O-PQ@
 66V##)
 \ 89I':::::::::9::::::9::::9:::::::::::::::::::::::"=&7&7=&7&9=&=&==&======"==="======f====f===&7===&9===&==========r   )r   rO  ))rc  rM  )rd  r  )re  r  )rM  r  zcodex-auto-review)rZ  r  ))rM  low)r  medium)r  high)rM  r  r  )r  r  ))r"  r"  )medr#  )r#  r#  )r$  r$  )rM  r  r  )NrM  r  )r  r  )r*  rQ  ry  r  )rR  z--model=z-c=z	--config=)r  r  r  r  r  r  )k
__future__r   builtinsrG   _pytest.assertion.rewrite	assertionrewriterE   ri  r   r   r  r   r  pathlibr   rf  r1   r;   health_clientr   r   r!   r%   fixturer+   rX   r   r   r   r   r   r   r  r  r   r$  r/  r9  r>  markparametrizerB  rF  rI  rL  rY  r]  rk  rv  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r{  r  r  r  r  r'  r+  r3  r8  r>  rM  rU  r_  rf  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r   r   r   <module>r0     su   "     	 	       7L  
D.\b'&T;27*7* C,&(Q  	k"	 !				X	XK FF" <	B	B)T ( & "RSO	 T
( GU#34 5  GU#34
 5
 "MNGU#34

 5 O

 "BC8 D8 	}	M"			

 -
,	-6U/VW5689	
 *	*-O,PQ2356	
$B2" !DEB FB
 !HIB JB

:
$ 	'(	-.	$%	*+	#$	
	
C
)_X+,P+f 
	  &QV'&QVh"CJ-.` '@At}5I_ 6 BI_X.bA"Q&Q*Q>*Z(V4n0f6YrS6r$$B$CL8+v0-f?D+8\EP:z.;b.;b4Bn#+L >r   