Skip to content

Support triggering the bug-fix agent for follow-ups when mentioning @hackbot#6353

Draft
suhaibmujahid wants to merge 3 commits into
mozilla:masterfrom
suhaibmujahid:hackbot-webhooks
Draft

Support triggering the bug-fix agent for follow-ups when mentioning @hackbot#6353
suhaibmujahid wants to merge 3 commits into
mozilla:masterfrom
suhaibmujahid:hackbot-webhooks

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Note

This PR car be reviewed commit by commit

This PR will add support to trigger the bug-fix agent for follow-ups when mentioning @hackbot in a comment on a Phabricator revision.

Both consumers run in hackbot-api's event loop (the webhook route and the
apply handler awaited by the action applier), so the Conduit client is now
async (httpx.AsyncClient). The apply handler's helpers become async, with
_repository_phid cached via async-lru instead of functools.lru_cache.
Comment on lines +155 to +164
user_prompt = (
f"Follow up on Phabricator revision D{revision_id} for bug {bug}.\n\n"
f"A reviewer left a comment (see the instructions in your system "
f"prompt). Address it: investigate, make the necessary source "
f"changes, and verify the fix. When you are done, submit your "
f"changes by calling submit_patch with revision_id={revision_id} so "
f"the existing revision D{revision_id} is updated — do not create a "
f"new revision.\n\n"
f"Consult the relevant rules in {rules_path} if they apply."
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would also be nice to support the use case where the comment is just a question for hackbot to answer. I can imagine a reviewer asking a question about a patch (e.g. "verify this can't do bla bla bla"), either from hackbot or also from another engineer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will update it to support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants