Skip to content

ref(coding integrations): get current branch from autofix state#111368

Merged
sehr-m merged 2 commits intomasterfrom
fix/autofix-agent-branch-enrichment
Mar 23, 2026
Merged

ref(coding integrations): get current branch from autofix state#111368
sehr-m merged 2 commits intomasterfrom
fix/autofix-agent-branch-enrichment

Conversation

@sehr-m
Copy link
Member

@sehr-m sehr-m commented Mar 23, 2026

Previously getting branch name from preferences, which can be empty and allow an LLM to hallucinate in a handoff. This PR switches to using the seer-resolved value from autofix-state which gets the head from the github repo. A corresponding PR makes the needed changes in getsentry to use these values in the request.

@sehr-m sehr-m requested a review from a team as a code owner March 23, 2026 22:25
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 23, 2026
# If branch_name is unset in preferences, resolve it from the autofix run state
if not repo.branch_name:
try:
autofix_state = get_autofix_state(run_id=run_id, organization_id=group.organization.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't have a lot of context on what requires the branch name but if the branch name is missing can it be set in Seer in the preference table updated there? This function get_autofix_state make a call to Seer just to get the state for the branch name.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no way to know when we should set branch name in Seer I think this is fine in theory.

Copy link
Member Author

@sehr-m sehr-m Mar 23, 2026

Choose a reason for hiding this comment

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

Technically the preference table is for someone to say that they explicitly want seer to look at something that isn't the default branch whereas seer handles the logic to resolve to the current head branch if nothing is set, so this covers the edge case of someone who changes their default branch between two runs.

@sehr-m sehr-m merged commit 2abfe06 into master Mar 23, 2026
64 checks passed
@sehr-m sehr-m deleted the fix/autofix-agent-branch-enrichment branch March 23, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants