@@ -18,7 +18,7 @@ import {
1818 getEventValue ,
1919 formatEventLabel ,
2020 formatMetadataError ,
21- } from "../agentMetadataHelper" ;
21+ } from "../api/ agentMetadataHelper" ;
2222import { createWorkspaceIdentifier , extractAgents } from "../api/api-helper" ;
2323import { CoderApi } from "../api/coderApi" ;
2424import { needToken } from "../api/utils" ;
@@ -543,7 +543,7 @@ export class Remote {
543543 }
544544
545545 // Watch the workspace for changes.
546- const monitor = new WorkspaceMonitor (
546+ const monitor = await WorkspaceMonitor . create (
547547 workspace ,
548548 workspaceClient ,
549549 this . logger ,
@@ -556,7 +556,7 @@ export class Remote {
556556 ) ;
557557
558558 // Watch coder inbox for messages
559- const inbox = new Inbox ( workspace , workspaceClient , this . logger ) ;
559+ const inbox = await Inbox . create ( workspace , workspaceClient , this . logger ) ;
560560 disposables . push ( inbox ) ;
561561
562562 // Wait for the agent to connect.
@@ -668,7 +668,7 @@ export class Remote {
668668 agent . name ,
669669 ) ;
670670 } ) ,
671- ...this . createAgentMetadataStatusBar ( agent , workspaceClient ) ,
671+ ...( await this . createAgentMetadataStatusBar ( agent , workspaceClient ) ) ,
672672 ) ;
673673 } catch ( ex ) {
674674 // Whatever error happens, make sure we clean up the disposables in case of failure
@@ -858,8 +858,7 @@ export class Remote {
858858 "UserKnownHostsFile" ,
859859 "StrictHostKeyChecking" ,
860860 ] ;
861- for ( let i = 0 ; i < keysToMatch . length ; i ++ ) {
862- const key = keysToMatch [ i ] ;
861+ for ( const key of keysToMatch ) {
863862 if ( computedProperties [ key ] === sshValues [ key ] ) {
864863 continue ;
865864 }
@@ -1005,7 +1004,7 @@ export class Remote {
10051004 // this to find the SSH process that is powering this connection. That SSH
10061005 // process will be logging network information periodically to a file.
10071006 const text = await fs . readFile ( logPath , "utf8" ) ;
1008- const port = await findPort ( text ) ;
1007+ const port = findPort ( text ) ;
10091008 if ( ! port ) {
10101009 return ;
10111010 }
@@ -1064,16 +1063,16 @@ export class Remote {
10641063 * The status bar item updates dynamically based on changes to the agent's metadata,
10651064 * and hides itself if no metadata is available or an error occurs.
10661065 */
1067- private createAgentMetadataStatusBar (
1066+ private async createAgentMetadataStatusBar (
10681067 agent : WorkspaceAgent ,
10691068 client : CoderApi ,
1070- ) : vscode . Disposable [ ] {
1069+ ) : Promise < vscode . Disposable [ ] > {
10711070 const statusBarItem = vscode . window . createStatusBarItem (
10721071 "agentMetadata" ,
10731072 vscode . StatusBarAlignment . Left ,
10741073 ) ;
10751074
1076- const agentWatcher = createAgentMetadataWatcher ( agent . id , client ) ;
1075+ const agentWatcher = await createAgentMetadataWatcher ( agent . id , client ) ;
10771076
10781077 const onChangeDisposable = agentWatcher . onChange ( ( ) => {
10791078 if ( agentWatcher . error ) {
0 commit comments