Skip to content

Commit

Permalink
fix: add err comment on personal agent bridge failure
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 9, 2024
1 parent 9dcb8e7 commit aa715d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export async function callPersonalAgent(context: Context) {

const owner = payload.repository.owner.login;
const body = payload.comment.body;
const repo = payload.repository.name;

if (!body.match(/^\/\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))\s.*/i)) {
logger.info(`Ignoring irrelevant comment: ${body}`);
Expand Down Expand Up @@ -55,6 +56,15 @@ export async function callPersonalAgent(context: Context) {
});
} catch (error) {
logger.error(`Error dispatching workflow:`, { err: error, error: new Error() });

const errComment = ["```diff", `! There was a problem calling the personal agent of ${personalAgentOwner}`, "```"].join("\n");
await context.octokit.rest.issues.createComment({
body: errComment,
repo,
owner,
issue_number: payload.issue.number,
});

throw error;
}

Expand Down

0 comments on commit aa715d6

Please sign in to comment.