(
session: CopilotSession,
serverName: string,
expectedStatus = "connected"
)
| 204 | }); |
| 205 | |
| 206 | async function waitForMcpServerStatus( |
| 207 | session: CopilotSession, |
| 208 | serverName: string, |
| 209 | expectedStatus = "connected" |
| 210 | ): Promise<void> { |
| 211 | let lastStatus = "<not listed>"; |
| 212 | await waitForCondition( |
| 213 | async () => { |
| 214 | const result = await session.rpc.mcp.list(); |
| 215 | const server = result.servers.find((entry) => entry.name === serverName); |
| 216 | lastStatus = server?.status ?? "<not listed>"; |
| 217 | return server?.status === expectedStatus; |
| 218 | }, |
| 219 | { |
| 220 | timeoutMs: 60_000, |
| 221 | intervalMs: 200, |
| 222 | timeoutMessage: `${serverName} did not reach ${expectedStatus}; last status was ${lastStatus}`, |
| 223 | } |
| 224 | ); |
| 225 | } |
| 226 | |
| 227 | async function callWhoami( |
| 228 | session: CopilotSession, |
no test coverage detected
searching dependent graphs…