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>
This commit is contained in:
Keith Williams
2026-01-10 21:22:46 +00:00
committed by GitHub
co-authored by Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 3dd0b2d46b
commit 560598db56
+10 -1
View File
@@ -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;
}
}