Skip to content

Link Hackbot actions by their recorded IDs instead of Ref - #7270

Open
ayoubdiourin7 wants to merge 3 commits into
mozilla:masterfrom
ayoubdiourin7:ayoubdiourin7/use-recorded-action-ids-uuid-generated-instead-o-2
Open

ayoubdiourin7 wants to merge 3 commits into
mozilla:masterfrom
ayoubdiourin7:ayoubdiourin7/use-recorded-action-ids-uuid-generated-instead-o-2

Conversation

@ayoubdiourin7

Copy link
Copy Markdown
Contributor

Fixes #7232

@ayoubdiourin7
ayoubdiourin7 requested a review from a team as a code owner October 22, 2026 19:05

@suhaibmujahid suhaibmujahid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! If the server instructions approach woks well, it will be a nice adn clean solution.

Comment thread libs/hackbot-runtime/hackbot_runtime/actions/try_server.py Outdated
Comment thread libs/hackbot-runtime/hackbot_runtime/actions/phabricator.py Outdated
Comment thread docs/hackbot/actions.md

When you record `phabricator_submit_patch` to create a new revision, do not also record `bugzilla_add_comment` in the same run. The patch description already appears as a Bugzilla comment, so another comment would be redundant.

When recording a Try push, include its Treeherder URL as {{{{actions.<ref>.url}}}} in the Phabricator revision's test_plan. Record the Try push before submitting the Phabricator patch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to test to make sure that we do not regress on this front.


action = recorder.record("bugzilla.create_bug", body, reasoning=reasoning, ref=ref)
action = recorder.record("bugzilla.create_bug", body, reasoning=reasoning)
return confirmation(action)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of the confirmation process, we could list the fields it exposes, such as url, revision_id or bug_id, so the agent doesn’t have to guess. Alternatively, we could include that information in the tool description.

type=action["type"],
params=action.get("params", {}),
ref=action.get("ref"),
ref=action.get("action_id"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to stay backward compatible, at least for some time:

Suggested change
ref=action.get("action_id"),
ref=action.get("action_id", action.get("ref")),

We should add a TODO to drop the backward compatibility part.

referenced = {
match.group(1)
for row, _ in pending
for match in _PLACEHOLDER_RE.finditer(json.dumps(row.params))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should parse this only once ad save it as structured data. We could do that in a follow-up.

result (`url`, or `bug_id` for a new bug) as `{{actions.<action_id>.<field>}}`; \
it is filled in when the actions are applied. For example, if an action returned \
`(ID: action-e42219b46c164b2c97785769d6bd1b3e)`, its `url` is \
`{{actions.action-e42219b46c164b2c97785769d6bd1b3e.url}}`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall discussing about having the action- prefix, and we decided to keep it since it is clearer for the agent. But now we are exposing it outside of the agent iteration. It becomes unnecessary prefix. We might want to drop that prefix.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use recorded action IDs (UUID generated) instead of agent-provided ref labels to link actions

2 participants