MCPcopy
hub / github.com/cursor/cookbook / cancelCurrentRun

Method cancelCurrentRun

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

Source from the content-addressed store, hash-verified

145 }
146
147 async cancelCurrentRun(): Promise<CancelRunResult> {
148 const run = this.currentRun
149
150 if (!run) {
151 return { cancelled: false, reason: "No active run to cancel." }
152 }
153
154 if (!run.supports("cancel")) {
155 return {
156 cancelled: false,
157 reason: run.unsupportedReason("cancel") ?? "This run cannot be cancelled.",
158 }
159 }
160
161 await run.cancel()
162 return { cancelled: true }
163 }
164
165 async sendPrompt({ prompt, onEvent }: SendPromptOptions) {
166 await this.ensureAgentFresh()

Callers 1

cancelActiveRunFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected