From c6c8caac757e4f40431f628ff3b8621270255c47 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 13:20:44 +0000 Subject: [PATCH 1/9] fix(engine): let a mention in the conversation settle an inline finding A conversation comment could only settle findings listed in a review body. When someone answered an inline finding there instead of in its thread ("@appwrite read the comments - its resolved"), Hansi agreed but had no finding to mark, so the finding, summary and review stayed as they were. A mentioned conversation comment now names inline findings too, and the threads of the ones it settles are resolved. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F3M7ttH9uWbxTyZiza9BAC Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com> --- packages/engine/src/chat-finding.test.ts | 16 ++++- packages/engine/src/chat-finding.ts | 21 ++++++- packages/engine/src/chat-job.test.ts | 76 ++++++++++++++++++++++++ packages/engine/src/chat-job.ts | 23 +++++-- 4 files changed, 127 insertions(+), 9 deletions(-) diff --git a/packages/engine/src/chat-finding.test.ts b/packages/engine/src/chat-finding.test.ts index d93db9b..9100287 100644 --- a/packages/engine/src/chat-finding.test.ts +++ b/packages/engine/src/chat-finding.test.ts @@ -1,6 +1,12 @@ import { expect, test } from 'bun:test'; import type { FindingRecord } from './results'; -import { chatFinding, chatReplyFields, findingsNamedIn, openBodyFindings } from './chat-finding'; +import { + chatFinding, + chatReplyFields, + findingsNamedIn, + openBodyFindings, + openFindings +} from './chat-finding'; const record = (finding: Partial & { id: string }): FindingRecord => ({ reviewId: 'review-1', @@ -57,7 +63,8 @@ const rateWindow = { title: 'Keep range-based rate windows above 2m', path: 'dashboards/Edge/inbound-email.json', startLine: 394, - endLine: 394 + endLine: 394, + providerCommentId: null }; test('open findings listed in the review body are the posted ones without a thread', () => { @@ -72,6 +79,11 @@ test('open findings listed in the review body are the posted ones without a thre // The inline finding has a thread and is answered there. expect(openBodyFindings([inline, body, dismissed]).map((f) => f.id)).toEqual(['finding-body']); expect(openBodyFindings([inline])).toEqual([]); + // A mention can answer either kind, so both are open; the inline one keeps its thread. + expect(openFindings([inline, body, dismissed]).map((f) => [f.id, f.providerCommentId])).toEqual([ + ['finding-body', null], + ['finding-1', '4204630028'] + ]); }); test('a conversation comment names a body finding by its title or line', () => { diff --git a/packages/engine/src/chat-finding.ts b/packages/engine/src/chat-finding.ts index 28f64ad..8502e9c 100644 --- a/packages/engine/src/chat-finding.ts +++ b/packages/engine/src/chat-finding.ts @@ -52,6 +52,8 @@ export interface BodyFindingRow extends ChatFindingRow { path: string; startLine: number; endLine: number; + /** The root of the finding's thread; null for one listed in a review body. */ + providerCommentId: string | null; } /** @@ -60,11 +62,26 @@ export interface BodyFindingRow extends ChatFindingRow { * Newest first, from the pull request's findings. */ export function openBodyFindings(findings: readonly FindingRecord[]): BodyFindingRow[] { + return openFindings(findings.filter((f) => f.providerCommentId === null)); +} + +/** + * Every open finding on a pull request, inline or in a review body, newest first. A conversation + * comment that mentions Hansi can answer any of them: people often settle a finding in the + * conversation ("@hansi read the comments, it's resolved") instead of in its thread. + */ +export function openFindings(findings: readonly FindingRecord[]): BodyFindingRow[] { return [...findings] .reverse() - .filter((f) => f.status === 'posted' && f.providerCommentId === null) + .filter((f) => f.status === 'posted') .slice(0, 50) - .map((f) => ({ ...pick(f), path: f.path, startLine: f.startLine, endLine: f.endLine })); + .map((f) => ({ + ...pick(f), + path: f.path, + startLine: f.startLine, + endLine: f.endLine, + providerCommentId: f.providerCommentId + })); } const normalize = (text: string) => diff --git a/packages/engine/src/chat-job.test.ts b/packages/engine/src/chat-job.test.ts index 4400c4a..ea141bb 100644 --- a/packages/engine/src/chat-job.test.ts +++ b/packages/engine/src/chat-job.test.ts @@ -201,6 +201,82 @@ describe('runChatJob', () => { expect(results.chatUsage[0]?.usage.map((u) => u.role)).toEqual(['chat']); }); + test('a mention in the conversation can settle an inline finding and close its thread', async () => { + // appwrite-labs/application-configuration#1420: the author answered in the conversation, + // not in the finding's thread. + const model = new MockLanguageModelV4({ + doGenerate: [ + toolCalls(['mark_finding', { status: 'dismissed', reason: 'Callers check b first' }]), + text('Agreed, dismissing it.') + ] + }); + const { github, results, context } = setup([model]); + const rootId = seedFinding(github, results); + github.issueComments.push({ + id: '910', + author: 'octocat', + isBot: false, + body: "@hansi read the comments - it's resolved" + }); + + await runChatJob( + { + type: 'chat', + repository, + pullNumber: 7, + comment: { + id: '910', + kind: 'issue', + author: 'octocat', + authorAssociation: 'MEMBER', + url: 'https://github.test/pull/7#issuecomment-910' + } + }, + context, + first + ); + + expect(JSON.stringify(model.doGenerateCalls[0]?.prompt)).toContain('Division by zero'); + expect(github.issueComments.map((c) => c.body)).toContain( + `Agreed, dismissing it.\n\n${replyMarker('910')}` + ); + expect(results.findings[0]?.status).toBe('dismissed'); + expect(github.resolved.has(rootId)).toBe(true); + expect(results.review('review0')?.tier).toBe('S'); + }); + + test('a conversation comment without a mention leaves inline findings to their threads', async () => { + const { github, results, context } = setup(); + seedFinding(github, results); + github.issueComments.push({ + id: '920', + author: 'octocat', + isBot: false, + body: 'Division by zero is fine here.' + }); + + await runChatJob( + { + type: 'chat', + repository, + pullNumber: 7, + comment: { + id: '920', + kind: 'issue', + author: 'octocat', + authorAssociation: 'MEMBER', + url: 'https://github.test/pull/7#issuecomment-920' + }, + unmentioned: true + }, + context, + first + ); + + expect(github.reactions).toEqual([]); + expect(results.findings[0]?.status).toBe('posted'); + }); + test("a thread on another project's finding is left to that project", async () => { const { github, results, context } = setup(); const rootId = seedFinding(github, results); diff --git a/packages/engine/src/chat-job.ts b/packages/engine/src/chat-job.ts index 517d777..ff23297 100644 --- a/packages/engine/src/chat-job.ts +++ b/packages/engine/src/chat-job.ts @@ -5,6 +5,7 @@ import { chatReplyFields, findingsNamedIn, openBodyFindings, + openFindings, type ChatFindingRow } from './chat-finding'; import { isBotAuthor, repliesToBot } from './chat-reply'; @@ -43,8 +44,14 @@ export async function runChatJob( }; // Findings GitHub would not take inline have no thread; a conversation comment answers them. + // With a mention it can answer an inline finding too, which then settles in its thread. const findings = await results.listFindings(pull, { limit: 200 }); - const bodyFindings = comment.kind === 'issue' ? openBodyFindings(findings) : []; + const bodyFindings = + comment.kind !== 'issue' + ? [] + : job.unmentioned + ? openBodyFindings(findings) + : openFindings(findings); if (job.unmentioned && comment.kind === 'issue' && bodyFindings.length === 0) { log.info('conversation comment without a mention and no open body findings, skipping'); return; @@ -93,7 +100,8 @@ export async function runChatJob( log.info("thread is on another project's finding, skipping"); return; } - // The comment being answered can settle a body-listed finding by quoting its title or line. + // The comment being answered can settle a finding by quoting its title or line, or, with a + // mention, the only open one without naming it. const answered = early?.find((c) => c.id === comment.id)?.body ?? ''; const named = findingsNamedIn(answered, bodyFindings, { mentioned: !job.unmentioned }); if (job.unmentioned && comment.kind === 'issue' && named.length === 0) { @@ -222,11 +230,16 @@ export async function runChatJob( }); await reply(`${answer}\n\n${marker}`); - // A finding settled in the conversation (fixed, or intended) closes its thread after the answer. + // A finding settled in the conversation (fixed, or intended) closes its thread after the + // answer: the one replied in, or the threads of the inline findings a conversation comment + // named. if (settled) { - if (comment.rootCommentId) { + const threads = comment.rootCommentId + ? [comment.rootCommentId] + : [...new Set(named.flatMap((f) => (f.providerCommentId ? [f.providerCommentId] : [])))]; + if (threads.length) { await github - .resolveReviewThreads(job.pullNumber, [comment.rootCommentId]) + .resolveReviewThreads(job.pullNumber, threads) .catch((error: unknown) => log.warn('could not resolve thread', { err: error })); } // Keep the PR summary's open-finding list and tier in sync with the dismissal. From c135b2aba6246d540e45fc8cc80546d39b71c9c0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 13:27:28 +0000 Subject: [PATCH 2/9] =?UTF-8?q?fix(engine):=20take=20the=20=F0=9F=91=80=20?= =?UTF-8?q?off=20a=20comment=20once=20Hansi=20has=20answered=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reaction said Hansi was on it, but nothing ever removed it, so every mention kept 👀 forever. A chat removes it after its answer (or after the fixed failure reply on the last attempt), and a review asked for by a mention removes it once the review has ended. A failed attempt that will be retried keeps it. GitHub, GitLab and Gitea remove only the bot's own reaction; Origin and Bitbucket have nothing to remove. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F3M7ttH9uWbxTyZiza9BAC Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com> --- packages/bitbucket/src/client.ts | 2 ++ packages/engine/src/chat-job.test.ts | 34 ++++++++++++++++++++++++++ packages/engine/src/chat-job.ts | 13 +++++++++- packages/engine/src/github.ts | 5 ++++ packages/engine/src/review-job.test.ts | 1 + packages/engine/src/review-job.ts | 25 ++++++++++++++++++- packages/engine/src/testing.ts | 9 +++++++ packages/gitea/src/client.test.ts | 3 +++ packages/gitea/src/client.ts | 9 +++++++ packages/github/src/client.ts | 7 ++++++ packages/github/src/pulls.ts | 34 ++++++++++++++++++++++++++ packages/gitlab/src/client.test.ts | 19 ++++++++++++++ packages/gitlab/src/client.ts | 9 +++++++ packages/origin/src/client.ts | 3 +++ 14 files changed, 171 insertions(+), 2 deletions(-) diff --git a/packages/bitbucket/src/client.ts b/packages/bitbucket/src/client.ts index aaaeeac..3bb6c5c 100644 --- a/packages/bitbucket/src/client.ts +++ b/packages/bitbucket/src/client.ts @@ -389,6 +389,8 @@ export class BitbucketClient implements GitHubClient { /** Bitbucket has no reactions to acknowledge a comment with. */ async acknowledgeComment(): Promise {} + async clearAcknowledgement(): Promise {} + async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const comments = await this.comments(pullNumber); const inThread = new Set([rootCommentId]); diff --git a/packages/engine/src/chat-job.test.ts b/packages/engine/src/chat-job.test.ts index b9c6cac..dac387e 100644 --- a/packages/engine/src/chat-job.test.ts +++ b/packages/engine/src/chat-job.test.ts @@ -296,6 +296,8 @@ describe('runChatJob', () => { await runChatJob(job, context, first); expect(github.reactions).toEqual([{ id: '501', kind: 'review' }]); + // The 👀 comes off once the answer is posted. + expect(github.clearedReactions).toEqual([{ id: '501', kind: 'review' }]); const reply = github.reviewComments.at(-1); expect(reply?.inReplyToId).toBe(rootId); expect(reply?.body).toBe(`Makes sense, dismissing it.\n\n${replyMarker('501')}`); @@ -746,6 +748,38 @@ describe('runChatJob', () => { expect(github.issueComments.map((c) => c.body)).toEqual([ "Sorry, I couldn't answer that right now." ]); + expect(github.clearedReactions).toEqual([{ id: '800', kind: 'issue' }]); + }); + + test('a failed attempt that will be retried keeps the 👀', async () => { + const failing = new MockLanguageModelV4({ + doGenerate: async () => { + throw new Error('provider exploded'); + } + }); + const { github, context } = setup([failing]); + + await expect( + runChatJob( + { + type: 'chat', + repository, + pullNumber: 7, + comment: { + id: '810', + kind: 'issue', + author: 'bob', + authorAssociation: 'MEMBER', + url: 'https://github.test/pull/7#issuecomment-810' + } + }, + context, + first + ) + ).rejects.toThrow(); + + expect(github.reactions).toEqual([{ id: '810', kind: 'issue' }]); + expect(github.clearedReactions).toEqual([]); }); }); diff --git a/packages/engine/src/chat-job.ts b/packages/engine/src/chat-job.ts index 74dca7d..74277ed 100644 --- a/packages/engine/src/chat-job.ts +++ b/packages/engine/src/chat-job.ts @@ -109,6 +109,12 @@ export async function runChatJob( return; } + // The 👀 says Hansi is on it, so it comes off once the comment is answered, or will not be. + const unacknowledge = () => + github + .clearAcknowledgement(job.pullNumber, { id: comment.id, kind: comment.kind }) + .catch((error: unknown) => log.warn('could not remove reaction', { err: error })); + // A retry after GitHub took the answer but the delivery did not settle must not answer twice. const marker = replyMarker(comment.id); if (attempt.attempts > 1) { @@ -119,6 +125,7 @@ export async function runChatJob( await github.getRecentIssueComments(job.pullNumber, Number.MAX_SAFE_INTEGER); if (posted.some((c) => c.isBot && c.body.includes(marker))) { log.info('chat reply already posted, skipping'); + await unacknowledge(); return; } } @@ -230,6 +237,7 @@ export async function runChatJob( }); await reply(`${answer}\n\n${marker}`); + await unacknowledge(); // A finding settled in the conversation (fixed, or intended) closes its thread after the // answer: the one replied in, or the threads of the inline findings a conversation comment // named. @@ -261,7 +269,10 @@ export async function runChatJob( // Tell the person the answer failed, once retries are exhausted. The reply is fixed: // the error can name a provider or include request details, and it stays in the logs. const notice = chatFailureReply(attempt); - if (notice) await reply(notice).catch(() => {}); + if (notice) { + await reply(notice).catch(() => {}); + await unacknowledge(); + } throw error; } finally { if (usage.length) { diff --git a/packages/engine/src/github.ts b/packages/engine/src/github.ts index 52cea62..ecd13ea 100644 --- a/packages/engine/src/github.ts +++ b/packages/engine/src/github.ts @@ -140,6 +140,11 @@ export interface GitHubClient { pullNumber: number, comment: { id: string; kind: 'issue' | 'review' } ): Promise; + /** Takes Hansi's 👀 off a comment again once it has been answered, where the provider can. */ + clearAcknowledgement( + pullNumber: number, + comment: { id: string; kind: 'issue' | 'review' } + ): Promise; /** A review comment thread: the root comment and its replies, oldest first. */ getReviewThread(pullNumber: number, rootCommentId: string): Promise; diff --git a/packages/engine/src/review-job.test.ts b/packages/engine/src/review-job.test.ts index f4d1a75..ce07ebd 100644 --- a/packages/engine/src/review-job.test.ts +++ b/packages/engine/src/review-job.test.ts @@ -368,6 +368,7 @@ describe('runReviewJob', () => { ); expect(github.reactions).toEqual([{ id: '55', kind: 'issue' }]); + expect(github.clearedReactions).toEqual([{ id: '55', kind: 'issue' }]); expect(github.issueComments.map((c) => c.body)).toEqual([ "This pull request is merged, so Hansi doesn't review it anymore." ]); diff --git a/packages/engine/src/review-job.ts b/packages/engine/src/review-job.ts index 03645c0..696975f 100644 --- a/packages/engine/src/review-job.ts +++ b/packages/engine/src/review-job.ts @@ -119,13 +119,36 @@ export async function runReviewJob( return; } - const outcome = await executeReview(job, context, ref, pull, attempt, signal); + let outcome: Outcome; + try { + outcome = await executeReview(job, context, ref, pull, attempt, signal); + } catch (error) { + // A retry reviews it again, so the 👀 stays until the last attempt. + if (attempt.attempts >= attempt.maxAttempts) await clearMentionAcknowledgement(job, context); + throw error; + } if (outcome.status === 'skipped') { await results.skipReview(ref, outcome.summary, outcome.headSha); } + await clearMentionAcknowledgement(job, context); log.info('review finished', { status: outcome.status }); } +/** Takes the 👀 off the comment that asked for the review, once the review has ended. */ +async function clearMentionAcknowledgement(job: ReviewJob, context: EngineContext): Promise { + const asked = reviewMentionComment(job); + if (!asked) return; + try { + const { github } = scopeToRepository( + await context.github.forRepository(job.repository), + job.repository + ); + await github.clearAcknowledgement(job.pullNumber, asked); + } catch (error) { + context.log.warn('could not remove reaction', { err: error }); + } +} + /** * Records a skip. When a mention asked for the review, also posts the one-line explanation. * The reply uses the same comment path as a head that was already reviewed. diff --git a/packages/engine/src/testing.ts b/packages/engine/src/testing.ts index 8758d3c..dacfee3 100644 --- a/packages/engine/src/testing.ts +++ b/packages/engine/src/testing.ts @@ -215,6 +215,8 @@ export class MemoryGitHub implements GitHubClient, GitHubClientFactory { readonly reviews: MemoryReview[] = []; readonly checkRuns: MemoryCheckRun[] = []; readonly reactions: { id: string; kind: 'issue' | 'review' }[] = []; + /** Comments whose 👀 was taken off again, in order. */ + readonly clearedReactions: { id: string; kind: 'issue' | 'review' }[] = []; readonly resolved = new Set(); readonly writers = new Set(); /** Heads `getPullRequest` reports after the first read, in order, e.g. a push mid-review. */ @@ -379,6 +381,13 @@ export class MemoryGitHub implements GitHubClient, GitHubClientFactory { this.reactions.push(comment); } + async clearAcknowledgement( + _pullNumber: number, + comment: { id: string; kind: 'issue' | 'review' } + ): Promise { + this.clearedReactions.push(comment); + } + async getReviewThread(_pullNumber: number, rootCommentId: string): Promise { return this.reviewComments .filter((c) => c.id === rootCommentId || c.inReplyToId === rootCommentId) diff --git a/packages/gitea/src/client.test.ts b/packages/gitea/src/client.test.ts index c82a367..3b87117 100644 --- a/packages/gitea/src/client.test.ts +++ b/packages/gitea/src/client.test.ts @@ -229,6 +229,7 @@ describe('GiteaClient', () => { ]), [`PATCH ${REPO}/issues/comments/2`]: () => Response.json({}), [`POST ${REPO}/issues/comments/5/reactions`]: () => Response.json({}), + [`DELETE ${REPO}/issues/comments/5/reactions`]: () => new Response(null, { status: 200 }), [`POST ${PULL}/comments/5/replies`]: () => Response.json({}), [`POST ${REPO}/pulls/comments/5/resolve`]: () => new Response(null, { status: 204 }) }); @@ -239,12 +240,14 @@ describe('GiteaClient', () => { }); await github.acknowledgeComment(7, { id: '5', kind: 'review' }); await github.replyToReviewComment(7, '5', 'Done'); + await github.clearAcknowledgement(7, { id: '5', kind: 'review' }); expect(await github.resolveReviewThreads(7, ['5'])).toBe(1); expect(seen.slice(1).map((s) => [s.method, s.path, s.body])).toEqual([ ['PATCH', `${REPO}/issues/comments/2`, { body: ' new' }], ['POST', `${REPO}/issues/comments/5/reactions`, { content: 'eyes' }], ['POST', `${PULL}/comments/5/replies`, { body: 'Done' }], + ['DELETE', `${REPO}/issues/comments/5/reactions`, { content: 'eyes' }], ['POST', `${REPO}/pulls/comments/5/resolve`, undefined] ]); }); diff --git a/packages/gitea/src/client.ts b/packages/gitea/src/client.ts index bf73b10..3e5d86a 100644 --- a/packages/gitea/src/client.ts +++ b/packages/gitea/src/client.ts @@ -362,6 +362,15 @@ export class GiteaClient implements GitHubClient { ); } + async clearAcknowledgement(_pullNumber: number, comment: { id: string }): Promise { + // Gitea removes the caller's own reaction with that content. + await this.api.request( + 'DELETE', + `${this.path}/issues/comments/${encodeURIComponent(comment.id)}/reactions`, + { body: { content: 'eyes' } } + ); + } + async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const thread = (await this.threads(pullNumber)).find( (comments) => String(comments[0]!.id) === rootCommentId diff --git a/packages/github/src/client.ts b/packages/github/src/client.ts index 5766395..59261c6 100644 --- a/packages/github/src/client.ts +++ b/packages/github/src/client.ts @@ -149,6 +149,13 @@ export class OctokitGitHubClient implements GitHubClient { }); } + clearAcknowledgement(_pullNumber: number, comment: { id: string; kind: 'issue' | 'review' }) { + return pulls.clearAcknowledgement(this.octokit, this.ref, { + id: Number(comment.id), + kind: comment.kind + }); + } + async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const thread = await pulls.getReviewThread( this.octokit, diff --git a/packages/github/src/pulls.ts b/packages/github/src/pulls.ts index ea2042f..50a469d 100644 --- a/packages/github/src/pulls.ts +++ b/packages/github/src/pulls.ts @@ -523,6 +523,40 @@ export async function acknowledgeComment( } } +/** + * Takes the bot's 👀 off a comment. Creating a reaction that already exists answers with the + * existing one, so its id is found without knowing the bot's login, then deleted. + */ +export async function clearAcknowledgement( + octokit: Octokit, + ref: RepoRef, + comment: { id: number; kind: 'issue' | 'review' } +) { + if (comment.kind === 'issue') { + const { data } = await octokit.rest.reactions.createForIssueComment({ + ...ref, + comment_id: comment.id, + content: 'eyes' + }); + await octokit.rest.reactions.deleteForIssueComment({ + ...ref, + comment_id: comment.id, + reaction_id: data.id + }); + } else { + const { data } = await octokit.rest.reactions.createForPullRequestReviewComment({ + ...ref, + comment_id: comment.id, + content: 'eyes' + }); + await octokit.rest.reactions.deleteForPullRequestComment({ + ...ref, + comment_id: comment.id, + reaction_id: data.id + }); + } +} + /** The bot's marked comment on an issue, if one exists. */ export async function getMarkedComment( octokit: Octokit, diff --git a/packages/gitlab/src/client.test.ts b/packages/gitlab/src/client.test.ts index 84db1d1..30f5235 100644 --- a/packages/gitlab/src/client.test.ts +++ b/packages/gitlab/src/client.test.ts @@ -396,6 +396,25 @@ describe('GitLabClient', () => { expect(await github.getFileContent('missing.yml', 'base')).toBeNull(); }); + test('takes only its own eyes off a comment', async () => { + const { github } = await connect({ + [`GET ${MR}/notes/5/award_emoji`]: () => + Response.json([ + { id: 1, name: 'eyes', user: { id: 1, username: 'ada' } }, + { id: 2, name: 'thumbsup', user: bot }, + { id: 3, name: 'eyes', user: bot } + ]), + [`DELETE ${MR}/notes/5/award_emoji/3`]: () => new Response(null, { status: 204 }) + }); + + await github.clearAcknowledgement(7, { id: '5', kind: 'issue' }); + + expect(seen.map((s) => `${s.method} ${s.path}`).slice(-2)).toEqual([ + `GET ${MR}/notes/5/award_emoji`, + `DELETE ${MR}/notes/5/award_emoji/3` + ]); + }); + test('reacts with eyes and links only issues of this project', async () => { const { github } = await connect({ [`POST ${MR}/notes/5/award_emoji`]: () => Response.json({}), diff --git a/packages/gitlab/src/client.ts b/packages/gitlab/src/client.ts index 142bbce..567aa73 100644 --- a/packages/gitlab/src/client.ts +++ b/packages/gitlab/src/client.ts @@ -404,6 +404,15 @@ export class GitLabClient implements GitHubClient { ); } + async clearAcknowledgement(pullNumber: number, comment: { id: string }): Promise { + const path = `${this.mergeRequestPath(pullNumber)}/notes/${encodeURIComponent(comment.id)}/award_emoji`; + const awards = await this.api.request<{ id: number; name: string; user: User }[]>('GET', path); + for (const award of awards) { + if (award.name !== 'eyes' || !this.isOwn(award.user)) continue; + await this.api.request('DELETE', `${path}/${award.id}`); + } + } + async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const discussion = await this.api.request( 'GET', diff --git a/packages/origin/src/client.ts b/packages/origin/src/client.ts index 8b60bcc..f42b72d 100644 --- a/packages/origin/src/client.ts +++ b/packages/origin/src/client.ts @@ -370,6 +370,9 @@ export class OriginClient implements GitHubClient { ); } + /** Origin has no way to take a reaction back, so the 👀 stays. */ + async clearAcknowledgement(): Promise {} + async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const comments = await this.comments(pullNumber, { threadIds: [rootCommentId] }); return comments.map((comment) => this.threadComment(comment)); From 8d99527f6b3504f5f3da71d44bb6ef3e16e95b44 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 13:29:56 +0000 Subject: [PATCH 3/9] =?UTF-8?q?fix(engine):=20swap=20the=20=F0=9F=91=80=20?= =?UTF-8?q?for=20=F0=9F=91=8D=20instead=20of=20only=20removing=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub's reactions have no check mark, so 👍 marks a comment as answered. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F3M7ttH9uWbxTyZiza9BAC Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com> --- packages/bitbucket/src/client.ts | 2 +- packages/engine/src/chat-job.test.ts | 8 ++++---- packages/engine/src/chat-job.ts | 6 +++--- packages/engine/src/github.ts | 4 ++-- packages/engine/src/review-job.test.ts | 2 +- packages/engine/src/review-job.ts | 12 ++++++------ packages/engine/src/testing.ts | 8 ++++---- packages/gitea/src/client.test.ts | 3 ++- packages/gitea/src/client.ts | 10 ++++------ packages/github/src/client.ts | 4 ++-- packages/github/src/pulls.ts | 27 ++++++++++---------------- packages/gitlab/src/client.test.ts | 6 ++++-- packages/gitlab/src/client.ts | 3 ++- packages/origin/src/client.ts | 10 ++++++++-- 14 files changed, 53 insertions(+), 52 deletions(-) diff --git a/packages/bitbucket/src/client.ts b/packages/bitbucket/src/client.ts index 3bb6c5c..e80d08c 100644 --- a/packages/bitbucket/src/client.ts +++ b/packages/bitbucket/src/client.ts @@ -389,7 +389,7 @@ export class BitbucketClient implements GitHubClient { /** Bitbucket has no reactions to acknowledge a comment with. */ async acknowledgeComment(): Promise {} - async clearAcknowledgement(): Promise {} + async finishAcknowledgement(): Promise {} async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const comments = await this.comments(pullNumber); diff --git a/packages/engine/src/chat-job.test.ts b/packages/engine/src/chat-job.test.ts index dac387e..0918ba1 100644 --- a/packages/engine/src/chat-job.test.ts +++ b/packages/engine/src/chat-job.test.ts @@ -296,8 +296,8 @@ describe('runChatJob', () => { await runChatJob(job, context, first); expect(github.reactions).toEqual([{ id: '501', kind: 'review' }]); - // The 👀 comes off once the answer is posted. - expect(github.clearedReactions).toEqual([{ id: '501', kind: 'review' }]); + // The 👀 turns into 👍 once the answer is posted. + expect(github.finishedReactions).toEqual([{ id: '501', kind: 'review' }]); const reply = github.reviewComments.at(-1); expect(reply?.inReplyToId).toBe(rootId); expect(reply?.body).toBe(`Makes sense, dismissing it.\n\n${replyMarker('501')}`); @@ -748,7 +748,7 @@ describe('runChatJob', () => { expect(github.issueComments.map((c) => c.body)).toEqual([ "Sorry, I couldn't answer that right now." ]); - expect(github.clearedReactions).toEqual([{ id: '800', kind: 'issue' }]); + expect(github.finishedReactions).toEqual([{ id: '800', kind: 'issue' }]); }); test('a failed attempt that will be retried keeps the 👀', async () => { @@ -779,7 +779,7 @@ describe('runChatJob', () => { ).rejects.toThrow(); expect(github.reactions).toEqual([{ id: '810', kind: 'issue' }]); - expect(github.clearedReactions).toEqual([]); + expect(github.finishedReactions).toEqual([]); }); }); diff --git a/packages/engine/src/chat-job.ts b/packages/engine/src/chat-job.ts index 74277ed..43eb997 100644 --- a/packages/engine/src/chat-job.ts +++ b/packages/engine/src/chat-job.ts @@ -109,11 +109,11 @@ export async function runChatJob( return; } - // The 👀 says Hansi is on it, so it comes off once the comment is answered, or will not be. + // The 👀 says Hansi is on it, so it turns into 👍 once the comment is answered, or will not be. const unacknowledge = () => github - .clearAcknowledgement(job.pullNumber, { id: comment.id, kind: comment.kind }) - .catch((error: unknown) => log.warn('could not remove reaction', { err: error })); + .finishAcknowledgement(job.pullNumber, { id: comment.id, kind: comment.kind }) + .catch((error: unknown) => log.warn('could not finish reaction', { err: error })); // A retry after GitHub took the answer but the delivery did not settle must not answer twice. const marker = replyMarker(comment.id); diff --git a/packages/engine/src/github.ts b/packages/engine/src/github.ts index ecd13ea..0b8d31f 100644 --- a/packages/engine/src/github.ts +++ b/packages/engine/src/github.ts @@ -140,8 +140,8 @@ export interface GitHubClient { pullNumber: number, comment: { id: string; kind: 'issue' | 'review' } ): Promise; - /** Takes Hansi's 👀 off a comment again once it has been answered, where the provider can. */ - clearAcknowledgement( + /** Swaps Hansi's 👀 on a comment for 👍 once it has been answered, where the provider can. */ + finishAcknowledgement( pullNumber: number, comment: { id: string; kind: 'issue' | 'review' } ): Promise; diff --git a/packages/engine/src/review-job.test.ts b/packages/engine/src/review-job.test.ts index ce07ebd..69889be 100644 --- a/packages/engine/src/review-job.test.ts +++ b/packages/engine/src/review-job.test.ts @@ -368,7 +368,7 @@ describe('runReviewJob', () => { ); expect(github.reactions).toEqual([{ id: '55', kind: 'issue' }]); - expect(github.clearedReactions).toEqual([{ id: '55', kind: 'issue' }]); + expect(github.finishedReactions).toEqual([{ id: '55', kind: 'issue' }]); expect(github.issueComments.map((c) => c.body)).toEqual([ "This pull request is merged, so Hansi doesn't review it anymore." ]); diff --git a/packages/engine/src/review-job.ts b/packages/engine/src/review-job.ts index 696975f..2bac84b 100644 --- a/packages/engine/src/review-job.ts +++ b/packages/engine/src/review-job.ts @@ -124,18 +124,18 @@ export async function runReviewJob( outcome = await executeReview(job, context, ref, pull, attempt, signal); } catch (error) { // A retry reviews it again, so the 👀 stays until the last attempt. - if (attempt.attempts >= attempt.maxAttempts) await clearMentionAcknowledgement(job, context); + if (attempt.attempts >= attempt.maxAttempts) await finishMentionAcknowledgement(job, context); throw error; } if (outcome.status === 'skipped') { await results.skipReview(ref, outcome.summary, outcome.headSha); } - await clearMentionAcknowledgement(job, context); + await finishMentionAcknowledgement(job, context); log.info('review finished', { status: outcome.status }); } -/** Takes the 👀 off the comment that asked for the review, once the review has ended. */ -async function clearMentionAcknowledgement(job: ReviewJob, context: EngineContext): Promise { +/** Swaps the 👀 on the comment that asked for the review for 👍, once the review has ended. */ +async function finishMentionAcknowledgement(job: ReviewJob, context: EngineContext): Promise { const asked = reviewMentionComment(job); if (!asked) return; try { @@ -143,9 +143,9 @@ async function clearMentionAcknowledgement(job: ReviewJob, context: EngineContex await context.github.forRepository(job.repository), job.repository ); - await github.clearAcknowledgement(job.pullNumber, asked); + await github.finishAcknowledgement(job.pullNumber, asked); } catch (error) { - context.log.warn('could not remove reaction', { err: error }); + context.log.warn('could not finish reaction', { err: error }); } } diff --git a/packages/engine/src/testing.ts b/packages/engine/src/testing.ts index dacfee3..000c30e 100644 --- a/packages/engine/src/testing.ts +++ b/packages/engine/src/testing.ts @@ -215,8 +215,8 @@ export class MemoryGitHub implements GitHubClient, GitHubClientFactory { readonly reviews: MemoryReview[] = []; readonly checkRuns: MemoryCheckRun[] = []; readonly reactions: { id: string; kind: 'issue' | 'review' }[] = []; - /** Comments whose 👀 was taken off again, in order. */ - readonly clearedReactions: { id: string; kind: 'issue' | 'review' }[] = []; + /** Comments whose 👀 was swapped for 👍, in order. */ + readonly finishedReactions: { id: string; kind: 'issue' | 'review' }[] = []; readonly resolved = new Set(); readonly writers = new Set(); /** Heads `getPullRequest` reports after the first read, in order, e.g. a push mid-review. */ @@ -381,11 +381,11 @@ export class MemoryGitHub implements GitHubClient, GitHubClientFactory { this.reactions.push(comment); } - async clearAcknowledgement( + async finishAcknowledgement( _pullNumber: number, comment: { id: string; kind: 'issue' | 'review' } ): Promise { - this.clearedReactions.push(comment); + this.finishedReactions.push(comment); } async getReviewThread(_pullNumber: number, rootCommentId: string): Promise { diff --git a/packages/gitea/src/client.test.ts b/packages/gitea/src/client.test.ts index 3b87117..a51bc6f 100644 --- a/packages/gitea/src/client.test.ts +++ b/packages/gitea/src/client.test.ts @@ -240,13 +240,14 @@ describe('GiteaClient', () => { }); await github.acknowledgeComment(7, { id: '5', kind: 'review' }); await github.replyToReviewComment(7, '5', 'Done'); - await github.clearAcknowledgement(7, { id: '5', kind: 'review' }); + await github.finishAcknowledgement(7, { id: '5', kind: 'review' }); expect(await github.resolveReviewThreads(7, ['5'])).toBe(1); expect(seen.slice(1).map((s) => [s.method, s.path, s.body])).toEqual([ ['PATCH', `${REPO}/issues/comments/2`, { body: ' new' }], ['POST', `${REPO}/issues/comments/5/reactions`, { content: 'eyes' }], ['POST', `${PULL}/comments/5/replies`, { body: 'Done' }], + ['POST', `${REPO}/issues/comments/5/reactions`, { content: '+1' }], ['DELETE', `${REPO}/issues/comments/5/reactions`, { content: 'eyes' }], ['POST', `${REPO}/pulls/comments/5/resolve`, undefined] ]); diff --git a/packages/gitea/src/client.ts b/packages/gitea/src/client.ts index 3e5d86a..5696f55 100644 --- a/packages/gitea/src/client.ts +++ b/packages/gitea/src/client.ts @@ -362,13 +362,11 @@ export class GiteaClient implements GitHubClient { ); } - async clearAcknowledgement(_pullNumber: number, comment: { id: string }): Promise { + async finishAcknowledgement(_pullNumber: number, comment: { id: string }): Promise { + const path = `${this.path}/issues/comments/${encodeURIComponent(comment.id)}/reactions`; + await this.api.request('POST', path, { body: { content: '+1' } }); // Gitea removes the caller's own reaction with that content. - await this.api.request( - 'DELETE', - `${this.path}/issues/comments/${encodeURIComponent(comment.id)}/reactions`, - { body: { content: 'eyes' } } - ); + await this.api.request('DELETE', path, { body: { content: 'eyes' } }); } async getReviewThread(pullNumber: number, rootCommentId: string): Promise { diff --git a/packages/github/src/client.ts b/packages/github/src/client.ts index 59261c6..e26850e 100644 --- a/packages/github/src/client.ts +++ b/packages/github/src/client.ts @@ -149,8 +149,8 @@ export class OctokitGitHubClient implements GitHubClient { }); } - clearAcknowledgement(_pullNumber: number, comment: { id: string; kind: 'issue' | 'review' }) { - return pulls.clearAcknowledgement(this.octokit, this.ref, { + finishAcknowledgement(_pullNumber: number, comment: { id: string; kind: 'issue' | 'review' }) { + return pulls.finishAcknowledgement(this.octokit, this.ref, { id: Number(comment.id), kind: comment.kind }); diff --git a/packages/github/src/pulls.ts b/packages/github/src/pulls.ts index 50a469d..5cb759d 100644 --- a/packages/github/src/pulls.ts +++ b/packages/github/src/pulls.ts @@ -524,36 +524,29 @@ export async function acknowledgeComment( } /** - * Takes the bot's 👀 off a comment. Creating a reaction that already exists answers with the - * existing one, so its id is found without knowing the bot's login, then deleted. + * Swaps the bot's 👀 on a comment for 👍: done. Creating a reaction that already exists answers + * with the existing one, so the 👀's id is found without knowing the bot's login. */ -export async function clearAcknowledgement( +export async function finishAcknowledgement( octokit: Octokit, ref: RepoRef, comment: { id: number; kind: 'issue' | 'review' } ) { + const target = { ...ref, comment_id: comment.id }; if (comment.kind === 'issue') { + await octokit.rest.reactions.createForIssueComment({ ...target, content: '+1' }); const { data } = await octokit.rest.reactions.createForIssueComment({ - ...ref, - comment_id: comment.id, + ...target, content: 'eyes' }); - await octokit.rest.reactions.deleteForIssueComment({ - ...ref, - comment_id: comment.id, - reaction_id: data.id - }); + await octokit.rest.reactions.deleteForIssueComment({ ...target, reaction_id: data.id }); } else { + await octokit.rest.reactions.createForPullRequestReviewComment({ ...target, content: '+1' }); const { data } = await octokit.rest.reactions.createForPullRequestReviewComment({ - ...ref, - comment_id: comment.id, + ...target, content: 'eyes' }); - await octokit.rest.reactions.deleteForPullRequestComment({ - ...ref, - comment_id: comment.id, - reaction_id: data.id - }); + await octokit.rest.reactions.deleteForPullRequestComment({ ...target, reaction_id: data.id }); } } diff --git a/packages/gitlab/src/client.test.ts b/packages/gitlab/src/client.test.ts index 30f5235..45e1650 100644 --- a/packages/gitlab/src/client.test.ts +++ b/packages/gitlab/src/client.test.ts @@ -396,8 +396,9 @@ describe('GitLabClient', () => { expect(await github.getFileContent('missing.yml', 'base')).toBeNull(); }); - test('takes only its own eyes off a comment', async () => { + test('swaps only its own eyes for a thumbs up', async () => { const { github } = await connect({ + [`POST ${MR}/notes/5/award_emoji`]: () => Response.json({}), [`GET ${MR}/notes/5/award_emoji`]: () => Response.json([ { id: 1, name: 'eyes', user: { id: 1, username: 'ada' } }, @@ -407,8 +408,9 @@ describe('GitLabClient', () => { [`DELETE ${MR}/notes/5/award_emoji/3`]: () => new Response(null, { status: 204 }) }); - await github.clearAcknowledgement(7, { id: '5', kind: 'issue' }); + await github.finishAcknowledgement(7, { id: '5', kind: 'issue' }); + expect(seen.find((s) => s.method === 'POST')?.body).toEqual({ name: 'thumbsup' }); expect(seen.map((s) => `${s.method} ${s.path}`).slice(-2)).toEqual([ `GET ${MR}/notes/5/award_emoji`, `DELETE ${MR}/notes/5/award_emoji/3` diff --git a/packages/gitlab/src/client.ts b/packages/gitlab/src/client.ts index 567aa73..bbb6cf6 100644 --- a/packages/gitlab/src/client.ts +++ b/packages/gitlab/src/client.ts @@ -404,8 +404,9 @@ export class GitLabClient implements GitHubClient { ); } - async clearAcknowledgement(pullNumber: number, comment: { id: string }): Promise { + async finishAcknowledgement(pullNumber: number, comment: { id: string }): Promise { const path = `${this.mergeRequestPath(pullNumber)}/notes/${encodeURIComponent(comment.id)}/award_emoji`; + await this.api.request('POST', path, { body: { name: 'thumbsup' } }); const awards = await this.api.request<{ id: number; name: string; user: User }[]>('GET', path); for (const award of awards) { if (award.name !== 'eyes' || !this.isOwn(award.user)) continue; diff --git a/packages/origin/src/client.ts b/packages/origin/src/client.ts index f42b72d..d3c1f3a 100644 --- a/packages/origin/src/client.ts +++ b/packages/origin/src/client.ts @@ -370,8 +370,14 @@ export class OriginClient implements GitHubClient { ); } - /** Origin has no way to take a reaction back, so the 👀 stays. */ - async clearAcknowledgement(): Promise {} + /** Origin has no way to take a reaction back, so the 👍 joins the 👀. */ + async finishAcknowledgement(_pullNumber: number, comment: { id: string }): Promise { + await this.api.request( + 'POST', + `${this.path}/pulls/comments/${encodeURIComponent(comment.id)}/reactions`, + { emoji: '👍' } + ); + } async getReviewThread(pullNumber: number, rootCommentId: string): Promise { const comments = await this.comments(pullNumber, { threadIds: [rootCommentId] }); From b1d41ce44664350be6e254cbcfad721fd9c7fc30 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 13:31:50 +0000 Subject: [PATCH 4/9] fix(engine): guess an unnamed finding only when no other project reviews the PR Each project reviewing a repository gets the conversation comment and sees only its own findings, so a mention that names none could settle one finding in every project. The only-open-finding guess now needs the pull request to carry no other repository row's summary. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F3M7ttH9uWbxTyZiza9BAC Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com> --- packages/engine/src/chat-job.test.ts | 36 ++++++++++++++++++++++++++++ packages/engine/src/chat-job.ts | 17 ++++++++++--- packages/engine/src/scope.test.ts | 17 ++++++++++++- packages/engine/src/scope.ts | 16 +++++++++++++ 4 files changed, 82 insertions(+), 4 deletions(-) diff --git a/packages/engine/src/chat-job.test.ts b/packages/engine/src/chat-job.test.ts index 0918ba1..792fc6b 100644 --- a/packages/engine/src/chat-job.test.ts +++ b/packages/engine/src/chat-job.test.ts @@ -9,6 +9,7 @@ import { replyMarker, runChatJob, upTo } from './chat-job'; import { formatSummaryComment, SUMMARY_MARKER } from './format'; import type { ChatJob } from './jobs'; import { summaryMarkerFor } from './scope'; +import { summaryMarkerFor } from './scope'; import { MemoryGitHub, MemoryResultsSink } from './testing'; // The chat job end to end against a local git remote, the in-memory GitHub and a scripted @@ -510,6 +511,41 @@ describe('runChatJob', () => { expect(results.review('review0')?.tier).toBe('S'); }); + test('an unnamed finding is not guessed while another project reviews the pull request', async () => { + const model = new MockLanguageModelV4({ doGenerate: [text('Which finding do you mean?')] }); + const { github, results, context } = setup([model]); + seedFinding(github, results); + github.issueComments.push( + { + id: '930', + author: 'hansi[bot]', + isBot: true, + body: `${summaryMarkerFor('other-row')}\n\nOther review` + }, + { id: '931', author: 'octocat', isBot: false, body: "@hansi it's resolved" } + ); + + await runChatJob( + { + type: 'chat', + repository, + pullNumber: 7, + comment: { + id: '931', + kind: 'issue', + author: 'octocat', + authorAssociation: 'MEMBER', + url: 'https://github.test/pull/7#issuecomment-931' + } + }, + context, + first + ); + + expect(JSON.stringify(model.doGenerateCalls[0]?.prompt)).not.toContain('Division by zero'); + expect(results.findings[0]?.status).toBe('posted'); + }); + test('a conversation comment without a mention leaves inline findings to their threads', async () => { const { github, results, context } = setup(); seedFinding(github, results); diff --git a/packages/engine/src/chat-job.ts b/packages/engine/src/chat-job.ts index 43eb997..451483f 100644 --- a/packages/engine/src/chat-job.ts +++ b/packages/engine/src/chat-job.ts @@ -17,7 +17,7 @@ import type { ChatJob } from './jobs'; import { chatFailureReply } from './public-failure'; import type { ChatRef, ModelUsage, PullRef } from './results'; import { lazySandbox, openSandbox } from './review-sandbox'; -import { scopeToRepository } from './scope'; +import { reviewedByAnotherRepository, scopeToRepository } from './scope'; import { modelUsage, statusImagesOrigin, withWorkdir } from './shared'; import { refreshSummaryAfterSettlement } from './summary'; @@ -101,9 +101,20 @@ export async function runChatJob( return; } // The comment being answered can settle a finding by quoting its title or line, or, with a - // mention, the only open one without naming it. + // mention, the only open one without naming it. Every project reviewing the repository gets + // the comment, and each sees only its own findings, so that guess is made only where no other + // project has reviewed the pull request. const answered = early?.find((c) => c.id === comment.id)?.body ?? ''; - const named = findingsNamedIn(answered, bodyFindings, { mentioned: !job.unmentioned }); + let named = findingsNamedIn(answered, bodyFindings, { mentioned: false }); + if (named.length === 0 && !job.unmentioned && bodyFindings.length > 0) { + const conversation = await github.getRecentIssueComments( + job.pullNumber, + Number.MAX_SAFE_INTEGER + ); + if (!reviewedByAnotherRepository(conversation, job.repository.repositoryId)) { + named = findingsNamedIn(answered, bodyFindings, { mentioned: true }); + } + } if (job.unmentioned && comment.kind === 'issue' && named.length === 0) { log.info('conversation comment does not name an open finding, skipping'); return; diff --git a/packages/engine/src/scope.test.ts b/packages/engine/src/scope.test.ts index 402ee5c..ad1ddec 100644 --- a/packages/engine/src/scope.test.ts +++ b/packages/engine/src/scope.test.ts @@ -1,6 +1,11 @@ import { describe, expect, test } from 'bun:test'; import { SUMMARY_MARKER } from './format'; -import { reviewMarkerFor, scopeToRepository, summaryMarkerFor } from './scope'; +import { + reviewedByAnotherRepository, + reviewMarkerFor, + scopeToRepository, + summaryMarkerFor +} from './scope'; import { MemoryGitHub } from './testing'; // Two Appwrite projects reviewing one repository share the GitHub App: each sees only its own @@ -114,3 +119,13 @@ describe('scopeToRepository', () => { expect((await a.getPullRequest(7)).number).toBe(7); }); }); + +test("another row's summary on the pull request means another project reviews it", () => { + const own = { isBot: true, body: `${summaryMarkerFor('row1')}\n\n## Code review` }; + const other = { isBot: true, body: `${summaryMarkerFor('row2')}\n\n## Code review` }; + const quoted = { isBot: false, body: other.body }; + expect(reviewedByAnotherRepository([own], 'row1')).toBe(false); + expect(reviewedByAnotherRepository([own, quoted], 'row1')).toBe(false); + expect(reviewedByAnotherRepository([own, other], 'row1')).toBe(true); + expect(reviewedByAnotherRepository([{ isBot: true, body: SUMMARY_MARKER }], 'row1')).toBe(false); +}); diff --git a/packages/engine/src/scope.ts b/packages/engine/src/scope.ts index 412addf..4ac521a 100644 --- a/packages/engine/src/scope.ts +++ b/packages/engine/src/scope.ts @@ -15,6 +15,22 @@ export function summaryMarkerFor(repositoryId: string): string { return ``; } +const SUMMARY_MARKER_PREFIX = `