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

Function rejectChecks

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

* Reject all pending suggestions for a PR.

(prUrl: string)

Source from the content-addressed store, hash-verified

240 * Reject all pending suggestions for a PR.
241 */
242async function rejectChecks(prUrl: string): Promise<void> {
243 const response = await get<ChecksStatusResponse>(
244 `api/checks/status?pullRequestUrl=${encodeURIComponent(prUrl)}`,
245 );
246 const { checks } = response.data;
247
248 const pending = checks.filter(
249 (c) => c.suggestionStatus === "pending" && c.commitMessage,
250 );
251
252 if (pending.length === 0) {
253 console.log(chalk.dim("No pending suggestions to reject."));
254 return;
255 }
256
257 console.log(
258 chalk.bold(`Rejecting ${pending.length} pending suggestion(s)...\n`),
259 );
260
261 for (const check of pending) {
262 try {
263 await post(`agents/${check.sessionId}/reject`);
264 console.log(chalk.red(`\u2716 Rejected: ${check.name}`));
265 } catch (err) {
266 const msg = err instanceof Error ? err.message : String(err);
267 console.error(
268 chalk.red(`\u2716 Failed to reject ${check.name}: ${msg}`),
269 );
270 }
271 }
272}
273
274/**
275 * Main entry point for `cn checks` command.

Callers 1

checksFunction · 0.85

Calls 3

postFunction · 0.85
errorMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected