From f081d71ca8f1f722273eb34ac2fd3c7b0bbf5d7c Mon Sep 17 00:00:00 2001 From: Suhaib Mujahid Date: Thu, 30 Apr 2026 12:19:35 -0400 Subject: [PATCH 1/3] Remove run-mode note from bug-fix prompt --- bugbug/tools/bug_fix/agent.py | 12 +----------- bugbug/tools/bug_fix/prompts/system.md | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/bugbug/tools/bug_fix/agent.py b/bugbug/tools/bug_fix/agent.py index d49132eab5..806cb132c2 100644 --- a/bugbug/tools/bug_fix/agent.py +++ b/bugbug/tools/bug_fix/agent.py @@ -112,20 +112,10 @@ def load_system_prompt( dry_run: bool, ) -> str: tmpl = (HERE / "prompts" / "system.md").read_text() - if dry_run: - mode = ( - "**DRY-RUN ACTIVE.** Bugzilla write tools (`update_bug`, " - "`add_comment`, `add_attachment`, `create_bug`) are disabled — " - "do not attempt them. Source-repo edits (Write/Edit) are still " - "allowed so you can prepare and inspect a candidate patch; the " - "caller will review diffs manually." - ) - else: - mode = "Writes are live. Be careful." + return tmpl.format( rules_dir=str(rules_dir.resolve()), extra_instructions=extra or "(none)", - run_mode_note=mode, ) diff --git a/bugbug/tools/bug_fix/prompts/system.md b/bugbug/tools/bug_fix/prompts/system.md index 86c887f045..5ece5c8667 100644 --- a/bugbug/tools/bug_fix/prompts/system.md +++ b/bugbug/tools/bug_fix/prompts/system.md @@ -81,9 +81,6 @@ Always be **brief** and to the point. Do not post long-winded comments, develope Do **not** post private comments, all developers on the bug need to see the comments. -# Run mode - -{run_mode_note} # Additional instructions for this run From bc60dc3585836b10b65c6c55626a50904f48ad03 Mon Sep 17 00:00:00 2001 From: Suhaib Mujahid Date: Tue, 5 May 2026 15:01:24 -0400 Subject: [PATCH 2/3] Remove unused dry_run parameter --- bugbug/tools/bug_fix/agent.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bugbug/tools/bug_fix/agent.py b/bugbug/tools/bug_fix/agent.py index 806cb132c2..dc1fe11f7c 100644 --- a/bugbug/tools/bug_fix/agent.py +++ b/bugbug/tools/bug_fix/agent.py @@ -106,11 +106,7 @@ def fetch_initial_bugs( # --------------------------------------------------------------------------- # -def load_system_prompt( - rules_dir: Path, - extra: str, - dry_run: bool, -) -> str: +def load_system_prompt(rules_dir: Path, extra: str) -> str: tmpl = (HERE / "prompts" / "system.md").read_text() return tmpl.format( From a6b3be5d9b2719377e0da6f3dc21706074b8ae89 Mon Sep 17 00:00:00 2001 From: Suhaib Mujahid Date: Tue, 5 May 2026 15:36:03 -0400 Subject: [PATCH 3/3] Fix linter --- bugbug/tools/bug_fix/agent.py | 2 +- bugbug/tools/bug_fix/prompts/system.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bugbug/tools/bug_fix/agent.py b/bugbug/tools/bug_fix/agent.py index dc1fe11f7c..52509c84e5 100644 --- a/bugbug/tools/bug_fix/agent.py +++ b/bugbug/tools/bug_fix/agent.py @@ -319,7 +319,7 @@ async def run( print(f"[bug_fix] triaging {len(selected)} bug(s): {selected}", file=sys.stderr) # --- Build agent options ------------------------------------------ # - system_prompt = load_system_prompt(rules_dir, instructions, dry_run) + system_prompt = load_system_prompt(rules_dir, instructions) options = ClaudeAgentOptions( system_prompt=system_prompt, diff --git a/bugbug/tools/bug_fix/prompts/system.md b/bugbug/tools/bug_fix/prompts/system.md index 5ece5c8667..2070320426 100644 --- a/bugbug/tools/bug_fix/prompts/system.md +++ b/bugbug/tools/bug_fix/prompts/system.md @@ -81,7 +81,6 @@ Always be **brief** and to the point. Do not post long-winded comments, develope Do **not** post private comments, all developers on the bug need to see the comments. - # Additional instructions for this run {extra_instructions}