Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autofix): Add solution thumbs up / down #2214

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/seer/automation/autofix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ def terminal(cls) -> "frozenset[AutofixStatus]":
return frozenset((cls.COMPLETED, cls.ERROR, cls.CANCELLED))


class ProblemDiscoveryResult(BaseModel):
Copy link
Member Author

Choose a reason for hiding this comment

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

dedcode

status: Literal["CONTINUE", "CANCELLED"]
description: str
reasoning: str


class AutofixUserDetails(BaseModel):
id: Annotated[int, Examples(specialized.unsigned_ints)]
display_name: str
Expand Down Expand Up @@ -255,6 +249,8 @@ class CodebaseState(BaseModel):
class AutofixFeedback(BaseModel):
root_cause_thumbs_up: bool | None = None
root_cause_thumbs_down: bool | None = None
solution_thumbs_up: bool | None = None
solution_thumbs_down: bool | None = None


class AutofixGroupState(BaseModel):
Expand Down Expand Up @@ -467,7 +463,12 @@ class AutofixResolveCommentThreadPayload(BaseModel):

class AutofixFeedbackPayload(BaseModel):
type: Literal[AutofixUpdateType.FEEDBACK]
action: Literal["root_cause_thumbs_up", "root_cause_thumbs_down"]
action: Literal[
"root_cause_thumbs_up",
"root_cause_thumbs_down",
"solution_thumbs_up",
"solution_thumbs_down",
]


class AutofixUpdateRequest(BaseModel):
Expand Down
7 changes: 7 additions & 0 deletions src/seer/automation/autofix/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,19 @@ def receive_feedback(request: AutofixUpdateRequest):
with autofix_state.update() as cur:
if cur.feedback is None:
cur.feedback = AutofixFeedback()

if payload.action == "root_cause_thumbs_up":
cur.feedback.root_cause_thumbs_up = True
cur.feedback.root_cause_thumbs_down = False
elif payload.action == "root_cause_thumbs_down":
cur.feedback.root_cause_thumbs_up = False
cur.feedback.root_cause_thumbs_down = True
elif payload.action == "solution_thumbs_up":
cur.feedback.solution_thumbs_up = True
cur.feedback.solution_thumbs_down = False
elif payload.action == "solution_thumbs_down":
cur.feedback.solution_thumbs_up = False
cur.feedback.solution_thumbs_down = True


@inject
Expand Down
Loading