pr comments

This commit is contained in:
Aadesh Kheria 2026-04-13 09:48:48 -07:00
parent c514efd755
commit b0e33410ba
2 changed files with 6 additions and 3 deletions

View File

@ -135,7 +135,7 @@ export const POST = createSmartRouteHandler({
const innerToolCallsJson = JSON.stringify(contentBlocks.filter(b => b.type === "tool-call"));
runAsynchronously(logMcpCall({
const logPromise = logMcpCall({
correlationId,
toolName: body.mcpCallMetadata.toolName,
reason: body.mcpCallMetadata.reason,
@ -148,9 +148,11 @@ export const POST = createSmartRouteHandler({
durationMs: BigInt(Date.now() - startedAt),
modelId: String(model.modelId),
errorMessage: undefined,
}));
});
runAsynchronously(logPromise);
runAsynchronously(reviewMcpCall({
logPromise,
correlationId,
question,
reason: body.mcpCallMetadata.reason,

View File

@ -39,6 +39,7 @@ Set needsHumanReview=true if: score < 50, any critical flag, or you are uncertai
const REVIEW_MODEL_ID = "anthropic/claude-haiku-4.5";
export async function reviewMcpCall(entry: {
logPromise: Promise<void>;
correlationId: string;
question: string;
reason: string;
@ -75,7 +76,7 @@ export async function reviewMcpCall(entry: {
try {
// Wait for the log row to be written first
await new Promise(r => setTimeout(r, 3000));
await entry.logPromise;
devinClient = await createMCPClient({
transport: {