Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Save last run prompt

Tomas Valenta2163056ae48d
diff --git a/pages/api/agent/run.ts b/pages/api/agent/run.ts
index 0dde6faa6..a7f020913 100644
--- a/pages/api/agent/run.ts
+++ b/pages/api/agent/run.ts
@@ -36,7 +36,6 @@ async function postRun(req: NextApiRequest, res: NextApiResponse) {
const authData = deployment.auth as unknown as DeploymentAuthData
const client = getGHInstallationClient({ installationID: authData.github.installation_id })
-
// TODO: Should we maybe just edit the previous comment?
// Or should we do that only if the previous run was cancelled
await addCommentToPR({
@@ -47,6 +46,15 @@ async function postRun(req: NextApiRequest, res: NextApiResponse) {
pullNumber: authData.github.pull_number,
})
+ await prisma.deployments.update({
+ where: {
+ id: deployment_id,
+ },
+ data: {
+ last_finished_prompt: prompt,
+ },
+ })
+
res.status(200).json({})
} catch (err: any) {
console.error(err)