Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The agent can send security-marked bugs to Claude and overwrite newer Bugzilla whiteboard edits, while its broker exposes an unnecessary file-writing tool.
9 open issues
Skip security-keyword bugs during preflight · New Append tags to current whiteboard and avoid duplicate actions · New Restrict the broker to the agent's required read tools · New Wait for broker readiness before starting the agent · New Fail lookups when requested comments cannot be loaded · New Check attachment metadata before recording actions · New Skip bugs resolved during model evaluation · New Bump API version to deploy the agent registry entry · New Set the Job execution timeout explicitly · New
What changed in this PR
This PR adds hackbot-capable, a Hackbot agent that screens Firefox performance-testing bugs for the existing bug-fix agent. The companion Bugbot rule is intended to run hourly on newly filed bugs from Mozilla employees. The new agent recommends candidates without starting a fix run.
Changes:
- Reads Bugzilla reports and uses Searchfox to check whether a fix is small, well defined, and testable on Linux.
- Tags positive candidates with
[hackbot-capable]and posts an explanation in Bugzilla. Negative verdicts leave the bug unchanged and keep the reasoning in the dashboard. - Adds the agent to the Hackbot API and dashboard, with local containers, deployment configuration, and tests.
| File | Description |
|---|---|
uv.lock |
Registers the agent and its dependencies in the workspace lockfile. |
services/hackbot-ui/lib/agents.ts |
Adds the agent to dashboard selectors. |
services/hackbot-api/tests/test_actions_applier.py |
Updates the expected set of agents that can auto-apply actions. |
services/hackbot-api/app/schemas.py |
Defines the agent’s API inputs. |
services/hackbot-api/app/agents.py |
Registers the job and its auto-apply policy. |
docs/hackbot/security.md |
Lists the agent among those that use a credential broker. |
docs/hackbot/agents.md |
Adds the agent to the Hackbot catalog. |
docker-compose.yml |
Includes the agent’s local Compose configuration. |
agents/hackbot-capable/VERSION |
Sets the initial agent version. |
agents/hackbot-capable/tests/test_agent.py |
Tests verdict handling, whiteboard updates, and container configuration. |
agents/hackbot-capable/README.md |
Documents behavior, triggers, and local setup. |
agents/hackbot-capable/pyproject.toml |
Defines packaging, dependencies, and test settings. |
agents/hackbot-capable/hackbot.toml |
Sets Cloud Run resources for the agent and broker. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/templates/comment.md |
Defines the Bugzilla comment format. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/prompts/system.md |
Defines the model’s eligibility criteria and response format. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/broker.py |
Serves Bugzilla tools from a separate container that holds the API key. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/agent.py |
Fetches bug context, obtains a verdict, and records Bugzilla actions. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/__main__.py |
Loads run settings and starts the agent. |
agents/hackbot-capable/hackbot_agents/hackbot_capable/__init__.py |
Marks the agent’s Python package. |
agents/hackbot-capable/Dockerfile |
Builds separate agent and broker images. |
agents/hackbot-capable/compose.yml |
Runs the agent and broker together locally. |
.taskcluster.yml |
Runs the agent’s tests in continuous integration. |
.github/workflows/hackbot-prod-deploy.yml |
Adds the agent to the production deployment selector. |
.github/CODEOWNERS |
Assigns ownership to the Hackbot performance team. |
Review effort: Balanced
| return f"the bug is already resolved ({bug['resolution']})" | ||
| if WHITEBOARD_TAG in (bug.get("whiteboard") or ""): | ||
| return f"the bug already has {WHITEBOARD_TAG}" | ||
| return None |
| await bugzilla_actions.update_bug( | ||
| actions_recorder, | ||
| bug_id=bug, | ||
| changes={"whiteboard": f"{whiteboard} {WHITEBOARD_TAG}".strip()}, |
| ) | ||
| ) | ||
| ctx = BugzillaContext(client=client) | ||
| sdk_config = build_sdk_server("bugzilla", ctx, bugzilla.TOOLS) |
| - ${HOME}/hackbot/artifacts:/artifacts | ||
| depends_on: | ||
| hackbot-capable-broker: | ||
| condition: service_started |
| bugs = json.loads(text).get("bugs") or [] | ||
| if not bugs: | ||
| raise AgentError(f"bug {bug}: not found or not accessible") | ||
| return bugs[0] |
| bug_fields, bugzilla_mcp_server=bugzilla_mcp_server, **judge_options | ||
| ) | ||
|
|
||
| if verdict.capable: |
| whiteboard = latest.get("whiteboard") or "" | ||
| if WHITEBOARD_TAG not in whiteboard: | ||
| # Recorded, not applied: the apply step sends the two as one Bugzilla | ||
| # update, so the tag never lands without its explanation. | ||
| await bugzilla_actions.update_bug( | ||
| actions_recorder, | ||
| bug_id=bug, | ||
| changes={"whiteboard": f"{whiteboard} {WHITEBOARD_TAG}".strip()}, | ||
| reasoning=verdict.reasoning, | ||
| ) | ||
| await bugzilla_actions.add_comment( | ||
| actions_recorder, | ||
| bug_id=bug, | ||
| text=render_comment(verdict.reasoning), | ||
| reasoning=verdict.reasoning, | ||
| ) |
| auto_apply_actions=False, | ||
| auto_apply_requires_consent=True, | ||
| ), | ||
| "hackbot-capable": AgentSpec( |
| # the bug capable, and vouches for exactly those runs with | ||
| # `findings.auto_apply`. | ||
| auto_apply_actions=True, | ||
| auto_apply_requires_consent=True, |
|
@gmierz why not also attempting the fix directly? It will be cheaper because the bug info and the analysis of the agent will be in the model's cache. |
|
@marco-c I can definitely do that! Mainly started with this since I'm not sure what the determination will look like, but I guess in the worst case, we could just abandon the proposed patch. I'll make the changes. |
|
You could also have a first pass that determines if it's simple enough, and the second pass within the same session that builds the fix. |


This patch adds a new hackbot agent that will be used to determine if a bug is simple to fix with the bug-fix agent. If it is, it will add a
[hackbot-capable]whiteboard tag along with a comment with the reasoning. If it isn't, nothing is added to the bug but the reasoning for why would still be found in the dashboard. This information will then be used by us to trigger a hackbot bug-fix run from bugzilla if we find the reasoning is good, and it makes sense to trigger it.This agent would be triggered from the bugbot rule here on an hourly basis: mozilla/bugbot#3125
This is restricted to only mozilla-employee filled bugs from the bugbot rule as well.