@@ -101,7 +101,7 @@ const mocks = vi.hoisted(() => ({
101101 collectDiskSpaceHealthFindings : vi . fn ( ( ) : readonly HealthFinding [ ] => [ ] ) ,
102102 collectHeartbeatTemplateHealthFindings : vi . fn ( async ( ) => [ ] as unknown [ ] ) ,
103103 maybeRepairHeartbeatTemplate : vi . fn ( ) . mockResolvedValue ( undefined ) ,
104- collectWhatsappResponsivenessHealthFindings : vi . fn ( ( ) => [ ] ) ,
104+ collectWhatsappResponsivenessHealthFindings : vi . fn ( ( ) : readonly HealthFinding [ ] => [ ] ) ,
105105 noteWhatsappResponsivenessHealth : vi . fn ( ) . mockResolvedValue ( undefined ) ,
106106 collectDevicePairingHealthFindings : vi . fn ( async ( ) => [ ] ) ,
107107 scanConfiguredChannelPluginBlockers : vi . fn (
@@ -1755,7 +1755,6 @@ describe("doctor health contributions", () => {
17551755 requirement : "local-tui-event-loop-pressure" ,
17561756 } ,
17571757 ] ) ;
1758- mocks . callGateway . mockResolvedValueOnce ( status ) ;
17591758
17601759 await expect (
17611760 runDoctorLintChecks ( ctx , { checks, onlyIds : [ "core/doctor/whatsapp-responsiveness" ] } ) ,
@@ -1770,6 +1769,7 @@ describe("doctor health contributions", () => {
17701769 params : { includeChannelSummary : false } ,
17711770 timeoutMs : 3000 ,
17721771 config : ctx . cfg ,
1772+ deviceIdentity : null ,
17731773 } ) ;
17741774 expect ( mocks . collectWhatsappResponsivenessHealthFindings ) . toHaveBeenCalledWith ( {
17751775 cfg : ctx . cfg ,
@@ -1799,6 +1799,36 @@ describe("doctor health contributions", () => {
17991799 } ) ;
18001800 } ) ;
18011801
1802+ it ( "skips WhatsApp responsiveness Gateway status probes for exec SecretRefs without allow-exec" , async ( ) => {
1803+ const contributionChecks = await resolveDoctorContributionHealthChecks ( ) ;
1804+ const whatsappCheck = contributionChecks . find (
1805+ ( check ) => check . id === "core/doctor/whatsapp-responsiveness" ,
1806+ ) ;
1807+ expect ( whatsappCheck ) . toBeDefined ( ) ;
1808+ mocks . gatewaySecretInputPathCanWin . mockReturnValue ( true ) ;
1809+ mocks . readGatewaySecretInputValue . mockReturnValue ( "exec-token" ) ;
1810+
1811+ const ctx = {
1812+ cfg : { channels : { whatsapp : { enabled : true } } } ,
1813+ mode : "lint" ,
1814+ runtime : { log : vi . fn ( ) , error : vi . fn ( ) , exit : vi . fn ( ) } ,
1815+ } as const ;
1816+ const checks = [ whatsappCheck ! ] ;
1817+
1818+ await expect (
1819+ runDoctorLintChecks ( ctx , { checks, onlyIds : [ "core/doctor/whatsapp-responsiveness" ] } ) ,
1820+ ) . resolves . toMatchObject ( {
1821+ checksRun : 1 ,
1822+ checksSkipped : 0 ,
1823+ findings : [ ] ,
1824+ } ) ;
1825+ expect ( mocks . callGateway ) . not . toHaveBeenCalled ( ) ;
1826+ expect ( mocks . collectWhatsappResponsivenessHealthFindings ) . toHaveBeenCalledWith ( {
1827+ cfg : ctx . cfg ,
1828+ status : undefined ,
1829+ } ) ;
1830+ } ) ;
1831+
18021832 it ( "keeps device pairing opt-in for default lint selection" , async ( ) => {
18031833 const contributionChecks = await resolveDoctorContributionHealthChecks ( ) ;
18041834 const devicePairingCheck = contributionChecks . find (
0 commit comments