Skip to content

Add Chrome mask test to autowebcompat-repro agent#6226

Open
ksy36 wants to merge 2 commits into
mozilla:masterfrom
ksy36:autowebcompat-chrome-mask
Open

Add Chrome mask test to autowebcompat-repro agent#6226
ksy36 wants to merge 2 commits into
mozilla:masterfrom
ksy36:autowebcompat-chrome-mask

Conversation

@ksy36

@ksy36 ksy36 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR adds a script that creates a profile and installs Chrome mask extension from AMO and passes the profile to devtools MCP.

@ksy36 ksy36 changed the title Add Chrome mask test to autowebcompat repro Add Chrome mask test to autowebcompat-repro agent Jun 22, 2026
@ksy36 ksy36 force-pushed the autowebcompat-chrome-mask branch from aeeaf14 to 482f326 Compare June 22, 2026 18:34
@ksy36 ksy36 marked this pull request as ready for review June 23, 2026 02:14
@ksy36

ksy36 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

r? @jgraham @suhaibmujahid

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for running a “Chrome Mask” (Chrome UA spoofing) experiment as part of the autowebcompat-repro agent flow by provisioning a Firefox profile with the Chrome Mask extension installed and enabling the DevTools MCP privileged-context features needed to manage/verify the extension.

Changes:

  • Add setup_profile.py to build a Firefox profile and preinstall AMO extensions (used for Chrome Mask).
  • Extend DevTools MCP server config to optionally enable privileged-context tools + system access env var.
  • Update agent result schema and system prompt to include/report chrome_mask_fixed and document the Chrome Mask procedure.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/setup_profile.py New helper to download/install AMO XPI(s) into a profile and warm-launch Firefox to register them.
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/result.py Adds chrome_mask_fixed field to the structured result model/schema.
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/prompts/system.md Updates instructions to run the Chrome Mask test only after baseline reproduction and to verify UA spoofing.
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/devtools_mcp.py Adds enable_privileged_context option and wires --enable-privileged-context + env var.
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/agent.py Plumbs optional chrome_mask_profile through to DevTools MCP config and privileged-context toggle.
agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/main.py Installs Firefox Nightly and now builds/passes a Chrome Mask preinstalled profile into the agent run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/__main__.py Outdated
Comment thread agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/setup_profile.py Outdated
1. Identify the affected URL and the described broken behavior.
2. Navigate to the URL using the Firefox DevTools MCP and try to reproduce the issue.
3. Submit your findings via `submit_result` (see "Reporting your result").
2. Baseline: Navigate to the URL with the Firefox DevTools MCP and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is OK for now, but a lot of this is a set of deterministic steps. We don't need an LLM to execute things that we can represent directly in code; it's more token-heavy and less deterministic. I'd rather put this control flow in the harness and just use the LLM for the parts that aren't just running through an algorithm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, another option could be to have one profile without Chrome mask and another with Chrome mask but enabled globally. Or maybe it's possible to enable it for a given domain with a script that the agent will run. I can try a few options after we launch this first version.

Comment thread agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/setup_profile.py Outdated
Comment thread agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/setup_profile.py Outdated
Raises ``RuntimeError`` if an extension does not end up registered and
enabled in the profile.
"""
parent = Path(tempfile.mkdtemp(prefix="ff-profile-"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like we end up leaking this temporary directory. Is that expected (e.g. because we end up destroying the entire container) or should there be some teardown code that runs at the end of each agent run?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added a cleanup on error and after a successful run. But yes I assumed a container is destroyed after each run

@ksy36 ksy36 force-pushed the autowebcompat-chrome-mask branch from 3886492 to fb3ef6d Compare June 24, 2026 03:36
@ksy36 ksy36 requested a review from jgraham June 24, 2026 04:01
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.

3 participants