Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/api/projects/[id]/github/apply-fix/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import { getOrMintInstallationToken } from "@/lib/github/installations";
import { applyFix } from "@/lib/github/apply-fix";

export const runtime = "nodejs";
export const maxDuration = 120; // Claude calls can take a while.
// Agentic mode runs up to 20 Claude tool turns; each turn ~5s. Worst
// case is ~2 minutes, but realistic fixes finish in 20-40s.
export const maxDuration = 300;

const bodySchema = z.object({
owner: z.string().min(1),
repo: z.string().min(1),
installation_id: z.number().int().positive(),
audit_id: z.string().uuid(),
finding_key: z.string().min(1),
/** Optional starting hint for monorepos (e.g. "apps/web"). */
root_path: z.string().max(500).optional(),
});

export async function POST(
Expand Down Expand Up @@ -164,6 +168,7 @@ export async function POST(
evidence: (finding as { evidence: unknown }).evidence,
},
targetUrl: (audit as { target_url: string }).target_url,
rootPath: body.root_path,
});

// A "noop" result still consumed the credit because we did call
Expand Down
Loading
Loading