diff --git a/services/hackbot-api/app/agents.py b/services/hackbot-api/app/agents.py index 0876868949..d32409801d 100644 --- a/services/hackbot-api/app/agents.py +++ b/services/hackbot-api/app/agents.py @@ -34,6 +34,10 @@ class AgentSpec: # was; this is where that verdict is honored. Fails closed, so a run that reports # no verdict never qualifies. auto_apply_requires_consent: bool = False + # Whether a run that produced source changes is expected to submit those changes + # to Phabricator. Agents without Phabricator submission tools may legitimately + # leave a patch artifact behind, so they must not trigger the warning. + warn_on_unsubmitted_patch: bool = False def model_to_env(inputs: BaseModel) -> dict[str, str]: @@ -66,6 +70,7 @@ def model_to_env(inputs: BaseModel) -> dict[str, str]: job_name="hackbot-agent-bug-fix", input_schema=BugFixInputs, auto_apply_actions=True, + warn_on_unsubmitted_patch=True, ), "autowebcompat-repro": AgentSpec( name="autowebcompat-repro", diff --git a/services/hackbot-api/app/routers/runs.py b/services/hackbot-api/app/routers/runs.py index 5ef1c3214e..50350959e6 100644 --- a/services/hackbot-api/app/routers/runs.py +++ b/services/hackbot-api/app/routers/runs.py @@ -273,7 +273,12 @@ async def finalize_run(db: AsyncSession, run: Run) -> None: await db.commit() - if _has_unsubmitted_patch(summary, artifacts): + agent_spec = AGENT_REGISTRY.get(run.agent) + if ( + agent_spec is not None + and agent_spec.warn_on_unsubmitted_patch + and _has_unsubmitted_patch(summary, artifacts) + ): log.error( "Agent run produced code changes without submitting a patch " "(run_id=%s, agent=%s)",