Skip to content

Refactor autowebcompat agent into a series of tasks#6287

Merged
suhaibmujahid merged 3 commits into
mozilla:masterfrom
jgraham:autowebcompat_tasks_refactor
Jul 9, 2026
Merged

Refactor autowebcompat agent into a series of tasks#6287
suhaibmujahid merged 3 commits into
mozilla:masterfrom
jgraham:autowebcompat_tasks_refactor

Conversation

@jgraham

@jgraham jgraham commented Jul 7, 2026

Copy link
Copy Markdown
Member

Currently the agent does two things: checks in nightly and checks with Chrome Mask enabled. These are done in a single Firefox session and a single invocation of the LLM. However this approach won't scale; if we want to check on multiple browsers, multiple Firefox versions, etc. putting all the logic into the LLM prompt will be fragile and hard to debug.

Instead create a base Task class that knows how to invoke the LLM and get results out. Then create a specific subclass for each kind of operation we're interested in, and write some business logic to deterministically wire them together according to our needs.

@jgraham

jgraham commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

CC @ksy36

@jgraham jgraham requested a review from suhaibmujahid July 7, 2026 09:56
@jgraham jgraham force-pushed the autowebcompat_tasks_refactor branch from 0a81798 to 65580a7 Compare July 7, 2026 10:44
Comment thread agents/autowebcompat-repro/hackbot_agents/autowebcompat_repro/agent.py Outdated
@jgraham jgraham force-pushed the autowebcompat_tasks_refactor branch from 852ee34 to 47baaf4 Compare July 8, 2026 09:47

@suhaibmujahid suhaibmujahid left a comment

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.

Have we evaluated the results on a single task and a multi-task? Did we see improvements when we tackled them separately?

Comment thread libs/hackbot-runtime/hackbot_runtime/__init__.py Outdated
@jgraham jgraham force-pushed the autowebcompat_tasks_refactor branch from 6121f1d to 13e1a12 Compare July 8, 2026 14:00
@jgraham

jgraham commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Have we evaluated the results on a single task and a multi-task? Did we see improvements when we tackled them separately?

No, but for later cases we want to be able to deterministically control what the agent does, rather than just writing text and hoping that it follows the instructions; see e.g. a4451a8 That also allows us to only provide the agent with the permissions it needs and the resources it needs at each stage (e.g. we only enable access to the browser chrome when strictly needed to enable chrome mask, we only download the specific version of Firefox when we actually want to test that one). We could try to put some of that logic into MCPs and put the model in control of more, but it makes more sense to me to just make the deterministic steps normal code and call out to the model only when required. This will also allow us to use different efforts or different models for different steps in the future (e.g. Chrome Mask probably doesn't need to be high effort)

@jgraham jgraham force-pushed the autowebcompat_tasks_refactor branch from 13e1a12 to 03c562e Compare July 9, 2026 12:43
jgraham and others added 3 commits July 9, 2026 13:44
Currently the agent does two things: checks in nightly and checks with
Chrome Mask enabled. These are done in a single Firefox session and a
single invocation of the LLM. However this approach won't scale; if we
want to check on multiple browsers, multiple Firefox versions,
etc. putting all the logic into the LLM prompt will be fragile and
hard to debug.

Instead create a base Task class that knows how to invoke the LLM and
get results out. Then create a specific subclass for each kind of
operation we're interested in, and write some business logic to
deterministically wire them together according to our needs.
@jgraham jgraham force-pushed the autowebcompat_tasks_refactor branch from 03c562e to 1757eb7 Compare July 9, 2026 12:44
@suhaibmujahid

Copy link
Copy Markdown
Member

but it makes more sense to me to just make the deterministic steps normal code and call out to the model only when required

What makes more sense is not necessarily what performs better for the agent. Providing the instruction in the initial prompt is not the only way; there are many ways to go with that. We could land this for now and iterate later.

@suhaibmujahid suhaibmujahid merged commit c93df5f into mozilla:master Jul 9, 2026
7 checks passed
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