Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions agents/autowebcompat-diagnosis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
FROM python:3.12 AS builder

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

ENV UV_PROJECT_ENVIRONMENT=/opt/venv

WORKDIR /app

# Install external deps without building workspace members.
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=VERSION,target=VERSION \
uv sync --frozen --no-dev --no-install-workspace --package hackbot-agent-autowebcompat-diagnosis

RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,target=/app,rw \
uv sync --locked --no-dev --no-editable --package hackbot-agent-autowebcompat-diagnosis

FROM python:3.12 AS base

WORKDIR /app

ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PATH="/opt/venv/bin:$PATH"

FROM base AS agent

# The agent needs Node.js + npm to run the DevTools MCP servers (npm packages;
# the python base ships neither) and the shared libraries the browsers require
# to run headless. The browser binaries themselves are downloaded at agent
# startup (a fresh build per run): Firefox via mozdownload/mozinstall and Chrome
# for Testing via the Chrome-for-Testing JSON API (see browser.py).
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
# Node.js, to run the Firefox and Chrome DevTools MCP servers.
nodejs npm \
# Shared by both browsers.
ca-certificates \
# Firefox runtime deps.
libgtk-3-0 libdbus-glib-1-2 libx11-xcb1 libxtst6 libxt6 libpci3 \
# Chrome runtime deps.
libnss3 libnspr4 libatk1.0-0t64 libatk-bridge2.0-0t64 libatspi2.0-0t64 \
libcups2t64 libdbus-1-3 libgbm1 libxcomposite1 libxdamage1 libxfixes3 \
libxrandr2 libxkbcommon0 libasound2t64 libpango-1.0-0 libcairo2 \
fonts-liberation \
&& rm -rf /var/lib/apt/lists/*

# Install the DevTools MCP servers + puppeteer from the pinned
# package.json/lockfile. PUPPETEER_SKIP_DOWNLOAD stops puppeteer's install
# script from fetching its own browser: the agent drives the runtime-downloaded
# Firefox/Chrome binaries (mozdownload / Chrome for Testing) via executablePath,
# so a puppeteer-managed browser would only bloat the image.
COPY agents/autowebcompat-diagnosis/package.json \
agents/autowebcompat-diagnosis/package-lock.json \
/app/node/
RUN cd /app/node && PUPPETEER_SKIP_DOWNLOAD=1 npm ci --omit=dev

# The agent-loop engines ship their own CLI/app-server binaries with their
# Python SDKs, installed into /opt/venv above: the `claude` CLI via
# claude-agent-sdk (default backend) and the `codex app-server` via
# openai-codex (the codex backend, selected with the `backend` input).

# hackbot.toml lives at the agent root (not inside the package), so copy it into
# the working dir; the runtime discovers it there (cwd) at startup.
COPY agents/autowebcompat-diagnosis/hackbot.toml /app/hackbot.toml

RUN useradd --create-home --shell /bin/bash agent \
&& mkdir -p /workspace \
&& chown agent:agent /workspace

USER agent

COPY --from=builder /opt/venv /opt/venv

CMD ["python", "-m", "hackbot_agents.autowebcompat_diagnosis"]

FROM base AS broker

RUN useradd --create-home --shell /bin/bash broker

USER broker

EXPOSE 8765

COPY --from=builder /opt/venv /opt/venv

CMD ["python", "-m", "hackbot_agents.autowebcompat_diagnosis.broker"]
8 changes: 8 additions & 0 deletions agents/autowebcompat-diagnosis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
To run with OpenAI model:

BUGS_FILE_HOST=$PWD/agents/autowebcompat-diagnosis/bugs.json RUN_ID=batch-codex BACKEND=codex DOCKER_DEFAULT_PLATFORM=linux/amd64 MODEL=gpt-5.6 docker compose -p awc-codex -f agents/autowebcompat-diagnosis/compose.yml up autowebcompat-diagnosis-agent --build


With Claude:

BUGS_FILE_HOST=$PWD/agents/autowebcompat-diagnosis/bugs.json RUN_ID=batch-claude DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose -p awc-claude -f agents/autowebcompat-diagnosis/compose.yml up autowebcompat-diagnosis-agent --build
262 changes: 262 additions & 0 deletions agents/autowebcompat-diagnosis/bugs-large.json

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions agents/autowebcompat-diagnosis/bugs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"id": 2053077,
"summary": "www.jobs.abbott - OTP entry fields appear as drop-downs",
"description": "Created attachment 9605024\nOPT input field issue Nightly vs Chrome\n\n**Environment:**\nOperating system: Windows\nFirefox version: Firefox 152.0.1 (release) / Firefox Nightly 154.0a1 (2026-07-06)\n\n**Preconditions:**\n- Clean profile\n\n**Steps to reproduce:**\n1. Navigate to: https://www.jobs.abbott/us/en/apply?jobSeqNo=ABLAUS31152679ENUSEXTERNAL&step=1&stepname=applicantAcknowledgment\n2. Enter an email address (e.g \"test34@mail.com\") in the Email input field\n3. Click the \"Get OPT\" button\n4. Observe the OPT entry fields \n\n**Expected Behavior:**\nThe OPT entry fields are rendered accordingly and the introduced numbers are displayed accordingly\n\n**Actual Behavior:**\nOTP entry fields appear as drop-downs and the introduced numbers are not displayed \n\n**Notes:**\n- Reproducible on the latest Firefox Release and Nightly\n- Reproducible regardless of the ETP setting\n- Works as expected using Chrome\n\n---\n\nCreated from webcompat-user-report:5bc4b5d1-a4ff-4f71-b4a0-5dbc064605b2"
},
{
"id": 2040305,
"summary": "www.centuryasia.com.tw - \"Member Login\" pop-up window fails to load",
"description": "Created attachment 9587194\n\"Member Login\" pop-up window Nightly vs Chrome\n\n**Environment:**\nOperating system: Windows\nFirefox version: Firefox 150.0.3 (release) / Firefox Nightly 152.0a1 (2026-05-17) \n\n**Preconditions:**\n- Clean profile\n\n**Steps to reproduce:**\n1. Navigate to: https://www.centuryasia.com.tw/login.html?obj=l&obj1=i&ver=I+DfKKUJFcA=#login\n2. Notice the missing \"Member Login\" pop-up window\n3. Click \"Member Login\" button\n4. Observe the page\n\n**Expected Behavior:**\n\"Member Login\" pop-up window is displayed accordingly on page load and when clicking the \"Member Login\" button\n\n**Actual Behavior:**\n\"Member Login\" pop-up window fails to load on page load and when clicking the \"Member Login\" button\n\n**Notes:**\n- Reproducible on the latest Firefox Release and Nightly\n- Reproducible regardless of the ETP setting\n- Works as expected using Chrome\n\n---\n\nCreated from webcompat-user-report:91450d12-f07b-4676-91f4-626b6ccc7980"
},
{
"id": 2052489,
"summary": "drmeth.com - Layout is broken, elements are overlapped and not scaled properly in the center of the page",
"description": "Created attachment 9604208\nimage.png\n\n**Environment:**\nOperating system: Linux/Windows 10\nFirefox version: Firefox 136.0 (release)/152/154\n\n**Preconditions:**\n- Clean profile\n\n**Steps to reproduce:**\n1. Navigate to: https://drmeth.com/\n2. Observe the page.\n\n**Expected Behavior:**\nThe elements are displayed correctly.\n\n**Actual Behavior:**\nElements are overlapped and not scaled properly in the center of the page.\n\n**Notes:**\n- Reproducible on the latest Firefox Release and Nightly\n- Reproducible regardless of the ETP setting\n- Works as expected using Chrome\n\n---\n\nCreated from webcompat-user-report:46454e87-7689-4b88-943a-8f163859539d"
}
]
49 changes: 49 additions & 0 deletions agents/autowebcompat-diagnosis/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
services:
autowebcompat-diagnosis-broker:
build:
context: ../..
dockerfile: agents/autowebcompat-diagnosis/Dockerfile
target: broker
environment:
BUGZILLA_API_URL: ${BUGZILLA_API_URL}
BUGZILLA_API_KEY: ${BUGZILLA_API_KEY}
expose:
- "8765"

autowebcompat-diagnosis-agent:
build:
context: ../..
dockerfile: agents/autowebcompat-diagnosis/Dockerfile
target: agent
environment:
- RUN_ID
- BUG_DATA
- BUG_ID
# Batch mode: set BUGS_FILE_HOST=/host/path/bugs.json on the host; it is
# mounted read-only at /bugs.json and BUGS_FILE is set so the agent reads
# it. Leave BUGS_FILE_HOST unset for single-bug runs (BUGS_FILE stays
# empty -> batch mode off).
- BUGS_FILE=${BUGS_FILE_HOST:+/bugs.json}
- BUGZILLA_MCP_URL=http://autowebcompat-diagnosis-broker:8765/mcp
- BACKEND
# Optional overrides for whichever backend is selected. MODEL is the
# model id (e.g. claude-opus-4-8, or gpt-5.5 for codex); EFFORT is the
# reasoning effort. Unset -> the backend's own default.
- MODEL
- EFFORT
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:?error}
# Needed only for the codex backend (BACKEND=codex); optional otherwise so
# the default claude path runs without an OpenAI key present.
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
# No uploader locally: summary/logs/attachments are written under
# /artifacts/<run_id>, bind-mounted to the host's ~/hackbot/artifacts.
- ARTIFACTS_DIR=/artifacts
volumes:
- ${HOME}/hackbot/artifacts:/artifacts
# Batch bugs file, mounted read-only. Defaults to /dev/null when
# BUGS_FILE_HOST is unset, which is harmless because BUGS_FILE is then
# empty and the agent runs in single-bug mode.
- ${BUGS_FILE_HOST:-/dev/null}:/bugs.json:ro
depends_on:
autowebcompat-diagnosis-broker:
condition: service_started
3 changes: 3 additions & 0 deletions agents/autowebcompat-diagnosis/hackbot.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# autowebcompat-diagnosis needs no platform prep: no [source] checkout, no [firefox] build.
# Subject comes from the request (bug_data / bug_id); the DevTools MCP drives
# Firefox and Chrome instances installed in the image.
Loading