()
| 193 | } |
| 194 | |
| 195 | private createAgent() { |
| 196 | const options = { |
| 197 | apiKey: this.apiKey, |
| 198 | name: "Lightweight coding agent", |
| 199 | model: this.modelSelection, |
| 200 | } |
| 201 | |
| 202 | if (this.mode === "cloud") { |
| 203 | const repository = detectCloudRepository(this.cwd) |
| 204 | this.cloudRepository = repository |
| 205 | |
| 206 | return Agent.create({ |
| 207 | ...options, |
| 208 | cloud: { |
| 209 | repos: [repository], |
| 210 | }, |
| 211 | }) |
| 212 | } |
| 213 | |
| 214 | this.cloudRepository = null |
| 215 | |
| 216 | return Agent.create({ |
| 217 | ...options, |
| 218 | local: { |
| 219 | cwd: this.cwd, |
| 220 | }, |
| 221 | }) |
| 222 | } |
| 223 | |
| 224 | private async ensureAgentFresh() { |
| 225 | if (this.agentKey !== this.currentAgentKey()) { |
no test coverage detected