Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/github-bot/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export async function handleReviewRequested(

const messageId = await sendPrompt(env.CONTROL_PLANE, headers, sessionId, {
content: prompt,
authorId: `github:${payload.sender.login}`,
authorId: `github:${payload.sender.id}`,
});
log.info("prompt.sent", {
...meta,
Expand Down Expand Up @@ -331,7 +331,7 @@ export async function handlePullRequestOpened(

const messageId = await sendPrompt(env.CONTROL_PLANE, headers, sessionId, {
content: prompt,
authorId: `github:${sender.login}`,
authorId: `github:${sender.id}`,
});
log.info("prompt.sent", {
...meta,
Expand Down Expand Up @@ -434,7 +434,7 @@ export async function handleIssueComment(

const messageId = await sendPrompt(env.CONTROL_PLANE, headers, sessionId, {
content: prompt,
authorId: `github:${sender.login}`,
authorId: `github:${sender.id}`,
});
log.info("prompt.sent", {
...meta,
Expand Down Expand Up @@ -537,7 +537,7 @@ export async function handleReviewComment(

const messageId = await sendPrompt(env.CONTROL_PLANE, headers, sessionId, {
content: prompt,
authorId: `github:${sender.login}`,
authorId: `github:${sender.id}`,
});
log.info("prompt.sent", {
...meta,
Expand Down
8 changes: 4 additions & 4 deletions packages/github-bot/test/handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe("handlePullRequestOpened", () => {

const promptBody = JSON.parse(cpFetch.mock.calls[1][1].body);
expect(promptBody.source).toBe("github");
expect(promptBody.authorId).toBe("github:alice");
expect(promptBody.authorId).toBe("github:1001");
expect(promptBody.content).toContain("Pull Request #42");

expect(log.info).toHaveBeenCalledWith(
Expand Down Expand Up @@ -378,7 +378,7 @@ describe("handleReviewRequested", () => {
expect(promptCall[0]).toBe("https://internal/sessions/session-123/prompt");
const promptBody = JSON.parse(promptCall[1].body);
expect(promptBody.source).toBe("github");
expect(promptBody.authorId).toBe("github:alice");
expect(promptBody.authorId).toBe("github:1001");
expect(promptBody.content).toContain("Pull Request #42");
expect(promptBody.content).toContain("acme/widgets");
expect(promptBody.content).toContain("gh pr diff 42");
Expand Down Expand Up @@ -472,7 +472,7 @@ describe("handleIssueComment", () => {
const promptBody = JSON.parse(cpFetch.mock.calls[1][1].body);
expect(promptBody.content).toContain("please fix the error handling");
expect(promptBody.content).not.toContain("@test-bot[bot]");
expect(promptBody.authorId).toBe("github:bob");
expect(promptBody.authorId).toBe("github:1002");
});

it("returns early if not a PR", async () => {
Expand Down Expand Up @@ -570,7 +570,7 @@ describe("handleReviewComment", () => {
expect(promptBody.content).toContain("src/cache.ts");
expect(promptBody.content).toContain("const cache = new Map()");
expect(promptBody.content).toContain("comments/200/replies");
expect(promptBody.authorId).toBe("github:carol");
expect(promptBody.authorId).toBe("github:1003");
});

it("returns early if no @mention", async () => {
Expand Down
Loading