Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Change body prompt handling

Tomas Valenta3d8adf4caad2
diff --git a/github/pullRequest.ts b/github/pullRequest.ts
index 4b5b090ae..9d85a3d32 100644
--- a/github/pullRequest.ts
+++ b/github/pullRequest.ts
@@ -5,7 +5,6 @@ import api from 'api-client/api'
import { deployments, prisma } from 'db/prisma'
import { GitHubClient } from './client'
-import { prInfoText } from 'pages/api/agent'
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
@@ -173,9 +172,12 @@ export async function getPromptFromPR({
.map(c => c.body)
.join('\n')
- const indexOfSub = prBody.indexOf(prInfoText)
- const prBodyWithoutInfo = prBody.substring(0, indexOfSub)
- return `${prBodyWithoutInfo}\n\n${comments}`
+
+ // Remove everything from the prBody string after the last '---'
+ // This is the separator between the PR description and the PR body
+ const indexOfSeparator = prBody.lastIndexOf('---')
+ const prBodyWithoutSeparator = prBody.substring(0, indexOfSeparator)
+ return `${prBodyWithoutSeparator}\n\n${comments}`
}
export async function getDeploymentsForPR({