@@ -169,6 +169,9 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
169
169
List < AgentViewModel > agents = [ ] ;
170
170
foreach ( var agent in rpcModel . Agents )
171
171
{
172
+ if ( ! Uuid . TryFrom ( agent . Id . Span , out var uuid ) )
173
+ continue ;
174
+
172
175
// Find the FQDN with the least amount of dots and split it into
173
176
// prefix and suffix.
174
177
var fqdn = agent . Fqdn
@@ -195,7 +198,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
195
198
196
199
agents . Add ( _agentViewModelFactory . Create (
197
200
this ,
198
- agent . ParseId ( ) ,
201
+ uuid ,
199
202
fqdnPrefix ,
200
203
fqdnSuffix ,
201
204
connectionStatus ,
@@ -207,18 +210,23 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
207
210
// dummy agent row.
208
211
foreach ( var workspace in rpcModel . Workspaces . Where ( w =>
209
212
w . Status == Workspace . Types . Status . Stopped && ! workspacesWithAgents . Contains ( w . Id ) ) )
213
+ {
214
+ if ( ! Uuid . TryFrom ( workspace . Id . Span , out var uuid ) )
215
+ continue ;
216
+
210
217
agents . Add ( _agentViewModelFactory . Create (
211
218
this ,
212
219
// Workspace ID is fine as a stand-in here, it shouldn't
213
220
// conflict with any agent IDs.
214
- workspace . ParseId ( ) ,
221
+ uuid ,
215
222
// We assume that it's a single-agent workspace.
216
223
workspace . Name ,
217
224
// TODO: this needs to get the suffix from the server
218
225
".coder" ,
219
226
AgentConnectionStatus . Gray ,
220
227
credentialModel . CoderUrl ,
221
228
workspace . Name ) ) ;
229
+ }
222
230
223
231
// Sort by status green, red, gray, then by hostname.
224
232
ModelUpdate . ApplyLists ( Agents , agents , ( a , b ) =>
0 commit comments