MCPcopy Index your code
hub / github.com/cursor/cookbook / replaceAgent

Method replaceAgent

sdk/coding-agent-cli/src/agent.ts:230–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

228 }
229
230 private async replaceAgent() {
231 const previousAgent = this.agent
232 this.agent = this.createAgent()
233 this.agentKey = this.currentAgentKey()
234 await previousAgent[Symbol.asyncDispose]()
235 }
236
237 private currentAgentKey() {
238 const modelKey =

Callers 3

resetMethod · 0.95
setExecutionModeMethod · 0.95
ensureAgentFreshMethod · 0.95

Calls 2

createAgentMethod · 0.95
currentAgentKeyMethod · 0.95

Tested by

no test coverage detected