Add agent tools to read revisions from Phabricator - #6438
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a read-only Phabricator (Differential) MCP tool surface and wires it into the bug-fix agent’s broker so follow-up runs triggered by Phabricator comments can fetch revision metadata, the full comment thread (including inline anchors), and the reviewed diff content.
Changes:
- Add new
phabricatorread-only tools:get_revision,get_revision_comments,get_revision_diff, including diff-size truncation and inline comment positioning. - Extend the shared
phabricator-clientwith revision lookup by ID and batched user PHID → username resolution. - Update the bug-fix broker to mount separate Bugzilla and Phabricator MCP endpoints and pass the Phabricator MCP server config into follow-up runs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/phabricator-client/phabricator_client/client.py | Adds revision lookup by numeric id and user PHID resolution helper. |
| libs/phabricator-client/tests/test_client.py | Adds test coverage for the new client methods. |
| libs/agent-tools/agent_tools/phabricator.py | Introduces read-only Phabricator MCP tools and supporting parsing/helpers. |
| libs/agent-tools/tests/test_phabricator.py | Adds comprehensive tests for the new Phabricator tools. |
| agents/bug-fix/hackbot_agents/bug_fix/broker.py | Mounts /bugzilla/mcp and /phabricator/mcp plus reworks patch endpoint creation. |
| agents/bug-fix/hackbot_agents/bug_fix/config.py | Defines the Phabricator read-only MCP tool allowlist for follow-up runs. |
| agents/bug-fix/hackbot_agents/bug_fix/agent.py | Plumbs an optional Phabricator MCP server into the agent and investigator toolsets. |
| agents/bug-fix/hackbot_agents/bug_fix/main.py | Derives the Phabricator MCP URL from the broker URL for follow-up runs. |
| agents/bug-fix/hackbot_agents/bug_fix/prompts/follow-up.md | Instructs follow-up runs to read full Phabricator context before acting. |
| agents/bug-fix/tests/test_inputs.py | Tests derivation of the Phabricator MCP endpoint URL. |
| agents/bug-fix/tests/test_broker.py | Updates broker tests for new mounts and refactored patch route wiring. |
| agents/bug-fix/compose.yml | Updates Bugzilla MCP URL to the new /bugzilla/mcp mount. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fd3c70a to
fe1d6ef
Compare
evgenyrp
left a comment
There was a problem hiding this comment.
I think at this point we should maintain concise, easily human-readable documentation on Hackbot and available functionality in /docs. When a change is made, this doc should also be changed. It can help with code reviews, understanding the state of the system, and obviously onboarding. It can even be sort of a changelog of what's happening.
Updates the bug-fix follow-up prompt to make reviewer-comment handling clearer and more concise.
marco-c
left a comment
There was a problem hiding this comment.
Approving on behalf of Evgeny since he already approved before, so we can merge.
Resolves #6433