From 560598db56ec592b6cd4348bc90ac319a3439e68 Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Sat, 10 Jan 2026 18:22:46 -0300 Subject: [PATCH] fix: Check for existing Devin sessions from conflict resolver in cubic workflow (#26706) When addressing Cubic AI comments, the workflow now also looks for existing Devin sessions from the conflict resolver workflow and stale PR completion workflow, not just previous Cubic review sessions. This ensures that if a Devin session is already working on a PR (e.g., fixing merge conflicts), new Cubic feedback will be sent to that existing session instead of creating a new one. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/cubic-devin-review.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cubic-devin-review.yml b/.github/workflows/cubic-devin-review.yml index b1b7ef7e1c..05572d100d 100644 --- a/.github/workflows/cubic-devin-review.yml +++ b/.github/workflows/cubic-devin-review.yml @@ -89,6 +89,13 @@ jobs: } // PR was not created through Devin - check for existing Devin session from PR comments + // Look for any Devin session comment (cubic review, conflict resolution, stale PR completion, etc.) + const devinSessionPatterns = [ + 'Devin AI is addressing Cubic AI', + 'Devin AI is resolving merge conflicts', + 'Devin AI is completing this stale PR' + ]; + const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, @@ -97,10 +104,12 @@ jobs: let sessionId = null; for (const comment of comments.data.reverse()) { - if (comment.body.includes('Devin AI is addressing Cubic AI')) { + const hasDevinSession = devinSessionPatterns.some(pattern => comment.body.includes(pattern)); + if (hasDevinSession) { const match = comment.body.match(/app\.devin\.ai\/sessions\/([a-f0-9-]+)/); if (match) { sessionId = match[1]; + console.log(`Found existing Devin session from comment: ${sessionId}`); break; } }