MCPcopy
hub / github.com/continuedev/continue / acceptChecks

Function acceptChecks

extensions/cli/src/commands/checks.ts:207–237  ·  view source on GitHub ↗

* Accept all pending suggestions for a PR.

(prUrl: string)

Source from the content-addressed store, hash-verified

205 * Accept all pending suggestions for a PR.
206 */
207async function acceptChecks(prUrl: string): Promise<void> {
208 const response = await get<ChecksStatusResponse>(
209 `api/checks/status?pullRequestUrl=${encodeURIComponent(prUrl)}`,
210 );
211 const { checks } = response.data;
212
213 const pending = checks.filter(
214 (c) => c.suggestionStatus === "pending" && c.commitMessage,
215 );
216
217 if (pending.length === 0) {
218 console.log(chalk.dim("No pending suggestions to accept."));
219 return;
220 }
221
222 console.log(
223 chalk.bold(`Accepting ${pending.length} pending suggestion(s)...\n`),
224 );
225
226 for (const check of pending) {
227 try {
228 await post(`agents/${check.sessionId}/accept`);
229 console.log(chalk.green(`\u2714 Accepted: ${check.name}`));
230 } catch (err) {
231 const msg = err instanceof Error ? err.message : String(err);
232 console.error(
233 chalk.red(`\u2716 Failed to accept ${check.name}: ${msg}`),
234 );
235 }
236 }
237}
238
239/**
240 * Reject all pending suggestions for a PR.

Callers 1

checksFunction · 0.85

Calls 3

postFunction · 0.85
errorMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected