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
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
from hackbot_runtime import HackbotContext, run_async
from pydantic_settings import BaseSettings, SettingsConfigDict
from datetime import datetime

from hackbot_runtime import (
BaseAgentInputs,
HackbotAgentResult,
HackbotContext,
run_async,
)

from .agent import AutowebcompatReproResult, run_autowebcompat_repro
from .firefox_install import install_firefox_nightly
from .setup_profile import setup_profile


class AgentInputs(BaseSettings):
class AgentInputs(BaseAgentInputs):
bugzilla_mcp_url: str
bug_data: str | None = None
bug_id: int | None = None
model: str | None = None
max_turns: int | None = None
effort: str | None = None

model_config = SettingsConfigDict(extra="ignore")


async def main(ctx: HackbotContext) -> AutowebcompatReproResult:
inputs = AgentInputs()
class AutowebcompatResult(HackbotAgentResult):
result: AutowebcompatReproResult
start_time: datetime
end_time: datetime

# Provision a fresh Nightly at startup so each run reproduces against a
# current build; drive the binary the install reports back.
firefox_path = str(install_firefox_nightly())

# Build a profile with Chrome Mask preinstalled.
chrome_mask_profile = setup_profile(firefox_path, extensions=["chrome-mask"])

return await run_autowebcompat_repro(
async def main(ctx: HackbotContext) -> AutowebcompatResult:
inputs = ctx.load_inputs(AgentInputs)
start_time = datetime.now()
tracker, result = await run_autowebcompat_repro(
bugzilla_mcp_server={
"type": "http",
"url": inputs.bugzilla_mcp_url,
Expand All @@ -37,11 +38,18 @@ async def main(ctx: HackbotContext) -> AutowebcompatReproResult:
model=inputs.model,
max_turns=inputs.max_turns,
effort=inputs.effort,
firefox_path=firefox_path,
chrome_mask_profile=chrome_mask_profile,
log=ctx.log_path,
verbose=True,
)
end_time = datetime.now()

return AutowebcompatResult(
result=result,
num_turns=tracker.num_turns,
total_cost_usd=tracker.total_cost_usd,
start_time=start_time,
end_time=end_time,
)


if __name__ == "__main__":
Expand Down
Loading