fix(robomp): parameterized bot identity in system prompts
system_append.md and system_append_pr_review.md hardcoded the literal
'robomp' as the bot persona, so the agent self-mentioned an account
that does not exist when deployments configure ROBOMP_BOT_LOGIN to a
different login. Affected users saw the agent ask for @robomp mentions
that GitHub never resolved to the actual bot.
Thread the configured login through persona.system_append and
persona.system_append_pr_review as a bot_login keyword, render it
via the existing {{bot_login}} placeholder, and pass
settings.bot_login at the worker callsite. Regression test asserts the
templated login lands in both prompts and the legacy literal is gone.
Fixes #1932
This commit is contained in:
@@ -128,12 +128,18 @@ def classify_next_step(primary: str) -> str:
|
||||
)
|
||||
|
||||
|
||||
def system_append(*, repo: RepoInfo, issue: IssueInfo, workspace: Workspace) -> str:
|
||||
return render(_load("system_append.md"), {"repo": repo, "issue": issue, "workspace": workspace})
|
||||
def system_append(*, repo: RepoInfo, issue: IssueInfo, workspace: Workspace, bot_login: str) -> str:
|
||||
return render(
|
||||
_load("system_append.md"),
|
||||
{"repo": repo, "issue": issue, "workspace": workspace, "bot_login": bot_login},
|
||||
)
|
||||
|
||||
|
||||
def system_append_pr_review(*, repo: RepoInfo, issue: IssueInfo, workspace: Workspace) -> str:
|
||||
return render(_load("system_append_pr_review.md"), {"repo": repo, "issue": issue, "workspace": workspace})
|
||||
def system_append_pr_review(*, repo: RepoInfo, issue: IssueInfo, workspace: Workspace, bot_login: str) -> str:
|
||||
return render(
|
||||
_load("system_append_pr_review.md"),
|
||||
{"repo": repo, "issue": issue, "workspace": workspace, "bot_login": bot_login},
|
||||
)
|
||||
|
||||
|
||||
def kickoff(*, repo: RepoInfo, issue: IssueInfo, workspace: Workspace) -> str:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
You are **robomp**, an autonomous triage-and-fix bot operating on `{{repo.full_name}}`.
|
||||
You are **@{{bot_login}}**, an autonomous triage-and-fix bot operating on `{{repo.full_name}}`.
|
||||
|
||||
<critical>
|
||||
- **Triage first.** Fresh, unclassified issue → first action is `classify_issue(primary=..., rationale=...)`. NEVER comment, push, open a PR, or run a repro until labels land.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
You are **robomp**, reviewing an incoming pull request on `{{repo.full_name}}`.
|
||||
You are **@{{bot_login}}**, reviewing an incoming pull request on `{{repo.full_name}}`.
|
||||
|
||||
<critical>
|
||||
- **Read-only PR review.** Never edit files, commit, push, open a PR, approve, request changes, merge, or close.
|
||||
|
||||
@@ -512,9 +512,19 @@ def _run_rpc_blocking(
|
||||
)
|
||||
inputs.db.set_event_model(inputs.delivery_id, chosen_model)
|
||||
append_system_prompt = (
|
||||
persona.system_append_pr_review(repo=inputs.repo, issue=inputs.issue, workspace=inputs.workspace)
|
||||
persona.system_append_pr_review(
|
||||
repo=inputs.repo,
|
||||
issue=inputs.issue,
|
||||
workspace=inputs.workspace,
|
||||
bot_login=inputs.settings.bot_login,
|
||||
)
|
||||
if task_kind == "review_pr"
|
||||
else persona.system_append(repo=inputs.repo, issue=inputs.issue, workspace=inputs.workspace)
|
||||
else persona.system_append(
|
||||
repo=inputs.repo,
|
||||
issue=inputs.issue,
|
||||
workspace=inputs.workspace,
|
||||
bot_login=inputs.settings.bot_login,
|
||||
)
|
||||
)
|
||||
|
||||
with RpcClient(
|
||||
|
||||
Reference in New Issue
Block a user