Migrate build repair agent to Hackbot#6232
Open
evgenyrp wants to merge 16 commits into
Open
Conversation
Pure rename to preserve git history before reworking the contents for the hackbot port. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pure renames to preserve git history before reworking the contents for the hackbot port: agent.py -> hackbot_agents/build_repair/agent.py prompts.py -> hackbot_agents/build_repair/prompts.py build_repair_eval.py -> buildrepair_eval/eval.py Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pure renames to preserve git history before reworking the contents for the hackbot port: config.py -> hackbot_agents/build_repair/config.py eval.py -> build-repair/evals/buildrepair_eval/eval.py Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Preserves file history; the prior move staged it as add+delete. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # .github/dependabot.yml # pyproject.toml # services/hackbot-api/app/agents.py # services/hackbot-api/app/schemas.py
There was a problem hiding this comment.
Pull request overview
This PR migrates the Firefox build-repair agent from the legacy BugBug service/scripts into the Hackbot platform, wiring it into hackbot-api, Hackbot runtime/source checkout, and a new Docker/Compose-based agent + broker setup (plus a new eval harness).
Changes:
- Add
hackbot-agent-build-repairworkspace package with two-stage agent, Bugzilla broker sidecar, Taskcluster log download/sanitization, optional try-push tooling, and eval harness. - Extend Hackbot runtime to support pinning the source checkout to a specific ref/commit (
SOURCE_REF/[source].ref) and extend agent-tools with targeted builds + better Bugzilla error normalization. - Remove the old
services/buildrepairimplementation and standalone evaluation script, and update compose/dependabot/workspace lockfile accordingly.
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds the new build-repair agent workspace package and its dependencies (incl. eval extras). |
| services/hackbot-api/tests/test_agents.py | Adds registry + env-serialization tests for the new build-repair agent inputs. |
| services/hackbot-api/app/schemas.py | Introduces BuildRepairInputs schema for hackbot-api runs. |
| services/hackbot-api/app/agents.py | Registers the build-repair agent in AGENT_REGISTRY. |
| services/buildrepair/README.md | Removes legacy build-repair service documentation. |
| services/buildrepair/pyproject.toml | Removes legacy build-repair service packaging. |
| services/buildrepair/Dockerfile | Removes legacy build-repair service Docker image. |
| services/buildrepair/docker-compose.dev.yml | Removes legacy build-repair dev compose config. |
| scripts/build_repair_eval.py | Removes legacy standalone eval CLI. |
| libs/hackbot-runtime/tests/test_source.py | Adds tests for pinning source checkout to a specific ref/commit. |
| libs/hackbot-runtime/tests/test_context.py | Updates context tests to include ref / SOURCE_REF handling. |
| libs/hackbot-runtime/hackbot_runtime/source.py | Adds ref support and shallow-fetch behavior for pinned commits. |
| libs/hackbot-runtime/hackbot_runtime/context.py | Plumbs SOURCE_REF / config ref into ensure_source_repo. |
| libs/hackbot-runtime/hackbot_runtime/config.py | Adds [source].ref to runtime configuration. |
| libs/agent-tools/agent_tools/firefox/tools/build_firefox.py | Adds optional build target and ensures toolchain paths are on PATH post-bootstrap. |
| libs/agent-tools/agent_tools/firefox/init.py | Exposes target argument on the public MCP tool wrapper and updates docs. |
| libs/agent-tools/agent_tools/bugzilla.py | Normalizes more Bugzilla request failures into structured ToolErrors. |
| docker-compose.yml | Includes the new build-repair agent compose file at the repo root. |
| bugbug/tools/build_repair/try_server.py | Removes legacy try-server logic from old agent implementation. |
| bugbug/tools/build_repair/prompts.py | Removes legacy prompt templates. |
| bugbug/tools/build_repair/config.py | Removes legacy agent config (models, sandbox/tool allowlist, etc.). |
| bugbug/tools/build_repair/agent.py | Removes the legacy build-repair agent implementation. |
| agents/build-repair/README.md | Adds Hackbot-based build-repair agent docs (local + eval usage). |
| agents/build-repair/pyproject.toml | Adds the new agent package definition (incl. eval extra). |
| agents/build-repair/hackbot.toml | Declares Hackbot source/firefox config for the new agent. |
| agents/build-repair/hackbot_agents/build_repair/try_push.py | Adds optional try-push MCP tool(s) for build-repair runs. |
| agents/build-repair/hackbot_agents/build_repair/prompts.py | Adds new Hackbot-oriented analysis/fix prompts (MCP Bugzilla + log paths + targeted build guidance). |
| agents/build-repair/hackbot_agents/build_repair/logs.py | Adds Taskcluster log download + sanitization utilities. |
| agents/build-repair/hackbot_agents/build_repair/config.py | Defines models + tool allowlists (Bugzilla, Firefox build, optional try-push). |
| agents/build-repair/hackbot_agents/build_repair/broker.py | Adds Bugzilla MCP broker sidecar that holds the Bugzilla API key. |
| agents/build-repair/hackbot_agents/build_repair/agent.py | Implements the two-stage Hackbot agent orchestration + tool result capture. |
| agents/build-repair/hackbot_agents/build_repair/main.py | Wires runtime context + env inputs into run_build_repair (including SOURCE_REF). |
| agents/build-repair/hackbot_agents/build_repair/init.py | Introduces the build-repair agent package module. |
| agents/build-repair/evals/worktree.py | Implements worktree management for parallel eval trials (Hackbot agent runs don’t need worktrees in prod). |
| agents/build-repair/evals/verify.py | Adds LLM-as-a-judge verification module for evals (data contamination cutoff logic included). |
| agents/build-repair/evals/scorer.py | Updates eval scoring outputs (drops token accounting fields). |
| agents/build-repair/evals/eval.py | Adds the new Weave evaluation harness for the ported agent. |
| agents/build-repair/evals/init.py | Introduces evals package module. |
| agents/build-repair/Dockerfile | Adds agent/broker/eval multi-stage images for build-repair. |
| agents/build-repair/compose.yml | Adds compose services for broker, agent, and profile-gated eval harness. |
| .github/dependabot.yml | Removes dependabot updates for the deleted legacy buildrepair service. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+75
to
+81
| resp = requests.get(url, headers=_HEADERS, timeout=_TIMEOUT) | ||
| resp.raise_for_status() | ||
| full_path.write_text(resp.text) | ||
| sanitized = sanitize_log(resp.text) | ||
| sanitized_path.write_text( | ||
| sanitized if sanitized else f"(no ERROR -/FATAL - lines matched in {url})\n" | ||
| ) |
Contributor
Author
ok, let me address Copilot's comments |
Contributor
Author
|
Ok, I see you marked most of them as resolved. I guess we can skip those |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is to preserve the same capabilities but run it on the new Hackbot platform. We'll continue iterating on it in the follow-up PRs. It now runs successfully with Docker Compose and evals.
Successful eval + traces
Changes in Hackbot libs
Changes in the agent
Changes in evals
Known issues