From 9d62894745eaed8899e66583540d24e42b4e8115 Mon Sep 17 00:00:00 2001 From: Tejas Date: Fri, 5 Jun 2026 20:01:59 +0530 Subject: [PATCH 1/2] fix(analyze): aggregate proof URLs across chunks and increase default timeouts --- src/analyze.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/analyze.ts b/src/analyze.ts index 7c60e6d..0d86480 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -273,6 +273,8 @@ export async function analyze( }, ): Promise { const llm = opts.llm; + const primaryTimeout = llm.requestTimeoutMs ?? 180000; + const compressedTimeout = Math.max(Math.round(primaryTimeout * 0.65), 45000); const allItems = profiles.flatMap((p) => p.items); const username = profiles[0]?.username ?? "(unknown)"; @@ -307,9 +309,7 @@ export async function analyze( chunks.length, ); const totalChunks = chunks.length; - // Default to running every chunk concurrently (capped to avoid API rate - // limits). Chunk analysis is independent, so serial rounds were the main - // source of wall-clock latency. + const maxConcurrency = Math.max( 1, Math.min(opts.chunkConcurrency ?? 8, totalChunks || 1), @@ -373,7 +373,7 @@ ${SCHEMA_HINT}`; maxTokens: 2200, json: true, }), - llm.requestTimeoutMs ?? 70000, + primaryTimeout, `chunk ${currentChunk}/${totalChunks}`, ); } catch { @@ -409,7 +409,7 @@ ${SCHEMA_HINT}`; maxTokens: 1100, json: true, }), - llm.requestTimeoutMs ? Math.round(llm.requestTimeoutMs * 0.6) : 45000, + compressedTimeout, `compressed chunk ${currentChunk}/${totalChunks}`, ); } finally { @@ -486,7 +486,10 @@ ${SCHEMA_HINT}`; } } - for (const url of parsed.identity?.publicProofUrls ?? []) { + const allProofUrls = parsedChunks.flatMap( + (c) => c.identity?.publicProofUrls ?? [], + ); + for (const url of allProofUrls) { if (typeof url === "string" && /^https?:\/\//i.test(url)) { knownProofUrls.add(url.trim()); } From 6beb2446858efda565b8e0ff95afcbe46e58d8fa Mon Sep 17 00:00:00 2001 From: Tejas Date: Sat, 6 Jun 2026 03:34:55 +0530 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/analyze.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyze.ts b/src/analyze.ts index 0d86480..7e0edc6 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -274,7 +274,7 @@ export async function analyze( ): Promise { const llm = opts.llm; const primaryTimeout = llm.requestTimeoutMs ?? 180000; - const compressedTimeout = Math.max(Math.round(primaryTimeout * 0.65), 45000); + const compressedTimeout = Math.max(Math.round(primaryTimeout * (2 / 3)), 45000); const allItems = profiles.flatMap((p) => p.items); const username = profiles[0]?.username ?? "(unknown)";