()
| 87 | } |
| 88 | |
| 89 | async ensureValidToken() { |
| 90 | if (!this.copilotToken || !this.tokenExpiry || Date.now() > this.tokenExpiry) { |
| 91 | const success = await this.refreshCopilotToken(); |
| 92 | if (!success) { |
| 93 | throw new Error('Failed to obtain valid Copilot token'); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | async getModels() { |
| 99 | await this.ensureValidToken(); |
no test coverage detected