@@ -134,7 +134,7 @@ describe("doctor command", () => {
134134 terminalNoteMock . mockClear ( ) ;
135135 } ) ;
136136
137- it ( "warns when the state directory is missing" , async ( ) => {
137+ it ( "reports when the state directory was missing at doctor start " , async ( ) => {
138138 mockDoctorConfigSnapshot ( ) ;
139139
140140 const missingDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "openclaw-missing-state-" ) ) ;
@@ -146,8 +146,10 @@ describe("doctor command", () => {
146146 } ) ;
147147 } ) ;
148148
149- const stateNote = requireTerminalNote ( { messageIncludes : "state directory missing" } ) ;
150- expect ( String ( stateNote [ 0 ] ) ) . toContain ( "CRITICAL" ) ;
149+ requireTerminalNote ( {
150+ title : "State integrity" ,
151+ messageIncludes : "State directory was missing at doctor start" ,
152+ } ) ;
151153 } ) ;
152154
153155 it ( "routes browser readiness through health contributions and degrades gracefully when browser facade is unavailable" , async ( ) => {
@@ -873,7 +875,7 @@ describe("doctor command", () => {
873875 expect ( skippedGatewayHealth ) . toBe ( false ) ;
874876 } ) ;
875877
876- it ( "keeps gateway health probes when env password wins over an exec password ref " , async ( ) => {
878+ it ( "skips password-mode probes when configured password is an exec SecretRef " , async ( ) => {
877879 mockDoctorConfigSnapshot ( {
878880 config : {
879881 gateway : {
@@ -901,6 +903,7 @@ describe("doctor command", () => {
901903 const previousPassword = process . env . OPENCLAW_GATEWAY_PASSWORD ;
902904 process . env . OPENCLAW_GATEWAY_PASSWORD = "fallback-password" ;
903905 try {
906+ callGateway . mockClear ( ) ;
904907 await doctorCommand ( createDoctorRuntime ( ) , {
905908 nonInteractive : true ,
906909 workspaceSuggestions : false ,
@@ -913,15 +916,12 @@ describe("doctor command", () => {
913916 }
914917 }
915918
916- const skippedGatewayHealth = terminalNoteMock . mock . calls . some ( ( [ message , title ] ) => {
917- return (
918- title === "Gateway" &&
919- String ( message ) . includes (
920- "Gateway health probes skipped because gateway credentials use an exec SecretRef." ,
921- )
922- ) ;
919+ expect ( callGateway ) . not . toHaveBeenCalled ( ) ;
920+ requireTerminalNote ( {
921+ title : "Gateway" ,
922+ messageIncludes :
923+ "Gateway health probes skipped because gateway credentials use an exec SecretRef." ,
923924 } ) ;
924- expect ( skippedGatewayHealth ) . toBe ( false ) ;
925925 } ) ;
926926
927927 it ( "keeps remote gateway health probes when env token wins over an exec password ref" , async ( ) => {
0 commit comments