hackbot: bug-fix silently drops `comment` on a plain run, so there is no way to pass extra instructions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python, typescript
調査の方向性
services/hackbot-api/app/schemas.py と agents/bug-fix/hackbot_agents/bug_fix/main.py から始め、次に agent.py と prompt の triage-and-fix.md をたどってください。TriggerForm.tsx でオプションの入力を確認し、既存の textarea 入力とその扱いを比較してください。完了条件は、指示が通常の bug-fix 実行に INSTRUCTIONS として到達し、設定されている場合は prompt に安全に表示され、設定されていない場合は表示されないことです。
索引モデルが issue の本文から書いたものです。
説明
Problem
BugFixInputs.comment is only honored on the Phabricator follow-up path. agents/bug-fix/hackbot_agents/bug_fix/agent.py:117-126 renders prompts/follow-up.md with {comment} when revision_id is set, and otherwise renders prompts/triage-and-fix.md, which has no {comment} placeholder:
Bug to work on: {bug_id}
Task: Triage and fix the bug, and verify the fix
The rules in {rules_path} are available if the task calls for them, but the task above is your primary directive and overrides the default triage workflow.
The AgentInputs validator only enforces the other direction (revision_id ⇒ comment), and BugFixInputs ignores unknown fields, so POST /agents/bug-fix/runs with {"bug_id": 1234567, "comment": "start from the regression range in comment 4"} is accepted, stored on the run, passed to the container as COMMENT, and then silently dropped. Nothing tells the caller their instructions went nowhere.
The consequence is that there is no way to say anything to a plain bug-fix run beyond the bug id — not from the API, not from TriggerForm.tsx (which collects only bug_id, model, max_turns, effort), and not from a Slack action button.
Change
A new optional instructions on BugFixInputs (services/hackbot-api/app/schemas.py:79-88) and on the agent's AgentInputs (agents/bug-fix/hackbot_agents/bug_fix/__main__.py:8-45) — it reaches the job as INSTRUCTIONS for free through model_to_env — plus an {instructions} slot in triage-and-fix.md: empty when unset, and otherwise framed as guidance that does not override the rules, in the <...>-tag style follow-up.md already uses for untrusted comment text. The str.format safety argument at agent.py:47-55 covers it: substituted values are inserted verbatim and not re-scanned, so an untrusted instructions cannot break out of its placeholder.
Reusing comment instead would make one field mean two different things depending on whether revision_id is set, and would leave the follow-up path's revision semantics (phabricator_update_patch / phabricator_add_comment, config.py:30-36) entangled with a plain "focus here" hint. A separate field is cheaper to reason about.
Worth a <textarea> in TriggerForm.tsx alongside it, the way AutowebcompatReproInputs.bug_data and TestPlanGeneratorInputs.feature_description already have one.
Why this is filed on its own
It came up as the second half of a Slack action-button request: one button that triggers a bug-fix run on the triaged bug, and a second that triggers it with an accompanying prompt. The second one is not possible today, and it also needs a Slack modal (views.open + view_submission, with private_metadata carrying the message identity so the trigger claim still applies), which is receiver work on a different schedule.
Keeping that separate lets this input land whenever it lands. The silent drop of comment on a plain run is worth fixing on its own merits even if a second Slack button never ships.
- 主要言語
- Python
- スター
- 572
- フォーク
- 358
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 96
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/bugbug のほかの issue
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mozilla/bugbug#7046 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Drop redundant `hackbot_ui_url` field from Hackbot API settings対応中かも @RizgarOzan が 5 日前に担当しました。 オープンgood-first-bug hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
Fix ASYNC109 Ruff violations対応中かも @reginaldalfret が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mozilla/bugbug#6987 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug Triage-Needed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
FuRongJun-1999/dsh-memory#170 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
521xueweihan/HelloGitHub#3940 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100