@@ -836,7 +836,7 @@ describe("gatherDaemonStatus", () => {
836836 expect ( ( status . service . runtime as { detail ?: string } ) . detail ) . toBe ( "19001" ) ;
837837 } ) ;
838838
839- it ( "bounds all service-manager reads and still emits JSON after they time out" , async ( ) => {
839+ it ( "renders Gateway-specific recovery in text and JSON after service reads time out" , async ( ) => {
840840 serviceIsLoaded . mockImplementationOnce ( async ( args ?: { timeoutMs ?: number } ) => {
841841 if ( args ?. timeoutMs === undefined ) {
842842 return await new Promise < boolean > ( ( ) => { } ) ;
@@ -847,7 +847,7 @@ describe("gatherDaemonStatus", () => {
847847 if ( opts ?. timeoutMs === undefined ) {
848848 return await new Promise < { status : string } > ( ( ) => { } ) ;
849849 }
850- throw new Error ( "systemctl show timed out " ) ;
850+ throw new Error ( "錯誤: 系統找不到指定的檔案。 " ) ;
851851 } ) ;
852852
853853 const status = await gatherStatus ( {
@@ -868,7 +868,11 @@ describe("gatherDaemonStatus", () => {
868868 expect ( status . service . loaded ) . toBeNull ( ) ;
869869 expect ( status . service . runtime ) . toEqual ( {
870870 status : "unknown" ,
871- detail : "Error: systemctl show timed out" ,
871+ detail : "service runtime inspection failed; retry with openclaw gateway status --deep" ,
872+ inspectionFailure : {
873+ code : "service-runtime-inspection-failed" ,
874+ detail : "錯誤: 系統找不到指定的檔案。" ,
875+ } ,
872876 } ) ;
873877
874878 const writeJson = vi . spyOn ( defaultRuntime , "writeJson" ) . mockImplementation ( ( ) => { } ) ;
@@ -888,7 +892,11 @@ describe("gatherDaemonStatus", () => {
888892 } ,
889893 runtime : {
890894 status : "unknown" ,
891- detail : "Error: systemctl show timed out" ,
895+ detail : "service runtime inspection failed; retry with openclaw gateway status --deep" ,
896+ inspectionFailure : {
897+ code : "service-runtime-inspection-failed" ,
898+ detail : "錯誤: 系統找不到指定的檔案。" ,
899+ } ,
892900 } ,
893901 } ,
894902 } ) ;
@@ -903,7 +911,10 @@ describe("gatherDaemonStatus", () => {
903911 const output = log . mock . calls . flat ( ) . join ( "\n" ) ;
904912 expect ( output ) . toContain ( "Service: LaunchAgent (unknown)" ) ;
905913 expect ( output ) . not . toContain ( "Service: LaunchAgent (not loaded)" ) ;
906- expect ( output ) . toContain ( "Runtime: unknown (Error: systemctl show timed out)" ) ;
914+ expect ( output ) . toContain (
915+ "Runtime: unknown (service runtime inspection failed; retry with openclaw gateway status --deep)" ,
916+ ) ;
917+ expect ( output ) . not . toContain ( "系統找不到指定的檔案" ) ;
907918 } finally {
908919 log . mockRestore ( ) ;
909920 error . mockRestore ( ) ;
0 commit comments