MCPcopy Create free account
hub / github.com/alibaba/open-code-review / execute

Function execute

plugins/open-code-review/opencode/open-code-review.ts:394–421  ·  view source on GitHub ↗
(args, context)

Source from the content-addressed store, hash-verified

392 "Returns structured line-level findings as JSON. Use preview=true to inspect scope without LLM usage.",
393 args: reviewArgs,
394 async execute(args, context) {
395 const input = args as ReviewInput
396 const { background, ...inputWithoutBackground } = input
397 const normalizedBackground = background?.trim()
398 const normalizedInput: ReviewInput = normalizedBackground
399 ? { ...inputWithoutBackground, background: normalizedBackground }
400 : inputWithoutBackground
401 const cwd = context.worktree || context.directory || worktree
402 const defaultOverallMs = 30 * 60 * 1000
403 const options: RunOptions = {
404 cwd,
405 signal: context.abort,
406 timeoutMs: input.overallTimeoutMinutes !== undefined
407 ? input.overallTimeoutMinutes * 60 * 1000
408 : defaultOverallMs,
409 }
410 const runReview = async (backgroundFile?: string): Promise<string> => {
411 const result = await runOcr(
412 buildReviewArgs(normalizedInput, cwd, backgroundFile),
413 options,
414 )
415 return formatReviewResult(result, normalizedInput.preview === true)
416 }
417 if (normalizedInput.background !== undefined) {
418 return await withTemporaryBackgroundFile(normalizedInput.background, runReview)
419 }
420 return await runReview()
421 },
422 }),
423 ocr_health: tool({
424 description:

Callers

nothing calls this directly

Calls 3

runOcrFunction · 0.85
runReviewFunction · 0.70

Tested by

no test coverage detected