From fa10a3e42a4c541a98fd3d088350dd91b2afbe34 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Wed, 9 Jul 2025 17:45:19 -0700 Subject: [PATCH] feat: Include run and thread IDs in the issue comment (#378) --- apps/open-swe/src/routes/github/issue-webhook.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/open-swe/src/routes/github/issue-webhook.ts b/apps/open-swe/src/routes/github/issue-webhook.ts index 394a941a..0ba94aa5 100644 --- a/apps/open-swe/src/routes/github/issue-webhook.ts +++ b/apps/open-swe/src/routes/github/issue-webhook.ts @@ -52,6 +52,20 @@ const getPayload = (body: string): Record | null => { } }; +const createDevMetadataComment = (runId: string, threadId: string) => { + return `
+ Dev Metadata + ${JSON.stringify( + { + runId, + threadId, + }, + null, + 2, + )} +
`; +}; + const getHeaders = ( c: Context, ): { @@ -179,7 +193,7 @@ webhooks.on("issues.labeled", async ({ payload }) => { owner: issueData.owner, repo: issueData.repo, issue_number: issueData.issueNumber, - body: `🤖 Open SWE has been triggered for this issue. Processing...\n\n${appUrlCommentText}`, + body: `🤖 Open SWE has been triggered for this issue. Processing...\n\n${appUrlCommentText}\n\n${createDevMetadataComment(run.run_id, threadId)}`, }, ); } catch (error) {