Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
Commit79a52c8

fix(mcp): wire AI review + triage into gluecron_create_pr

fix(mcp): wire AI review + triage into gluecron_create_pr

PRs opened through the web /pulls/new route trigger triggerAiReview()
and triggerPrTriage(); the MCP gluecron_create_pr tool -- the actual
surface an external AI platform (or the agent-journey certification)
uses -- never called either. It fired webhooks, activity-feed writes,
and notifications, but silently skipped both AI features.

Confirmed live: scripts/agent-journey.ts's step 7 ("AI review fired")
WARNed on every run with ANTHROPIC_API_KEY verified present in prod --
this MCP/web parity gap was the actual cause, not a missing key.

Mirrors the web route's calls exactly, gated the same way
(isAiReviewEnabled() / automation settings / per-PR idempotency all
already live inside triggerAiReview and triggerPrTriage themselves).
ccantynz-alt committed on July 20, 2026Parent: 649bc9d
1 file changed+24179a52c8ff828b32d9eb8349df41a2e0f97a6f948
1 changed file+24−1
Modifiedsrc/lib/mcp-tools.ts+24−1View fileUnifiedSplit
4343 evaluateProtection,
4444} from "./branch-protection";
4545import { mergeWithAutoResolve } from "./merge-resolver";
46import { isAiReviewEnabled } from "./ai-review";
46import { isAiReviewEnabled, triggerAiReview } from "./ai-review";
47import { triggerPrTriage } from "./pr-triage";
4748import { requiredOwnersApproved } from "./codeowners";
4849import {
4950 computePrRiskForPullRequest,
885886 });
886887 void fireWebhooks(gate.repoId, "pr", { action: "opened", number: pr.number, baseBranch, headBranch });
887888
889 // PRs opened through the MCP write surface (exactly how an external AI
890 // platform or the agent-journey certification drives this) never
891 // triggered AI review or triage -- both were wired into the web
892 // /pulls/new route only. Mirror that here so MCP-created PRs get the
893 // same treatment as web-created ones.
894 if (isAiReviewEnabled()) {
895 triggerAiReview(owner, repo, pr.id, title, body || "", baseBranch, headBranch).catch(
896 (err) => console.error("[mcp] triggerAiReview failed:", err)
897 );
898 }
899 triggerPrTriage({
900 ownerName: owner,
901 repoName: repo,
902 repositoryId: gate.repoId,
903 prId: pr.id,
904 prAuthorId: gate.userId,
905 title,
906 body: body || "",
907 baseBranch,
908 headBranch,
909 }).catch((err) => console.error("[mcp] triggerPrTriage failed:", err));
910
888911 if (gate.ownerId !== gate.userId) {
889912 notify(gate.ownerId, {
890913 kind: "pr_opened",
891914